Question: Please be specific on how the program is written down and please see if you can do all the steps. Thank you In this lab,

Please be specific on how the program is written down and please see if you can do all the steps. Thank you
In this lab, you will be experimenting with reading in data from the keyboard, and storing it in variables
of various types. This will require you to demonstrate and understanding of not only user input through
Console.ReadLine(), but also of type casting through the Convert class methods. Additionally, this lab
will require you to use both StreamWriter and StreamReader to save data to a file, and then read it back
in.
EXAMPLE PROGRAM
There is no example program this week. Any sample I provided would have been very easy to modify
into your lab, as much of the syntax would have been identical. On the first labs I was okay with that, but
I want to give you a chance to demonstrate that you can work from scratch on this. Sample code will
resume next week with Lab 4.
YOUR PROGRAM
Your program this week will ask a user to enter some information to register for some as-of-yet
unknown service. You will 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). You will 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 save all the data to a file, one piece of data per line. Once the writing is complete,
you will 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. The sample output below should help
guide you through the general form, as will the steps below:
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. I called mine userdata.txt, but the name is up to you.
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
Name the .cs file according to the standard convention ([First Initial][Last Name]_Lab3.cs), and submit
the completed .cs file through the Blackboard assignment submission tool. Dont forget to include the
comment block at the top.
CITP 3310 Survey of Programming Languages Lab 3
CHALLENGE
This is the first lab that has a bit of weight to the code... my sample wasnt necessarily optimized, but
came in at about 60 lines, with whitespace. Because of that, we have an easy challenge this week. Take
the time to comment your code, explaining what the variables will store, what each section of code
does, etc. There really isnt a right or wrong way, so just try to explain whats going on to the best of
your ability.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!