Questions:
1. Write an application that inputs one number consisting of FIVE digits from the user, separates the number into its individual digits and prints the digit separated from one another by three spaces each. For example, if the user types in the number 42339, the program should print “4 2 3 3 9”. Assume that the use enters correct number of units.
2.You are required to develop a C# application Named PayCalculator.cs that will determine the gross pay for each of three employees. The company pays straight time for
the first 40 hours worked by each employee and time and a half for all hours worked in excess of 40 hours. You are given a list of the three employees of the company, the
number of hours each employee worked last week and the hourly rate of each employee. Your application should input this information for each employee and should determine and display the employee’s gross pay. Use the Console class’s ReadLine method to input the data.
Answer:
Five
Introduction
This program is meant to take input of a 5-digit number and then print the individual digits on the screen with 3 spaces between each digit.
Test Case
Input: 12345
Output: 1 2 3 4 5
Pay Calculator
Introduction
This program is designed to take input of 3 different employees for their hourly pay rate and the numbers of hours worked. Then the program uses these figures to calculate the gross pay of the employee. The base rate of the employees remain intact till 40 hours and employees working more than that are paid half the base rate for each extra hour.
Test Cases
1.
Hourly Rate: 7.25
Hours: 50
Expected Output: 398.75
Actual output: 398.75
2.
Hourly Rate: asd
Expected Output: Error Message
Actual output: Error Message
3.
Hourly Rate: 12
Hours: asd
Expected Output: Error Message
Actual output: Error Message
4.
Hourly Rate: 8.5
Hours: 40
Expected Output: 340
Actual output: 340
5.
Hourly Rate: 10
Hours: 30
Expected Output: 300
Actual output: 300
Random Number Generator
Introduction
This program generates 50 random numbers in the range 0 to 9. They it asks the user whether to display a frequency table or a histogram and displays accordingly. The test class TestRandomGenerator is used to create these random numbers and then call the main class methods to display the table or histogram accordingly.