Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ . Observe the usual guidelines regarding the initial comment section, indenting, and so on. Your initial comment section must include your program name, your
c++
. Observe the usual guidelines regarding the initial comment section, indenting, and so on. Your initial comment section must include your program name, your name, date, and problem statement. . In if-else statements, indent statements to be executed for if or else conditions three to five spaces. Alignelse or else if with corresponding if 1 Modify problem 1 from last week's assignment as follows: Seed the random number generator with time and generate four random integers between the values of 10 and 30. Print the numbers. Calculate the arithmetic mean, harmonic mean, and geometric mean using the formulas below: armen + 4 Aarwnic WWW= 1 1 1 1 + + 1 Write selection statements to determine and print which mean is the smallest of the three. Do not determine merely by inspection. As verification, print all three means with 2 decimal digits. 2. Write a program that prompts the user for a year and determines and prints whether or not the year is a leap year. Hint: Use the modulus function in your logical expressions. The rules for determining leap years in the Gregorian calendar are: All years evenly divisible by 400 are leap years. Years evenly divisible by 100 but not by 400 are not leap years. Years divisible by 4 but not by 100 are leap years. . All other years are not leap years. II 3. Write a program to calculate a student's grade based on three test scores. Prompt the user for three test scores, calculate the average, and then determine the grade using the algorithm below. Use data type float or double for the test scores and averages If the average score is 90% or more, the grade is A. . If the average score is 70% or more and less than 90%, check the third score. If the third score is more than 90%, the grade is A: otherwise the grade is B If the average score is 50% or more and less than 70%, check the average of the second and third scores. If the average of the two is greater than 70%, the grade is C; otherwise the grade is D. If the average score is less than 50% then the grade is F. Implement the algorithm using nested statements within a given range rather than merely using all simple if statements. Within each if structure, assign the grade (do not print) to a character variable. Print the grade at the end of the program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started