Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Plz i need help with C++ program Student Generated Code Assignments Option 1: Wr

ID: 640447 • Letter: P

Question

Plz i need help with C++ program

Student Generated Code Assignments Option 1: Write a program that will read in 3 grades from the keyboard and will print the average (to 2 decimal places) of those grades to the screen. It should include good prompts and labeled output. Use the examples from the earlier labs to help you. You will want to begin with a design. The Lesson Set 1 Pre-lab Reading Assignment gave an introduction for a design similar to this problem. Notice in the sample run that the answer is stored in fixed point notation with two decimal points of precision. Sample run: Please input the first grade 97 Please Input the second grade 98.3 Please Input the third grade 95 The average of the three grades is 96.77

Explanation / Answer

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
   double grade1, grade2, grade3, avg;

   cout << "Please enter first grade" << endl;
   cin >> grade1;
   cout << "Please enter second grade" << endl;
   cin >> grade2;
   cout << "Please enter third grade" << endl;
   cin >> grade3;

   avg = (grade1 + grade2 + grade3) / 3;
    cout << "The average of three grades is " << int(avg * 100) / 100.0;

    return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote