Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++) The Department of Education has commissioned a study to determine if Males or Females score better on a particular test. They also want to

(C++)

The Department of Education has commissioned a study to determine if Males or Females score better on a particular test. They also want to study if Community College or University students score better. Researchers have created a data file (scores.txt) which contains the scores attained by the student sample. The first column is the students name, the second column is the students gender (M for male, and F for female), the third column indicates Community College (CC) or 4 year (UN), and the last column specifies the score. A specimen of the file scores.txt is attached as part of this assignment. (Information from .txt is at the bottom of the question)

Your assignment is to prompt the user to enter the filename with the path on disk. If the file does not exist in the specified location, your program should exit with a suitable error message.

The first thing your program should do is output to the screen a copy of the data read in from the disk file, echoing the input data.

Your program should then calculate and display the average score for males, females, community college students, and university students. Display your results to two places of decimals, and write your program to automatically list your four calculated averages one to a line, along with a suitable label for each result.

Finally, your program should calculate and display to two places of decimals the overall average score for all of the students surveyed.

Important note: input files sometimes have their end of file on the same line as the last line of data, sometimes the end of file is by itself on the next line. Your program needs to handle either case, and I sometimes see the case where the student processes the last line of data twice due to this case. Please test this case. Please assume I will change the test file for my testing and likely use multiple test files.

(Information from .txt)

Bailey M CC 68 Harrison F CC 71 Grant M UN 75 Peterson F UN 69 Hsu M UN 79 Bowles M CC 75 Anderson F UN 64 Nguyen F CC 68 Sharp F CC 75 Jones M UN 75 McMillan F UN 80 Gabriel F UN 62

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions