Question

3. Write a program to save college expense data to a file. Name the file CollegeExpenses.dat. Save

the file in the Debug folder. Input the data as needed and append it to the data file. Input the date

using nuds and then build a date string. The date format is mm/dd/yyyy. The record structure is:

Date, Amount, Item, Type, Payee, Description

Use a ListBox for the type and use the following items:

College, Food, Housing, Travel, Medical, Misc.

Test Scores Example

Batch Processing

Scores, dat

5076, 82, 85, 90,81

ID Test 1

5076 82

Pass/Fail

if (average > 70)

(

Find Average

average (testi test2 test3+ test4) / 4;

}

else

(

numPassed ++;

grade "Pass";

}

Test 2

85

nunFailed ++;

grade "Fail"

Find Best and Worst Average

if (average highAverage)

(

Test 3

90

highAverage average;

highID = ID;

Test 4

81

private void no_Click(object sender, EventArgs e)

(

//Declarations

string P

do

Ext

K/n}

else

(

}

}

{

HIRRID 101

Find Best and Worst Average

if (average > highAverage)

{

}

nunFailed ++;

grade = "Fail";

highAverage average;

highID = ID;

if (average< lowAverage)

average;

lowAverage

lowID = ID;

Count Records

numRecords++;

private void bendo click(object sender, EventArgs e)

(

//Declarations

string 10

double testi, test, test, test

double average- ;

int numPassede, unfailed;

sting hight, lo

of

Page 100

//Preprocessing

rtbout.Clear();

rtbout AppendText

rtbout.AppendText("

HIS $15: Software Project Management"+"\n");

Student Test Results Fall 2822""""")

rtbout.AppendText 10 Test 1 Test 2 Test 3 Test 4 Average Grade" ");

//20 initializations

string pathcore."

Streamleader textin new Streamleader(

new FileStream(path, Filetode.Open, Filccess.Read))

//Processing loop

while (textin.Peek()-1)

(

string rou text.

string[] record row.split("");

ID record[0];

testi Convert.ToInt32(record[1]);

Question image 1Question image 2