Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using c++ . Read the instructions carefully. Submit your source code file on Blackboard. You may submit multiple times. Source code files must be plain

image text in transcribedusing c++

. Read the instructions carefully. Submit your source code file on Blackboard. You may submit multiple times. Source code files must be plain text files ending with the extension .cpp. If your source code does not meet these minimum requirements, you will receive a zero for that submission. Compile your programs on erdos with g++ -Wall. Programs that fail to compile on erdos will receive an automatic zero. Programs that successfully compile but have warnings will have points deducted for each warning. Working With File I/O Write a program that reads students' grades from a file and calculates the average with the lowest grade dropped. The input data file contains a set of student records, with one student per line. Each line of the input data file has the following structure: last_name first_name grade 1 grade2 grade3 ... graden Each item on a line is separated by a space (or spaces). last name and first name are of type string and the grades are of type int. The range for valid grades is 0 to 100 inclusive. It is possible for a line in the data file to have a student's name without any grades. Each line of output for this program should contain the following information: the student's first and last name, followed by each valid grade that was read, followed by the average of all valid grades where the lowest grade was dropped. The average should be formatted to 4 decimal places. If a student does not have any valid grades or no grades at allthen the output should be: first_name last_name N/A Program Requirements 1. Name your source code file average.cpp. 2. Write and use!) a function named openfile that takes an ifstream object as a parameter. The function prompts the user for the name of the data file and opens the file for reading. If the call to open fails, the function should gracefully terminate the program. CISC 2000 Computer Science II Homework Assignment 3 3. Overload the function openfile such that it takes an ofstream object as a parameter. The function prompts the user for the name of the output file and opens it for writing. If the call to open fails, the function should gracefully terminate the program. 4. A valid grade is a grade between 0 and 100 inclusive. Write a function that returns a bool and takes 3 parameters: a grade; the minimum valid grade; and the maximum valid grade. The function should return true if minimum grade grade

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_2

Step: 3

blur-text-image_3

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

Big Data In Just 7 Chapters

Authors: Prof Marcus Vinicius Pinto

1st Edition

B09NZ7ZX72, 979-8787954036

More Books

Students also viewed these Databases questions