I understand the point of asking a question is to not automatically be given the answer. However I have no clue how to even approach the given questions that are mentioned below. I looked up a way to do it on the Matlab website already but am lost.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
1.) Create a program to determine test grades based on the score and assuming a single input. The grades should be based on the following criteria -
--- Grade--------- Score--------
-------A-------------90 to 100-----
-------B-------------80 to 89------
-------C-------------70 to 79------
-------D-------------60 to 69------
-------E---------------<60----------
2.) Create a program that prompts the user to enter his or her year in school – freshman, sophomore, junior or senior. The input will be a string. Use the switch/case structure to determine which day finals would be given for each group – Monday for freshmen, Tuesday for sophomores, Wednesday for juniors and Thursday for seniors.
3.) Create a program using for loop to calculate the factorial of an inputted number.
4.) Repeat the above problem using while loop.
Antworten (3)
Ahmet Cecen
am 2 Nov. 2016
Create the functions first:
function letter = grade(points)
if this
letter = that
else if this
letter = that
so on.
Same with case structure for 2, for loop for 3, while loop for 4.
0 Kommentare
Image Analyst
am 2 Nov. 2016
Another helpful snippet you can adapt:
buttonNumber = menu('Enter your class', 'Freshman', 'Sophomore', 'Junior', 'Senior')
switch buttonNumber
case 1
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!