Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a c# program that stores student grades in a text file and read grades fro

ID: 3675499 • Letter: W

Question

Write a c# program that stores student grades in a text file and read grades from a text file.  The program has the following GUI:

There are four buttons: Create File, Save Case, Close File and Load File.  Initially, only the Create File and Load File buttons are enabled.  If the user clicks the Create File button, a Save File Dialog window opens for the user to specify the name and location of the new data file.  Then the Save Case and the Close File buttons are enabled while the Create File button is disabled.  The user enters name, ID and grade, and clicks the save Case button to add the student’s data to the data file.  

The user can enter as many cases as he wants, and then click the Close File button to close the file.  The Save Case and the Close File button will be disabled again while the Create button will be enabled again.

Data files used in this program are sequential-access text files.  Each student’s record is stored in a separate line, with comma inserted between data fields.  The following is an example:

Bob Jones,1001,A-

Sarah Johnson,1002,B+

Sam Smith,1003,C-

Whenever the Load File button is clicked, a Open File Dialog window opens for the user to choose.  Then the program will display the data stored in the file in a list box.  For each student, display name first, followed by student ID, and then grade.  Add space between data fields.  The following is an example:

Grade Form Name Student ID: Grade Create File Save Case Close File Load File

Explanation / Answer

using system.ComponentMode1;
using system.data;
using system.drawing;
using system.linq;
using system.text;
using system.threading.tasks;
using system.windows.forms;
using system.IO;
name Studentrades
{
public partial class frmGrades : Form
{
public frmGrades()
{
InitializeComponent();
}
private void frmGrades_Load9object sender,EventArgvs e)
{
string file path = @"give your own path here"
if(File.Exists(filePath))
{
streamReader stream = new Streamreader(filepath);
txtGrades.AppendText(stream.ReadTOEnd());
}
else
MessageBox.Show("There is problem loading the file");
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote