Friday, November 27, 2020

Student Average Grade in C++

 In this tutorial I will teach you how to solve the student average grade using C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

// student_average_grade.cpp

// Mr. Jake Rodriguez Pomperada,MAED-IT,MIT

// www.jakerpomperada.com / www.jakerpomperada.blogpspot.com

// jakerpomperada@gmail.com

// November 27, 2020  Friday

// Bacolod City, Negros Occidental Philippines


#include <iostream>

#include <iomanip>

#include <ctype.h>


using namespace std;



int main()

  {

 

double first_grade=0.00;

  double second_grade=0.00;

  double third_grade=0.00;

  double average_grade=0.00;

  string student_name,remarks;

 

  char reply='Y';

 

  do {

  

  std::cout << "\n\n";

  std::cout << "\tStudent Average Grade in C++";

  std::cout << "\n\n";

  cin.ignore(256, '\n');

std::cout << "\tEnter Student Name : ";

  std::getline (std::cin,student_name);

    std::cout << "\tEnter 1st Grade : ";

  cin >> first_grade;

  std::cout << "\tEnter 2nd Grade : ";

  cin >> second_grade;

  std::cout << "\tEnter 3rd Grade : ";

  cin >> third_grade;

 

  

    average_grade = (first_grade 

                 + second_grade 

+ third_grade)/3;

 

  if (average_grade >= 75) {

 

  remarks = "Passed";

    } else {

    remarks = "Failed";

}

std:: cout << setprecision(2) <<fixed <<"\n";

std::cout << "\tThe Average of " <<student_name

      << " is " <<average_grade;

std::cout <<"\n\n";      

std::cout << "\tRemarks : " << remarks;

std::cout << "\n\n";

std::cout << "\tWould You Like to Try Again? (Y for Yes / N for No) ";

cin >> reply;  

} while (toupper(reply) == 'Y');

std::cout << "\n\n";

  std::cout << "\tEnd of Program";

 

  }


No comments:

Post a Comment