Loops and Decisions Assignment
jpFluteExplain 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.
- 8 years ago
- 20
Purchase the answer to view it
- loops_and_decisions_assignment.docx
Purchase the answer to view it
- loops_and_decisions_assignment.docx
Purchase the answer to view it
- loops_and_decisions_assignment.docx
- Quality and Performance Improvement Analysis Paper (Bench Mark)
- For Kim Woods Only
- Gator Divers is a company that provides divers services such as underwater s
- art homework Paragraph#1 The first paragraph should begin with an adequate introduction explaining the where, when, why and who information. This introduction allows...
- disscussion reply to the question asked from students minimum words count 75
- work
- english 1 page only REFLECTION
- introduction to Psychology module 1
- Donna Harp Tax Problems
- Mentor updates