Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours in a week. For example, if a person’s hourly wage is $12 and he or she works 60 hours in a week, the person’s gross pay should be (40 *12) + (1.5 *12 * (60-40)) = $840. Write a program that requests the floating number of hours a person works in a given week and the person’s hourly wage as input, and then displays the person’s gross pay
Q: Example: (H.W) Given a quadratic equation as follows: ax2 + bx + c = 0 if b*b-4*a*c_is greater than…
A: ! ---------------------------------------------------! Solve Ax^2 + Bx + C = 0 given B*B-4*A*C…
Q: 2) A BMI Calculator: the body mass index (BMI) is a measure used to determine whether a person is…
A: Java Code import java.util.Scanner; public class Test { public static void main(String[] args) {…
Q: Part H: Worker Pay Write a program that asks the user to enter their name, pay rate (in $/hr) and…
A: steps for calculating total amount is if hour > 40: total = 40 * rate + (hour-40) * 1.5 * rate…
Q: 6. A microwave oven manufacturer recommends that when heating two items, add 50% to the heating…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22, ....…
A: GIVEN: A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22,…
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
Q: Programming Practice a) Write a program which allows a teacher to determine the min, max, and…
A: Disclaimer: “Since you have asked multiple questions, we will solve the first question for you. If…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Given: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
Q: Suppose you deposit a certain amount of money into a savings account that earns compound monthly…
A: The below-given javascript program will obey the following rubrics: Declaring a function,…
Q: ories ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) – 75.4991) x Time / 8.368 te a…
A: CODE : #include<bits/stdc++.h> using namespace std; int main(){ double age; // variable…
Q: 4. Write a program that simulates the rolling of two dice. The program should use rand twice to roll…
A: Code: #include <stdio.h>#include <stdlib.h>#include <time.h> int main(){ int…
Q: · Exercise # 1: Wite a program that determines the day number (1 to 366) in a year for a date that…
A: Here, we have to write programs for the above programs.
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: [Note: please use proper indentation to avoid erros. snapshots of program code are provided in step…
Q: In Python Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon…
A: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):…
Q: Write a program that simulates flipping a coin to make decisions. The input is how many decisions…
A: For the given question, we have to design a Python program that does/includes the following :…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: PROGRAM: #Defining the function deriving_cost def driving_cost(driven_miles, miles_per_gallon,…
Q: Activity #2: Write a program that computes parking fees for a garage with the fee structure given in…
A: Objective: This program reads the number of hours parked for vehicles and computes the total charge.…
Q: 8. The dynamics of a comet is governed by the gravitational force between the comet and the Sun, f=…
A:
Q: A number in base 2 (binary) is a number such that each of its digits is 0 or 1. To convert from…
A: import java.util.Scanner;public class Main{ public static void main(String args[])…
Q: 1. A software company sells a package that retails for $99. Quantity discounts are given according…
A: logic:- take quantity as user input. apply if else to find out discount. at last subtract…
Q: customer's credit limit is now RM250. UTM M4000. If a customer had a credit limit of RM500, this Due…
A: #include<iostream>using namespace std;int main(){ float c_score, limit, balance; int ac;…
Q: Problem 7: Guess the price of the car!? You will implement a variant of the number guessing game we…
A: Python used to answer this question
Q: 2. Write a program that determines a student's grade. The program will read three scores and…
A: Below is the required C++ program: - Approach: - Import the header file and include the namespace.…
Q: Problem #2: [35 pts] Write a java program that helps the Lebanese scout to create an online generate…
A: Code: import java.util.*;public class Main{ public static void main(String[] args) {…
Q: 5. Write a program that determines the change to be dispensed from a vending machine. An item in the…
A: The program accepts the input value to a variable. It declared other variables for storing the…
Q: 9. Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: First prompt for the starting odometer reading and then get information about a series of legs.…
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: Here, first you need to declare some variables for all salaries. Then prompt user to enter basic…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon): gallons_used =…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: The given program in python is as below: OUTPUT OF THE PROGRAM:
Q: Q5/ 1. 1. Write a program to read three marks and calculate the average. If the student's average is…
A: Since no programming language is mentioned, I am using python. As per our guidelines, we are…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Lets see the solution.
Q: 2.12 LAB: Driving costs Driving is expensive. Write a program with a car's gas mileage…
A: Code: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon): return (driven_miles…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: 1. As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it…
A: Actually, program is a executable software that runs on a computer.
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Answer :
Q: Write the reading program: basic salary (bsalary) and sales (sales), then calculate and print the…
A: C++ program is given below
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Here I have created the function named driving_cost(). In this function, I have divided the miles by…
Q: Write a program that simulates rolling two twenty-sided dice 100000 times, counting now many times…
A: Below a program that simulates rolling two twenty-sided dice 100000 times, counting now many times…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: As per the given question, driving_cost() function needs to be designed. Input parameters :…
Q: Q3, A lecturer intends to separate his students into 2 groups based on their INDEX Numbers, those…
A: Multiple question asked answering Q3, repost the remaining. Code: //header file #include…
Q: 1. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40…
A: #ask user for hourly wage hourly_wage = float(input('\nEnter hourly wage: ')) #ask user for Number…
Q: Question # 8: Write a program that inputs a number and checks whether it is a perfect number or not.…
A: Answer 8: Objective: The program reads the user input and verifies if the number falls under the…
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: Write a program with total change amount as an integer input, and output the change using the fewest…
A: CODE:- amount = int(input("Enter Amount: "))if amount<=0: print("No Change") else:…
Q: 1- Write a program in which the user is asked to enter his age based on the year (assuming the…
A: Take input from user. check if the number is positive integer or no. and if the number is positive…
Q: 3. Write a program that computes and interprets the Body Mass Index (BMI). The program prompts the…
A: Prompt to enter the weight in pounds. Store the value in a variable. Prompt to enter the height in…
Q: 7) Write a program that asks the user the number of hours an employee worked and his hourly wage,…
A: code:-- #include <iostream>using namespace std; int main(){ // to store the total_hour and…
Q: 2. Write a program that computes the cost of painting and installing carpet in a room. Assume that…
A: Actually, program is a executable software that runs on a computer.
Q: 20.5 LAB: Flip a coin Write a program that simulates flipping a coin to make decisions. The input…
A: PROGRAM CODE: # import the required modulesimport random# start the definition of the function to…
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
1. Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours in a week.
For example, if a person’s hourly wage is $12 and he or she works 60 hours in a week, the person’s gross pay should
be (40 *12) + (1.5 *12 * (60-40)) = $840.
Write a program that requests the floating number of hours a person works in a given week and the person’s hourly
wage as input, and then displays the person’s gross pay. Save it as overtimePay.py
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)2. Party shop sells birthday gift bags in two ways. set of 12 bags for $17.99 or an individual bag for $1.75. Customers can purchase a Write a complete program that asks the user input for the number of gift bags need to be purchased (an integer) and outputs the total price of the purchase. a) For example, if the customer buys 14 gift bags, the customer would be charged for 1 set of (12 bags) plus another 2 individual bags. The subtotal would be 1 (17.99) + 2 (1.75) = $21.49. b) Use a constant variable to set a fixed tax rate of 8.875. c) Display correct dollar values (2 decimal places, use cout precision). User input can be any content and it's bold and italicized for clarity. Example Output 1 Welcome to Party Shop! How many gift bags would you like to purchase: 14 SHOPPING CART 1-set (s) $17.99 2-individual $3.50 Subtotal: $21.49 Таx: $1.91 Total: $23.40 Thank you shopping Party Shop! Example Output 2 Welcome to Party Shop! How many gift bags would you like to purchase: 11 SHOPPING…A company of 20 employees wants to find the employee who made the highest commission so he/she can be paid a 10% bonus of the commission he/she earned for that month. The commission an employee makes is calculated by multiplying the sales amount by the commission rate. The commission rates are shown below: Sales Amount Commission Less Than 40000 No commission 40000 to 80000 inclusive 5% Greater than 80000 10% Write a program to: Prompt the user for each employee’s id (an integer value) and the sales amount For each employee, display the commission earned Display the total commission earned by all the employees Display the average commission earned by an employee Display the employee id, the commission and the bonus paid to the employee with the highest commission Must be written in c++, no arrays to be used, only use iostream library
- Problem: A company wants a program that will calculate the weekly paycheck for an employee based on how many hours they worked. For this company, an employee earns $20 an hour for the first 40 hours that they work. The employee earns overtime, $30 an hour, for each hour they work above 40 hours. Example: If an employee works 60 hours in a week, they would earn $20/hr for the first 40 hours. Then they would earn $30/hr for the 20 hours they worked overtime. Therefore, they earned: ($20/hr 40hrs) + ($30/hr 20 hrs) = $800 + $600 = $1400 total. For this assignment, you must create pseudocode and a flowchart to design a program that will calculate an employee's weekly paycheck. . Write pseudocode to design a programming solution by outlining a series of steps and using appropriate indentation and keywords. As you write your pseudocode, be sure to consider the following: What input does the computer need? What steps does the program need to follow to process the input? What output should…In C++ language, create a program that gets quarterly sales from a user, and calculates the total of all four quarters as well as the average, lowest, and highest quarters. Console Example that should be used/followed when executed The Quarterly Sales program Enter sales for Q1: 12312.57 Enter sales for Q2: 15293.21 Enter sales for Q3: 14920.95 Enter sales for Q4: 23432.21 Total: 65958.94 Average Quarter: 16489.74 Lowest Quarter: 12312.57 Highest Quarter: 23432.21 Specifications: Create the pseudocode needed to implement the solution above. Convert your pseudocode to C++ code including the following specifications: Round the average quarter to a maximum of 2 decimal digits. Use a vector to store the sales for each quarter. Use STL algorithms to process the data for the quarters. Please make sure the average is ROUNDED 2 places to get the output 16489.74 instead of 16489.73In C++ language, create a program that gets quarterly sales from a user, and calculates the total of all four quarters as well as the average, lowest, and highest quarters. Console Example The Quarterly Sales program Enter sales for Q1: 12312.57 Enter sales for Q2: 15293.21 Enter sales for Q3: 14920.95 Enter sales for Q4: 23432.21 Total: 65958.94 Average Quarter: 16489.74 Lowest Quarter: 12312.57 Highest Quarter: 23432.21 Specifications: Create the pseudocode needed to implement the solution above. Convert your pseudocode to C++ code including the following specifications: Round the average quarter to a maximum of 2 decimal digits. Use a vector to store the sales for each quarter. Use STL algorithms to process the data for the quarters.
- Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient the following data should be entered: • The number of days spent in the hospital• The daily rate• Charges for hospital services (lab tests, etc.)• Hospital medication charges.If the patient was an out-patient the following data should be entered:• Charges for hospital services (lab tests, etc.)• Hospital medication charges.Use a single, separate function to validate that no input is less than zero. If it is, it should be re-entered before being returned.Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out- patient data. Both functions should return the total charges.Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: • The number of days spent in the hospital • The daily rate Hospital medication charges • Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an outpatient: • Charges for hospital services (lab tests, etc.) • Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient information. Both functions should return the total charges and display it for the user. After the total charges have been calculated and displayed, write the result to a file, PatientReport.txt. You can use the techniques you learned in Chapter…An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insurance
- An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insurance Note: Use switch cases when you check the total number of accidents.The Café Noir Coffee Shop wants some market research on its customers. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more than 5 digits) or an invalid age (defined as less than 10 or more than 110), the program reprompts the clerk continuously. When the clerk enters fewer than 1 or more than 12 items, the program reprompts the clerk two more times. If the clerk enters a high value on the third attempt, the program accepts the high value, but if the clerk enters a negative value onthe third attempt, an error message is displayed and the order is not counted. At the end of the program, display a count of the number of items ordered by customers from the same zip code as the coffee shop (54984), and a count from other zip codes. Also…Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value of the account after the specified time period. • p is the present value of the account (the account's current balance). • i is the monthly interest rate. • t is the number of months. Write a program that takes the account's present value (current balance), monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should print the account's future value. Look carefully at the following sample run of the program. In particular, notice the wording of the messages and the placement of…