1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Molodets [167]
3 years ago
13

Develop a C# console application that will determine the gross pay for each of three employees. The company pays straight time f

or 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. Use a while loop to implement the inputs and calculations.
Computers and Technology
1 answer:
I am Lyosha [343]3 years ago
3 0

Answer:

The c# program for the scenario is shown.

using System;

class main {

 static void Main() {

   

// arrays to hold details of employees are declared

// double datatype is taken to accommodate all types of numerical values  

     int[] empid = new int[3];

     double[] hours = new double[3];

     double[] pay = new double[3];

     double[] pay_overtime = new double[3];

     double hrs = 40.00;

     double[] total_pay = new double[3];

     

   Console.WriteLine("Enter the details for the three employees ");

// variable declared and initialized for the loop    

   int i=0;

   while(i<3)

   {

       Console.WriteLine("Enter the id");

       empid[i] = Convert.ToInt32(Console.ReadLine());  

       

       Console.WriteLine("Enter the working hours");

       hours[i] = Double.Parse(Console.ReadLine());

       

       Console.WriteLine("Enter the hourly pay");

       pay[i] = Double.Parse(Console.ReadLine());

       pay_overtime[i] = pay[i]*1.5;

       

       i++;

       

   }

   

   Console.WriteLine("The details for the three employees ");

   // variable set to 0 to be re-used in the loop

   i=0;

   

   while(i<3)

   {

       if(hours[i] > hrs)

           total_pay[i] = ( hrs*pay[i] );

       else

           total_pay[i] = ( hours[i]*pay[i] );

       

       if(hours[i] > hrs)

           total_pay[i] = total_pay[i] + ( (hours[i]-hrs)*pay_overtime[i] );

       

       i++;

       

   }

// variable set to 0 to be re-used in the loop

   i=0;

   

   while(i<3)

   {

       Console.WriteLine("Gross pay of employee " + (i+1) + " : " + total_pay[i] );

   

       i++;

   }

   

   

 }

}  

OUTPUT

Enter the details for the three employees  

Enter the id

1

Enter the working hours

35

Enter the hourly pay

10

Enter the id

2

Enter the working hours

40

Enter the hourly pay

10

Enter the id

3

Enter the working hours

45

Enter the hourly pay

10

The details for the three employees  

Gross pay of employee 1 : 350

Gross pay of employee 2 : 400

Gross pay of employee 3 : 475  

Explanation:

The program works as described.

1. Arrays to hold each piece of information for the employee, employee number, hourly pay, overtime pay and hours worked, are declared.

2. User input is taken inside while loop to fill each array for each employee.

3. The total gross pay for each employee is calculated inside another while loop.

4. The last while loop is used to display the gross pay for each employee.

You might be interested in
How long does it take to get your alignment fixed?
GarryVolchara [31]
This isn't a computer-related question...

But, lucky for you, I took some automotive in high school. Usually, it depends on equipment used and how many clients they have. Usually, it is done within an hour. 
8 0
3 years ago
Differentiated instruction is designed to educate children through ________ techniques in order to ensure every student is being
EleoNora [17]
They use multiple techniques to help children. 
7 0
3 years ago
The advantage of using a spreadsheet is:
Rama09 [41]

because it's a good thing

5 0
2 years ago
A client reports the client has been experiencing increased stress at work. The client has been managing the stress by drinking
katovenus [111]

Answer:

d. The client has no adaptive coping mechanisms.

Explanation:

The reduction of anxiety felt by the clients is reduced by the Clients in either the functional ways or dysfunctional ways.

The first thing done by the nurse was to find out the techniques used by the client in past and help the client to enhance and identify those most beneficial strategies .The next step is done by the client and the nurse to find out the maladaptive strategies such as alcohol use,social withdrawal and swap them with adaptive strategies which are suitable for the client's cultural,personal and spiritual values.

The nurse should not suggest the client to give up coping mechanism without offering other mechanism even if the client is having the maladaptive strategies.

4 0
3 years ago
What are the 5 characteristics of flowchart<br>​
olchik [2.2K]

Answer:

Here's ur answer

Explanation:

(i) Should consist of standardized and acceptable symbols. (ii) The symbols should be correctly used according to flowcharts rules. (iii) Should have short, clear and readable statements written inside the symbols. (iv) It must have clear one starting point and one ending point.

3 0
3 years ago
Other questions:
  • Which network could NOT carry commercial traffic?
    5·1 answer
  • Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
    14·2 answers
  • Brainly won't let me create an account even though i tried multiple emails and ages! It keeps saying "We're sorry, but we are no
    8·2 answers
  • Please refer to the MIPS solution in the question above. How many total instructions are executed during the running of this cod
    10·2 answers
  • What formula would you enter to add the values in cells b4, b5, and b6?
    10·1 answer
  • Which osi/iso layer is responsible for determining the best route for data to be transferred?
    5·1 answer
  • Which of the following is considered a basic task in the context of computer operations? a. Connecting to the Internet b. Natura
    6·1 answer
  • What is the name given a technological program that typically copies itself and moves through a computer system in order to disr
    10·1 answer
  • What software maintain and increase the efficiency of a computer system?
    12·1 answer
  • Please tell fast plzzzzzzz​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!