A numeric integer grade is between 50 and 99. Using integer division or otherwise obtain a int value that is 5, 6, 7, 8, or 9 from the numeric grade. Write code using a switch statement using this number in the selector expression that assigns letter grades based on this 10 point scheme: if the numeric_grade is not less than 90, the letter_grade is an A, if the numeric_grade is not less than 80, the letter_grade is a B, if the numeric_grade is not less than 70, the letter_grade is C, if the numeric_grade is not less than 60, the letter_grade is D, otherwise the letter_grade is F.
What will be an ideal response?
int value = numeric_grade/10;
switch(value)case 9: letter_grade = ‘A’;
break;
case 8: letter_grade = ‘B’;
break;
case 7: letter_grade = ‘C’;
break;
case 6: letter_grade = ‘D’;
break;
default: letter_grade = ‘F’;
break;
You might also like to view...
Given the declaration Circle x = new Circle(), which of the following statement is most accurate.
a. x contains an int value. b. x contains an object of the Circle type. c. x contains a reference to a Circle object. d. You can assign an int value to x.
Write a program to create a file named temp.txt if it does not exist. Write one hundred integers created randomly into the file using text I/O. Integers are separated by spaces in the file. Read the data back from the file and display the sorted data.
What will be an ideal response?
Media ____ are style sheet files that specify set parameters for displaying pages on separate devices.
A. installs B. views C. queries D. displays
In order to position a picture precisely on the page, you can line the picture up using the vertical and horizontal ________
A) rulers B) leaders C) nudge bars D) scroll bars