string inputType bool valid false double value 0 string inputString String

String inputtype bool valid false double value 0

This preview shows page 6 - 7 out of 7 pages.

string inputType) { bool valid = false ; double value = 0; string inputString = String .Empty; do { inputString = GetInput(inputType); if (!( String .IsNullOrEmpty(inputString))) { valid = Double .TryParse(inputString, out value); } if (!valid) Console .WriteLine( "Invalid " + inputType + " try again!" ); } while (!valid); return value; } public static char getCharInputValue( string inputType) { bool valid = false ; char value = 'u' ; string inputString = String .Empty; do {
Image of page 6
inputString = GetInput(inputType); if (!( String .IsNullOrEmpty(inputString))) { valid = Char .TryParse(inputString, out value); } if (!valid) Console .WriteLine( "Invalid " + inputType + " try again!" ); } while (!valid); return value; } } }
Image of page 7

You've reached the end of your free preview.

Want to read all 7 pages?

  • Summer '19
  • Return statement, Void type, Given name, Cristina Martinez

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes