Let\'s consider an input file that contains student id (int), first name (string
ID: 3576177 • Letter: L
Question
Let's consider an input file that contains student id (int), first name (string), last name (string), and grade (float). We assume that the file contains between 1 and 100 grades. Write a program that: Declare the structure named student composed of id (int), first (string), last (string), and grade (float). Asks the user for the name of the input file. Reads the grades from the file to fill up an array of type student. This file should be out of order on purpose. Calculates and displays the maximum grade in the array with name. Calculates and displays the minimum grade in the array with name. Calculates and displays the average grade Calculates and displays how many students were processed. Produce a file with the information above based on a file name provided by the user. The main idea is to explore the benefits of using structs. So every task should be done after the whole array is filled up The files must contain at least 5 records All items must be done with functions w/parameters.Explanation / Answer
#include<iostream>
#include<fstream>
#include<iomanip>
using namespace std;
class student
arithmetic, english, comscience;
double per;
char grade;
void calculate();
public:
void getdata();
void showdata() const;
void show_tabular() const;
int getIDNum() const;
};
void student::calculate()
void student::getdata()
come back idnum;
}
void SaveStudent();
void displayAll();
void Searchdisplay(int);
void modifyStudent(int);
void deleteStudent(int);
void DisplayClassResult();
void DisplayResult();
void write_student()
cin.ignore();
cin.get();
inFile.close();
}
int main()
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.