Program
Create a program that asks for the student's score and the number of items in a laboratory exercise. It will then compute for the grade using the formula. I recommend you to study and review on our lesson on Datatypes and Variables (Identifier).
Input
The user is required to enter two (2) inputs where the first input is the student score and the second one is the total number of items.
Output
The program will display the solution or formula (Score / Total # of Items) x 60 + 40 followed by an equal sign then the equivalent laboratory grade with two decimal places of the student. (Refer to the sample output)
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
float Score;
float TotalItems;
cout<<"Enter Score: ";
cin>>Score;
cout<<"Enter Total # of Items: ";
cin>>TotalItems;
float laboratoryGrade=(Score / TotalItems) * 60 + 40;
cout<<fixed<<"(Score / Total # of Items) x 60 + 40 = "<<setprecision(2)<<laboratoryGrade<<"\n";
cin>>laboratoryGrade;
return 0;
}
Comments
Leave a comment