- Create a new Visual C# Console App using .NET Framework project and name it "MyFirstConsoleApplication."
- Create a new class file called "Person.cs" and create the Person class with two public string member fields (aka instance variables). The two member fields should be called "name" and "location".
- In the Program.cs class file, create a new private method called "GetUserNameAndLocation". Inside of this method do the following:
- Create a new instance of the Person class and give the instance a variable name of "person".
- Prompt the user with a question "What is your name? " and assign their response to the name variable.
- Using String Interpolation, reply and prompt the user with "Hi ___! Where are you from? "
- Assign their response to the location attribute of person.
- Using String Interpolation, reply and prompt the user with "I have never been to ___. I bet it is nice. Press any key to continue..."
- Prompt the user to "Press any key to continue." And wait to proceed until a key is pressed.
- Add this method into the Main method at the top.
- In the Program.cs class file, create a new private method called "ChristmasCountdown"
- The method must allow you to pass in a DateTime value when called.
- All DateTime formatting and calculations should be within this method.
- Using String Interpolation, output the current date, but not the current time with the following message. "Today's date is: ___"
- Create your own variable name to store the calculated value of the number of days until Christmas this year as a whole number.
- Using String Interpolation, output your variable like so ""There are _ days until Christmas!"
- Prompt the user to "Press any key to continue." And wait to proceed until a key is pressed.
- Add this method into the Main method under the GetUserNameAndLocation method call. Don't forget to pass in the current date.
- Create a new class file called "GlazerApp.cs" and set the class to static.
- Create a new method called "RunExample". Remember that this method must be set to public so that it can be accessed outside of the GlazerApp class. Make sure to also add the static void keywords.
- Inside of the RunExample method, add the program example from section 2.1 in the C# Programming Yellow Book by Rob Miles.
- Improve the code so that the user is prompted for a width, and assign the width input value to a variable.
- Improve the code so that the user is prompted for a height, and assign the height input value to a variable.
- Output the results in two different lines indicating what the calculated wood length in feet and glass area in square meters.
- Call the RunExample method from the Program Class under Main and place it beneath the ChristmasCountdown call.
- In the Program class under the Main method, at the end of the method, ensure the application does not automatically terminate and prompt the user to press any key before exiting. Hint: Consider Console.ReadKey()
- Do a Software Quality Assurance (SQA) check on your application. Make sure the user interaction with your application is clean and that there are no errors. You do not have to do any type of input validation for this assignment. For example, you do not need to validate that a person's name does not start with a number.
-
Notifications
You must be signed in to change notification settings - Fork 0
oscarliz/Your-First-Visual-Studio-csharp-Application
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published