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
Write a function called play_round that simulates two people drawing cards and comparing their values. High card wins. In the ca
elena-s [515]

Answer:

Here you go, Change it however you'd like :)

Explanation:

import random as r

def play_round(p1, p2):

   cards = [1,2,3,4,5,6,7,8,9,10,"J","Q","K","A"]

   play1 = r.choice(cards)

   play2 = r.choice(cards)

   

   while play1 == play2:

       play1 = r.choice(cards)

       play2 = r.choice(cards)

   

   if cards.index(play1) > cards.index(play2):

       return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p1}"

   else:

       return f"{p1}'s Card: {play1}\n{p2}'s Card: {play2}\nThe Winner is {p2}"

print(play_round("Bob","Joe"))

8 0
2 years ago
Saas provides services to an organization that requires the standard business process infrastructure such a CRM
Rzqust [24]

Answer: True

Explanation:

 Yes, the given statement is true that the SaaS (Software as a service) provide the different types of services to the organization which basically require the infrastructure like CRM (Customer relationship management) and it is the standard business processing in the organization.

The software as a service is the fundamental technology of the business which basically include the CRM, e-mails and the various types of sale and financial management.

5 0
3 years ago
What is top down design? a. Top down design is a way of designing your program by starting with the biggest problem and breaking
Paladinen [302]

Answer:

The answer is "Option a".

Explanation:

This design is the breakdown for a structure to smaller components to recognize the textural functionalities. This system analysis the built-in the top-down style, that defines and it does not describe some first-level components, which is often known as a staggered layout, and wrong choices can be described as follows:

  • In option b, It is wrong because it is not used in web pages.
  • In option c, It does not start with individual commands, that's why it is incorrect.
  • In option d, It is wrong because it uses loops and classes, but it can't decompose the problem.

6 0
3 years ago
BOTH QUESTIONS ONLY FILL IN C++ CODEWrite a copy constructor for CarCounter that assigns origCarCounter.carCount to the construc
Alborosie

Answer:

im lost tell me a question then ill answer

Explanation:

4 0
3 years ago
Which of the following file formats allows you to share and save documents
mariarad [96]
OPTION A would be the answer
7 0
2 years ago
Other questions:
  • How many homes can be warmed by one bugatti
    11·2 answers
  • Which of the following branches of government is NOT involved in Discretionary Fiscal Policy?
    8·1 answer
  • 6. Write a program that can multiply an n x m matrix and m x n matrix together: The input specifications are these: Read n and m
    11·1 answer
  • When does information become a liability for an organization
    6·1 answer
  • A computer is unable to access the network. when you check the led lights near the computer's network port, you discover the lig
    6·1 answer
  • How do we store value in a variable? Give an example
    15·1 answer
  • Jamal wants to create a program that will play music during the afternoon. Which kind of loop should be used in the program?
    6·2 answers
  • Where did the name "QWERTY" come from?​
    9·1 answer
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
  • Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!