Answer to Question #222168 in C++ for save

Question #222168

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)

++++++++++++++++++++++++++++++

Sample Input #1

21 40

Sample Output #1

(21/40)x60+40=71.50


1
Expert's answer
2021-08-01T00:29:35-0400
#include <iostream>
#include <iomanip>
using namespace std;




int main(){
	float score;
	int totalItems;
	
	cin>>score;
	
	cin>>totalItems;




	float labGrade=(score / totalItems) * 60 + 40;




	cout<<fixed<<("(")<<21 <<" /"<< totalItems<<")" <<" x 60 + 40 = "<<setprecision(2)<<labGrade<<"\n";


 




		return 0;




}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS