English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The grading policy is: 90 points or more, A; 80 to 89, B; 70 to 79, C; 60 to 69, D; 59 and below, F. To convert a point score to a letter grade, you should use

a. An if statement.
b. A switch statement.
c. A while statement.
d. A for statement.

2007-02-26 17:16:42 · 6 answers · asked by student 2 in Computers & Internet Programming & Design

6 answers

Switch case would be best. Is this your homework? xD

PS. This question is rather naughty for using the word "should"! The academically correct answer would be to use a switch case. However, switch cases are something of a relic in modern computer languages. A lot of modern programmers (myself and most of the people here included) would, in practicality, use an IF conditional.

2007-02-26 17:19:41 · answer #1 · answered by Anonymous · 0 0

Switch.

2007-02-26 17:26:16 · answer #2 · answered by Anonymous · 0 0

an if statement:
if(points >= 90)
{ letter grade = A
}
if (points >= 80)
{
letter grade = B}
...

2007-02-26 17:22:29 · answer #3 · answered by mgarrard14 2 · 0 0

Although it can be done with both a and b, the best way to do may be with switch statement.
That's my suggestion, but it's up to you, whichever you find easier!
Good Luck!

2007-02-27 18:57:44 · answer #4 · answered by A.Samad Shaikh 2 · 0 0

i would prefer an IF statement..but a switch statement can be used also. So its either one of it..A or B.

2007-02-26 17:21:39 · answer #5 · answered by Pre-T 2 · 0 0

//create a string array with days of the week, Google arrays for extra information //arrays initiate at 0, var days = ['Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday', 'Sunday']; //next comes a loop //counter starts at 0 var counter = 0; //the on a similar time as loop, days.length is 0-6 or 7 days to the week, proceed looping on a similar time as counter is decrease than that on a similar time as(counter < days.length) { //we write what's in the '()', hence, (arrays commencing at 0) days[0] = Monday, days[a million] = Tuesday //then we upload, or concatenate a "," (comma) to the top of the regardless of day is revealed. record.write(days[counter] + ","); //we upload a million to the counter, and the loop keeps counter++; } this could print out "Monday", then a comma, the 1st time in the path of the loop. 2nd time by way of we get "Tuesday" and then a comma, etc. days[counter] ^array...^index of an ingredient in the array + "," ^ provides a comma i wish this facilitates!

2016-12-14 06:43:18 · answer #6 · answered by goslin 4 · 0 0

fedest.com, questions and answers