Question

In: Computer Science

A system is set up to take raw grading information from the console and calculate a...

A system is set up to take raw grading information from the console and calculate a consolidated grade. The information comes in as a single line with last name, first name, homework grade ( a total out of 20 ), lab grade ( a total out of 50 ), exam grade average, and a letter ( upper or lower ) indicating Audit, Passfail, or Grade.

Sample input:                    Mary(first name) Poppins(last name) g(indication) 17(homework grade) 28(lab grade) 87(exam grade)

A program should be written that takes the input data and calculates a consolidated grade based upon 10% Homework, 20 % Lab , and 70% Exams. The output should be formatted with no decimals.

first initial last name - final grade  

for a pass/fail student output should indicate only Pass or Fail . For an audit output should say not gradeable.

Using C++

Solutions

Expert Solution

Below is the code for the above problem:

#include <iostream>

using namespace std;

//main method to start the program
int main()
{
string firstName;
string lastName;
char ch;
float homegrade;
float labgrade;
float examGrade;
cout<<"enter the info"<<endl;
cin>>firstName;
cin>>lastName;
cin>>ch;
cin>>homegrade;
cin>>labgrade;
cin>>examGrade;
//find total marks
int total = ((homegrade/30)*10 + (labgrade/50)*20 + (examGrade/100)*70);
//if user wants grade
if(ch == 'G')
{
cout<<firstName<<" "<<lastName<<" "<<total;
}
//if user wants pass or fail
else if(ch == 'P')
{
if(total > 33) //above 33% are passed. Take according to your rules.
{
cout<<firstName<<" "<<lastName<<" "<<"Pass";
}
else
{
cout<<firstName<<" "<<lastName<<" "<<"Fail";
}
}
//if user wants audit
else if(ch == 'A')
{
cout<<"Not gradeable";
}
return 0;
}

OUTPUT:


Related Solutions

A grading scale is set up for 1000 students’ test scores. It is assumed that the...
A grading scale is set up for 1000 students’ test scores. It is assumed that the scores are normally distributed with a mean score of 80 and a standard deviation of 10: a)    What proportion of students will have scores between 40 and 85? b)    If 60 is the lowest passing score, what proportion of students pass the test? c)    What score would a student have to score to be in the 68th percentile? d)    What score would a student...
Mountain Ski Corp. was set up to take large risks and is willing to take the...
Mountain Ski Corp. was set up to take large risks and is willing to take the greatest risk possible. Lakeway Train Co. is more typical of the average corporation and is risk-averse. Projects Returns: Expected Value Standard Deviation A $ 267,000 $ 207,000 B 732,000 406,000 C 129,000 116,000 D 164,000 258,000 a-1. Compute the coefficients of variation. (Round your answers to 3 decimal places.) a-2. Which of the following four projects should Mountain Ski Corp. choose? Project A Project...
Nina is looking to analyze the distribution of the variable X=’grading. She gathered information from 1900...
Nina is looking to analyze the distribution of the variable X=’grading. She gathered information from 1900 to 2000, and her data concludes X follows a normal distribution with mean 75 and variance 30. What is the probability that a typical student from the current cohort enrolled receive a grade above 80? Between what values will the grades of the 95% of all students in the current cohort fall? Find the value that represents the 25th and 75th percentile of this...
In the USA law system to set up own business a. what it means to be...
In the USA law system to set up own business a. what it means to be unincorporated, the advantages and disadvantages b. the significance of opening an incorporated business? What are the advantages and disadvantages of this type of business? c. what is a Limited Liability Partnership? What responsibilities and liabilities do the partners have for themselves individually, to the firm/to each other in the firm and to the public? d. if person needs additional capital to begin his new...
Set up the system of equations that are needed to be solved using Lagrange multipliers in...
Set up the system of equations that are needed to be solved using Lagrange multipliers in order to find the dimensions of the rectangular box with an open-top, having volume 4000 m^3 with a minimal surface area.
Tennindo, Inc. is starting up its​ new, cost-efficient gaming system​ console, the yuu. Tennindo currently has...
Tennindo, Inc. is starting up its​ new, cost-efficient gaming system​ console, the yuu. Tennindo currently has 3 comma 500 ​cash-paying customers and makes a profit of ​$60 per unit. Tennindo wants to expand its customer base by allowing customers to buy on credit. It estimates that credit sales will bring in an additional 1 comma 000 customers per​ year, but that there will also be a default rate on credit sales of 5​%. It costs ​$250 to make a​ yuu,...
Tennindo, Inc. is starting up its​ new, cost-efficient gaming system​ console, the yuu. Tennindo currently has...
Tennindo, Inc. is starting up its​ new, cost-efficient gaming system​ console, the yuu. Tennindo currently has 5, 000 ​cash-paying customers and makes a profit of ​$40 per unit. Tennindo wants to expand its customer base by allowing customers to buy on credit. It estimates that credit sales will bring in an additional 1,400 customers per​ year, but that there will also be a default rate on credit sales of 5​%. It costs ​$230 to make a​ yuu, which retails for...
Systems engineering: Take an example of a complex system (real or made up). According to the...
Systems engineering: Take an example of a complex system (real or made up). According to the System Engineering Flow diagram, chart all different stages of its development. Also give the task participation by different participants (Sys. Engg, Test Engg., Design Engg. etc.) at different levels.
Part a) Calculate the statistic, set up the rejection region, interpret the result, and draw the...
Part a) Calculate the statistic, set up the rejection region, interpret the result, and draw the sampling distribution. i) H0: µ=10 H1: µ≠10 Given that: σ=10, n=100, X =13, α=0.05. ii. .H0: µ=50 H1: µ<50 Given that: σ=15, n=100, X =48, α=0.05. Part b) A statistics practitioner is in the process of testing to determine whether is enough evidence to infer that the population mean is different from 180. She calculated the mean and standard deviation of a sample of...
Given the following information set up the problem in a transportation table and solve for the...
Given the following information set up the problem in a transportation table and solve for the minimum-cost plan: PERIOD 1 2 3   Demand    550       700      750         Capacity                 Regular    500       500      440           Overtime    50       50      50           Subcontract    120       120      100         Beginning inventory    100            Costs           Regular time $   60 per unit     Overtime $   80 per unit     Subcontract $   90 per unit       Inventory...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT