5. Due to poor results of your prelim examination, your teacher decides to increase each student’s grade by 5. Get all the grades and compute for the new grade. If the original grade exceeds 90, the grade remains as such. (grade.cpp)
Requirements:
Function for the input.
Function for the formula/process together with the output.
Sample Run:
Name: Eugerico
Grade: 80
Your new grade is 85
Do you want to enter another record [y/n]? y
Name: Laurence
Grade: 91
Your grade is still 91.
Do you want to enter another record [y/n]? y
Name: Ana
Grade: 76
Your new grade is 81
Do you want to enter another record [y/n]? n
Exit
1
Expert's answer
2013-02-20T08:47:03-0500
# include <iostream> # include <string >
using namespace std;
int main(){
string name; int d=0; char ans; while (true){ cout<<"Name:"; cin.ignore(); getline(cin,name,'\n'); cout<<"Grade:"; cin>>d; cout<<"Your new grade:"; if (d<90) cout<<d+5<<endl; if (90<=d<100) cout<<d<<endl; cout<<"Continue?"; cin>> ans; if (ans=='n') break; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment