Question: /* * Program to calcuate average scores * * Name: * Date: January 29, 2021 */ #include #include #include using namespace std; /* * Main


/* * Program to calcuate average scores * * Name: * Date: January 29, 2021 */ #include #include #include
using namespace std; /* * Main - calcualtes average scores * Return: status */ int main() { double sOne; double sTwo; double sThree; double sFour; double avg; int aOne; int aTwo; int aThree; int aFour;
cout > sOne >> sTwo >> sThree >> sFour; cout
/*Calculations*/ aOne = sOne / 10; aTwo = sTwo / 10; aThree = sThree / 10; aFour = sFour / 10; avg = (sOne + sTwo + sThree + sFour) / 4;
/*Display*/ cout
return 0; }
Submit: AvgBar.cpp Test Files: C2334 Cho3 Hmwk1 AvgBar Test.zip Description: This program is part 2 of the Average-Bar Chart program. You should be building on last week's AvgBar.cpp Instead of reading the numbers directly from the user, read them from a file. Prompt the user for the filename. When printing the score, print it 3 characters wide, right-justified For the bar chart, change the number printed after each :' to that many *'s to create a bar chart. For example, 80: 8" should now be " 80: ******** You'll have to be clever with setw, setfill, left, right, and printing a space to make this happen You MAY NOT use any loops or if statements to accomplish the bar chart The average should be formatted to only print a single digit after the decimal point Sample Run #1 (bold, underlined text is what the user types): File? scores.txt 80: ******** 60: 95: 100: Avg = 83.8 X scores - Notepad File Edit Format View Help 80 60 95 100 > Ln 1, Col 1 100% Windows (CRLF) UTF-8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
