Question

1. Write a program to read employee figures from a file. The file is Recycling Salaries.zip. The record

structure is: first name, last name, ID, title, salary, 401(k).

Read the records from the file. Find their monthly gross salary. Find the employee share of the

FICA. Find the employee share of the 401(k) contribution. Find the employee's net pay. Display those

results. Count and display the number of records. Find and display the total gross pay, total FICA

contributions, total 401(k) contributions and the total net pay.

Center the application on your form. Remove the minimize and maximize buttons. Include an Exit

Button on your form.

using System.IO;

//Preprocessing

//10 initializations

string path = @"SampleData.dat";

Streamliriter textout new StreamWriter(

new FileStream(path, FileMode.Append, FileAccess.Write));

//Processing

//Get date

//Build output string

outputline "

//Output

//Write to File

textOut.WriteLine(outputline);

//Postprocessing

textOut.Close();

DO AS THE EXAMPLE!!!!

//10 initializations

string path = @"SampleData.dat";

Streariter textout = new Streamiriter(

new FileStream(path, FileMode.Append, FileAccess.Write));

//Input

int month a Convert.ToInt32 (nudMonth. Value);

int date Convert.ToInt32(nudDate.Value);

int year Convert.ToInt32(nudYear.Value);

string first txtfirst.Text;

string last txtLast.Text;

double net Convert.ToDouble(txtNetworth. Text);

string day Convert.ToString(1stDay. SelectedItem);

//Processing

//Get date

string dateString Convert.ToString(month) "/";

dateString Convert.ToString(date) "

dateString + Convert.ToString(year);

//Build outple string

string outputline last+""+

first + ","

dateString".

Convert.ToString(net)+","

day;

//Output

//Write to File

textOut.WriteLine(outputline);

//Postprocessing

textOut.Close();

* PLEASE/nfields and field order

delimiter

plain text files

no formatting

data written one record at at time

no loop

open file in preprocessing

close file once record is written

data can be written in batches

loop needed

open the file once

write multiple records while processing the batch

close the file when done.

FileOutput

98 Month

26 Date

Year

2022

Matt

Tress

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

First

Last

123456.78 Net Worth

Write

Exit

X

Question image 1Question image 2