Site icon Tutor Bin

Hudson County Community College Write a Program Matlab Task

Hudson County Community College Write a Program Matlab Task

Description

1.Write a program that will ask the user for their age. Have MATLAB determine if their age

is greater than or equal to 18 (MATLAB displays a 1 or 0).
 

2. Ask  the  user  for  their  height  in  inches.  Convert  the  height  to  feet  and  use  the  display
function to print the following to the command window:
The length you entered converted to feet is:
value in feet
 

3. Repeat #2 only now using the display function to display the  following to the command
window:
The length you entered converted to feet is: value in feet
 

4. Repeat Question #2 only now use the fprintf function to display the following:
Your height of ____ inches is equivalent to ____ feet.
 

5. Repeat Question #2 but only this time ask the user for a row vector of lengths in inches.
Use  the  formatted  print  function  to  create  a  neat  table  of  the  values  in  inches  and  their
conversions to feet. The values should be displayed in labelled columns.
 

6. I’m using your code to determine how many students scored a 70 or above on a quiz. Have
your program ask me (the program user) for a vector of quiz grades. Find which elements
in the vector I provide are greater than or equal to 70.
 

7. Continuing Question #6, display the grades of the students who did not score a 70 or above
to the command window.
 

8. Continuing Question #6, display the following to the command window (you will need to
use some built-in functions to do this):  
Out of ____ students, ____ did not achieve a grade of 70 or above.
 

9. Write a program which asks the user for their score on the exam. Display their letter grade
based on the following.
Grades >= 90 are an A
Grades >= 80 are a B
Grades >= 70 are a C
Grades >= 60 are a D
Grades < 60 are an F
 

10. Some students only care if they passed the exam. Have the user enter their numeric exam
score  and  determine  if  they  passed  (A,B,C,  or  D)  or  if  they  failed  (F). Either  display  a
sentence stating that they did pass, or they did not pass.
 

11. I’m again counting on you to help me analyze grades. Have your program ask the program
user for a vector of quiz grades. Determine if 70% of the student population scored an 80 

or above. If 70% scored an 80 or above, display a sentence stating that I met the target an
if not, display a sentence stating that I did not meet the target student performance.
 

12. Continuing Question #11, find how many students scored above 90 on the quiz. Display a
sentence stating:
Out of ____ students, ____ scored a 90 or above.
 

13. You’re writing a program to determine which sports league a child must register for. Ask
the  program  user  for  the  child’s  age  and  display  an  informative  sentence  for  the  criteria
below.
If the entered age is below zero, display an error message.
If the age is younger than 4, tell the user the child is too young to play.
If the age is greater than or equal to 4 but less than 7, tell the user the child may
play in the pee-wee league.
If the age is greater than or equal to 7 but less than 10, tell the user the child must
play in the squirts league.
If the age is greater than or equal to 10 but less than 12, tell the user the child may
play in the midgets league.
If the age is 12 or above, the child is too old to play.
 

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version