Prepare a c++ scores must input by the user to compute its total quiz.
Name Quiz1 Quiz2 Quiz3 Quiz4 Total Quiz
(20/20) (30/30) (15/15) (25/25) 90/90
Jessa Lee 12 15 15 20
Bino Ang
Cora Tan
Keni Lao
Cala Mansi
Dala Gan
#include <iostream>
using namespace std;
int main()
{
string name;
int quiz1;
int quiz2;
int quiz3;
int quiz4;
int total_Quiz;
cout<<"\nEnter the name of the student: ";
cin>>name;
cout<<"\nEnter quiz1: ";
cin>>quiz1;
cout<<"\nEnter quiz2: ";
cin>>quiz2;
cout<<"\nEnter quiz3: ";
cin>>quiz3;
cout<<"\nEnter quiz4: ";
cin>>quiz4;
total_Quiz=quiz1+quiz2+quiz3+quiz4;
cout<<"\nName\t\tQuiz1\t\tQuiz2\t\tQuiz3\t\tQuiz4\t\tTotal Quiz\n";
cout<<name<<"\t\t"<<quiz1<<"\t\t"<<quiz2<<"\t\t"<<quiz3<<"\t\t"<<quiz4<<"\t\t"<<total_Quiz<<"\n";
return 0;
}
Comments
Leave a comment