Advertisement
Stann

10.EmployeeRecord

Nov 4th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. using System;
  2.  
  3. class EmployeeRecord
  4. {
  5. static void Main()
  6. //A marketing firm wants to keep record of its employees.
  7. //Each record would have the following characteristics – first name, family name, age, gender (m or f), ID number,
  8. //unique employee number (27560000 to 27569999). Declare the variables needed to keep the information for a single employee
  9. //using appropriate data types and descriptive names.
  10.  
  11. {
  12. Console.WriteLine("Enter your first name");
  13. string firstName = string.Concat(Console.ReadLine());
  14. Console.WriteLine("Enter your last name");
  15. string lastName = string.Concat(Console.ReadLine());
  16. Console.WriteLine("Enter your age");
  17. byte age = byte.Parse(Console.ReadLine());
  18. Console.WriteLine("Enter your gender");
  19. char gender = char.Parse(Console.ReadLine());
  20. Console.WriteLine("Enter your ID number");
  21. uint idNumber = uint.Parse(Console.ReadLine());
  22. Console.WriteLine("Enter your employee number");
  23. uint employeenum =uint.Parse(Console.ReadLine());
  24. if (employeenum < 27560000)
  25. {
  26. Console.WriteLine("Invalid number!");
  27.  
  28. }
  29. else if (employeenum > 27569999)
  30. {
  31. Console.WriteLine("Invalid number!");
  32. }
  33.  
  34. else
  35. {
  36. Console.WriteLine("================================================================================");
  37. Console.WriteLine("Information about employee:");
  38. Console.WriteLine("First name:" + "" + firstName);
  39. Console.WriteLine("Last name:" + "" + lastName);
  40. Console.WriteLine("Age:" + "" + age);
  41. Console.WriteLine("Gender:" + "" + gender);
  42. Console.WriteLine("ID number:" + "" + idNumber);
  43. Console.WriteLine("Employee number:" + "" + employeenum);
  44. }
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement