Question

In: Computer Science

Create a C # program that calculates what a worker must be paid if each day...

Create a C # program that calculates what a worker must be paid if each day I work different hours during the week. The price per hour is 80.0.

Solutions

Expert Solution

Thanks for the question. Below is the code you will be needing. Let me know if you have any doubts or if you need anything to change.

Let me know for any help with any other questions.

Thank You!
===========================================================================

using System;

class MainClass {

public static void Main (string[] args) {

const double RATE = 80.0;

double hoursWorked;

double totalHours = 0;

double payment = 0;

Console.Write("Enter hours worked on Monday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Tuesday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Wednesday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Thursday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Friday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Saturday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

Console.Write("Enter hours worked on Sunday: ");

hoursWorked = Convert.ToDouble(Console.ReadLine());

totalHours += hoursWorked;

payment = totalHours*RATE;

Console.WriteLine("Total hours worked in week: "+totalHours.ToString("0.##"));

Console.WriteLine("Payment: $"+payment.ToString("0.00"));

}

}

======================================================================


Related Solutions

In C++, Write a program that calculates pay for either an hourly paid worker or a...
In C++, Write a program that calculates pay for either an hourly paid worker or a salaried worker. Hourly paid workers are paid their hourly pay rate times the number of hours worked. Salaried workers are paid their regular salary plus any bonus they may have earned. The program should declare two structures for the following data: Hourly Paid: HoursWorked HourlyRate Salaried: Salary Bonus The program should also declare a union with two members. Each member should be a structure...
In C Program #include Create a C program that calculates the gross and net pay given...
In C Program #include Create a C program that calculates the gross and net pay given a user-specified number of hours worked, at minimum wage. The program should compile without any errors or warnings (e.g., syntax errors) The program should not contain logical errors such as subtracting values when you meant to add (e.g., logical errors) The program should not crash when running (e.g., runtime errors) When you run the program, the output should look like this: Hours per Week:...
Write a C++ program that calculates pay for either hourly paid workers or salaried workers.
Write a C++ program that calculates pay for either hourly paid workers or salaried workers. Hourly paid workers are paid their hourly pay rate times the number of hours worked. Salaried workers are payed their regular salary plus any bonus they may have earned. The program should declare two structures for the following data:• Hourly Paid◦ HoursWorked◦ HourlyRate• Salaried◦ Salary◦ BonusThe program should also declare a structure with two members. Each member should be a structure variable: one for the...
Create a C++ program that calculates an unbiased standard deviation of 5 input numbers. Please Submit:...
Create a C++ program that calculates an unbiased standard deviation of 5 input numbers. Please Submit: 1. A flowchart of your program. (3 points) 2. Your C++ program with a heading comment, also appropriate spacing and indentation in the program body. 3. Copy of a screenshot after your program is executed. (Section 2 and3: 7 points) /* ELEN 1301 Programming Assignment #8. Name : Your name. Student ID : Your student ID #. Due date : Purpose of the program...
MUST BE DONE IN C (NOT C++) Your create a program that can implement the cases...
MUST BE DONE IN C (NOT C++) Your create a program that can implement the cases in which the initial unit is Fahrenheit or something not recognizable. Your program should incorporate Fahrenheit to Celsius, Fahrenheit to Kelvin and unknown initial units (display an error message for this last one). You must use functions to calculate Fahrenheit degrees.
1) Here is a program in c++ that calculates a speeding ticket, modify the program to...
1) Here is a program in c++ that calculates a speeding ticket, modify the program to double to cost of the ticket in a construction zone. // This project will calculate a speeding ticket between 0 to 150 mph. // 1. Ask for speed. // 2. Input speed of vehicle // 3. Calculate ticket cost (50$ if over 50mph with an additional 5$ for every mph over). // 4. Display cost of ticket. #include<iostream> using namespace std; int main() {...
C++ program: Create a Date class that contains three members: the month, the day of the...
C++ program: Create a Date class that contains three members: the month, the day of the month, and the year, all of type int. The user should enter a date in the format 12/31/2001, store it in an object of type Date, then retrieve the object and print it out in the same format. Next create an employee class. The member data should comprise an employee number (type int) and the employee’s compensation (in dollars; type float). Extend the employee...
Create a program in java that calculates area and perimeter of a square - use a...
Create a program in java that calculates area and perimeter of a square - use a class and test program to calculate the area and perimeter; assume length of square is 7 ft.
Your task is to write a program in C or C++ that calculates the total amount...
Your task is to write a program in C or C++ that calculates the total amount of money a person has made over the last year. Your program will prompt the user for dollar amounts showing how much the user has made per job. Some users will have had more than one job, make sure your program allows for this. The program will print out the total made (all jobs) and will print out the federal and state taxes based...
Phyton Login program To start the program each day the manager must login. The main (manager)...
Phyton Login program To start the program each day the manager must login. The main (manager) window will appear with a login, create password, and cancel button. A password must exist for the login button to be enabled. The password is created in a separate window and must be 9 characters or more, and it must have at least on digit, uppercase and lowercase letter. The program will continue to show error messages and prompt for a password until a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT