public static string getStringInputValue string inputType string value String

Public static string getstringinputvalue string

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

}publicstaticstringgetStringInputValue(stringinputType){stringvalue = String.Empty;boolvalid = false;stringinputString = String.Empty;do{inputString = GetInput(inputType);if(!String.IsNullOrEmpty(inputString)){value = inputString;valid = true;}else{value = "Invalid input";valid = false;}if(!valid)Console.WriteLine("Invalid "+ inputType + " try again!"); } while(!valid);returnvalue;}publicstaticintgetIntegerInputValue(stringinputType){boolvalid = false;intvalue = 0;stringinputString = String.Empty;do{inputString = GetInput(inputType);if(!(String.IsNullOrEmpty(inputString))){valid = Int32.TryParse(inputString, outvalue);}if(!valid)Console.WriteLine("Invalid "+ inputType + " try again!"); } while(!valid);returnvalue;}publicstaticdoublegetDoubleInputValue(stringinputType){boolvalid = false;doublevalue = 0;stringinputString = String.Empty;do{inputString = GetInput(inputType);if(!(String.IsNullOrEmpty(inputString))){valid = Double.TryParse(inputString, outvalue);}if(!valid)Console.WriteLine("Invalid "+ inputType + " try again!"); } while(!valid);
Background image
returnvalue;}publicstaticchargetCharInputValue(stringinputType){boolvalid = false;charvalue = 'u';stringinputString = String.Empty;do{inputString = GetInput(inputType);if(!(String.IsNullOrEmpty(inputString))){valid = Char.TryParse(inputString, outvalue);}if(!valid)Console.WriteLine("Invalid "+ inputType + " try again!"); } while(!valid);returnvalue;}}}ApplicationUtilities.csusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceWeek2_iLab_Amith_Shetty{publicclassApplicationUtilities{publicstaticvoidDisplayApplicationInformation(){
Background image
Image of page 6

You've reached the end of your free preview.

Want to read all 6 pages?

  • Fall '14
  • Subroutine, Return statement, Void type, Amith Shetty

  • 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