Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class EmployeeRecord
- {
- static void Main()
- //A marketing firm wants to keep record of its employees.
- //Each record would have the following characteristics – first name, family name, age, gender (m or f), ID number,
- //unique employee number (27560000 to 27569999). Declare the variables needed to keep the information for a single employee
- //using appropriate data types and descriptive names.
- {
- Console.WriteLine("Enter your first name");
- string firstName = string.Concat(Console.ReadLine());
- Console.WriteLine("Enter your last name");
- string lastName = string.Concat(Console.ReadLine());
- Console.WriteLine("Enter your age");
- byte age = byte.Parse(Console.ReadLine());
- Console.WriteLine("Enter your gender");
- char gender = char.Parse(Console.ReadLine());
- Console.WriteLine("Enter your ID number");
- uint idNumber = uint.Parse(Console.ReadLine());
- Console.WriteLine("Enter your employee number");
- uint employeenum =uint.Parse(Console.ReadLine());
- if (employeenum < 27560000)
- {
- Console.WriteLine("Invalid number!");
- }
- else if (employeenum > 27569999)
- {
- Console.WriteLine("Invalid number!");
- }
- else
- {
- Console.WriteLine("================================================================================");
- Console.WriteLine("Information about employee:");
- Console.WriteLine("First name:" + "" + firstName);
- Console.WriteLine("Last name:" + "" + lastName);
- Console.WriteLine("Age:" + "" + age);
- Console.WriteLine("Gender:" + "" + gender);
- Console.WriteLine("ID number:" + "" + idNumber);
- Console.WriteLine("Employee number:" + "" + employeenum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement