Create a program that stores student grades in a text file. The file should cont
ID: 3626801 • Letter: C
Question
Create a program that stores student grades in a text file. The file should contain the name, ID number, class taken and grade of every student. Allow the user to load a grade file and display its contents in a read-only TextBox. The entries should be displayed in the following format:LastName, FirstName: ID# Class Grade
Some sample data:
Jones, Bob: 1 "Introduction to Computer Science" "A-"
Johnson, Sarah: 2 "Data Structures" "B+"
Smith, Sam: 3 Data Structures" "C"
Explanation / Answer
#include 002 #include 003 using namespace std; 004 005 struct students{ 006 int ID; 007 int q1; 008 int q2; 009 int e1; 010 int e2; 011 int assg1; 012 int assg2; 013 int assg3; 014 }; 015 016 017 int main(){ 018 019 int ID; 020 char command; 021 students grades[Num_grades]; 022 int i =0; 023 int Num_Students = 65; 024 while(!infile.eof()){ 025 infile >> grades[i].ID; 026 infile >> grades[i].q1; 027 infile >> grades[i].q2; 028 infile >> grades[i].e1; 029 infile >> grades[i].e2; 030 infile >> grades[i].assg1; 031 infile >> grades[i].assg2; 032 infile >> grades[i].assg3; 033 i++; 034 } 035 036 ifstream infile; 037 infile.open("grades.txt"); 038 039 ofstream outfile; 040 outfile.open("report.txt"); 041 042 043 do{ 044 coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.