subject

Purpose: This application provides experience with user input and interaction in the Console, writing files to disk, working with exceptions, and writing programs in C#/.NET. Requirements:
Target Platform: Console
Programming Language: C#
This program is to display the name of the app "Document" followed by a blank line, prompt the user for the name and content for a document, save the document to the current directory, and display a message if it was successful or unsuccessful based on a specification provided. The filename of the document is the name provided by the user with ".txt" appended to it.
When the program runs:
Display "Document" followed by a blank line.
Prompt the user for the name of the document.
Prompt the user for the content that is to be in the document.
Append .txt to the name and use it as the file name.
Save the content to a file in the current directory.
If an exception occurs, output the exception message and exit.
If an exception does not occur, output "[filename] was successfully saved. The document contains [count] characters." and exit. [filename] and [count] are placeholders for the filename of the document and the number of characters it contains.
Note that the requirements say the file is to be saved in the current directory. This means you can use just the file name as the path for the file. If you do that, the file will be saved in the current directory for the application. When I created the project and called it Document, a directory called Document was created that contains Document. sln and another directory called Document. The Document directory inside of the project is the current directory when the application runs and is where you will find the files that are saved.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Write a program that prints the day number of the year, given the date in the form month-day-year. for example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. the program should check for a leap year. a year is a leap year if it is divisible by 4, but not divisible by 100. for example, 1992 and 2008 are divisible by 4, but not by 100. a year that is divisible by 100 is a leap year if it is also divisible by 400. for example, 1600 and 2000 are divisible by 400. however, 1800 is not a leap year because 1800 is not divisible by 400.
Answers: 3
You know the right answer?
Purpose: This application provides experience with user input and interaction in the Console, writin...
Questions
question
English, 15.01.2022 21:10
question
Mathematics, 15.01.2022 21:10
question
History, 15.01.2022 21:20
question
Mathematics, 15.01.2022 21:20
question
Mathematics, 15.01.2022 21:20
Questions on the website: 13722367