lastName n output formatted first name and last name of employee output Gender

Lastname n output formatted first name and last name

This preview shows page 2 - 5 out of 5 pages.

+ lastName + "\n" ; //output formatted first name and last name of employee output += " Gender: " + gender + "\n" ; //output formatted gender of employee output += " Dependents: " + dependents + "\n" ; //output formatted dependents of employee output += " Annual Salary: " + annualSalary.ToString( "C2" ) + "\n" ; //output annual salary of employee output += " Weekly Pay: " + calculatePay().ToString( "C2" ) + "\n" ; //output formatted weekly salry of employee return output; } } } using System; using System.Collections.Generic; using System.Linq; using System.Text;
Image of page 2
namespace CIS247A_Employee { public class InputUtilities { public static string GetInput( string inputType) { string strInput = String .Empty; Console .Write( "Enter the " + inputType + ": " ); strInput = Console .ReadLine(); return strInput; } public static string getStringInputValue( string inputType) { string value = String .Empty; bool valid = false ; string inputString = 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); return value; } public static int getIntegerInputValue( string inputType) { bool valid = false ; int value = 0; string inputString = String .Empty; do { inputString = GetInput(inputType); if (!( String .IsNullOrEmpty(inputString))) { valid = Int32 .TryParse(inputString, out value); } if (!valid) Console .WriteLine( "Invalid " + inputType + " try again!" ); } while (!valid); return value; } public static double getDoubleInputValue( 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)
Image of page 3
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 { inputString = GetInput(inputType); if (!( String .IsNullOrEmpty(inputString)))
Image of page 4
Image of page 5

Want to read all 5 pages?

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '14
  • Void type, Personal name, Family name, Given name, public Employee

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture