Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C# please, please add comments. This program must prompt the user to enter their full name, gender (as M or F), age (as an

In C# please, please add comments.

This program must prompt the user to enter their full name, gender (as M or F), age (as an integer), and salary (as a double, with no dollar signs or commas). It needs to store the information into variables of the appropriate types, converting as necessary. Once all the data is gathered, you will open a file for writing and saving all the data to a file, one piece of data per line. Once the writing is complete, close the file for writing, open it for reading, and read in all the information again, storing it in a second set of variables to test that the data was properly written.

Here is a sample for the output:

1.)Display the first welcome/thanks messages. 2.)Prompt for each piece of information, pausing for user input after each and storing the value in the appropriate variables (a string for name, char for gender, int for age, and double for salary). 3.)Tell the user that you are going to save their data. 4.)Open a file for writing. 5.)Write the data (all four pieces) to the file. Use WriteLine, not Write, as reading will be more difficult with the latter. 6.)Close the file. 7.)Tell the user that saving is complete and that you are going to do a test read. 8.)Open the file for reading. 9.)Read in the file, storing it in new variables of the appropriate types. 10.)Close the file. 11.)Output the values of the new variables to confirm that the information was correct. 12.)End the program.

Thank You!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago