Explain the difference between:
s = 0;
If (x > 0) s++;
If (y > 0) s++;
and
s = 0;
if (x > 0) s++;
else if (y > 0) s++;
Part B
What are the values of s and n after the following loops?:
a. int s = 1;
int n = 1;
while (x < 10)
s = s + n;
n++;
b. int s = 1;
int n;
for (n = 1; n < 5; n++)
s = s + n;
c. int s = 1;
int n = 1;
do
{
s = s + n;
n++;
}
while (s < 10 * n);
Part C
Write a program that accepts four grades, calculates the average of the four grades, and then converts the average from a number grade into a letter grading using the following grading scale:
A 100 – 90
B 89 – 80
C 79 – 70
D 69 – 60
F 59 – 0
Output the final grade average along with the letter grade.
Submit a screenshot of the executed program and the code of the program.
Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]