Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C# Language Part A-3: ReadString Create a method called ReadString that will ask the user for a string. Instead of returning the value like in
C# Language
Part A-3: ReadString Create a method called ReadString that will ask the user for a string. Instead of returning the value like in ReadInteger, you should use pass by reference to get the string back to the caller. The method should show a prompt, read the user's input, store the input in the ref parameter. If the user does NOT enter a string, show an error message to them, show the prompt again and ask for the user's input. You'll need a loop for this. Do not return until the user enters something. You should use the IsNullOrEmpty or the IsNullOrWhiteSpace methods of the string class to check if the string is empty. NAME RETURNS PARAMETERS COMMENTS ReadString void Show the prompt, read input, store in ref parameter string prompt ref string valueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started