Programming Exercises 1. Payroll Program with Input Validation Design a payroll program that prompts the user to enter an employee's hourly pay rate and the number of hours worked. Validate the user's input so that only pay rates in the range of $7.50 through $18.25 and hours in the range of 0 through 40 are accepted. The program should display the employee's gross pay.
Q: Personal BestWrite a program that asks for the name of a pole vaulter and the dates and vaultheights…
A: Given:- Personal BestWrite a program that asks for the name of a pole vaulter and the dates and…
Q: 1 The salary scales of workers in an institution are taken as input. The workers get paid as per the…
A: Solution 1 - Programming language used - C All necessary comments are included in program code.…
Q: ES085 Computer Programming 1 Course Number Course Title Topics Covered: Switch and if-else if…
A: /*C Program with if else if statement to calculate the commision of…
Q: Speeding Violation Calc Design a program that calculates and displays the number of miles per hour…
A: Actually, algorithm is an step by step process.
Q: * Tip, Tax, and Total Design a program that calculates the total amount of a meal purchased at a…
A: In this question we have to fix the logical error and modify the code according to the question…
Q: TASK: Draw the Flow Chart. Construct C++ program. QUESTION 1 Dr. Siti would like to calculate her…
A: GIVEN: Based on the values of the total body fat and weight, calculate the BF% The value of BF% is…
Q: Body Mass BMI) IS offen Used to defermin mether person lifestyle is overweight or underweight for…
A: #include <stdio.h>#include <math.h>int main(){float wt,ht,bmi;int ch;printf("bmi…
Q: conditional structures Create a program that will ask for the username and password. USER NAME:…
A: #include <iostream>using namespace std; int main(){ string CorrectUserName = "XXXXX";…
Q: Plan and code a C++ program utilizing selection structure. Write an interactive C++ program to…
A: In this we have take, Input 3 inputs from user as MONTH DAY and YEAR. Output return week day related…
Q: urbo c++ code for The utilities commission has decided that the electric company overcharged its…
A: Include necessary header file. In main function declare a integer variable kilowatt and float…
Q: C++ Demonstration #1: Create a program segment that will ask for a grade from the user and display…
A: - We need to create a grade program in C++ with certain constraints.
Q: C++ Demonstration #2: Write a program segment that will asks for a grade from the user. Display ‘A’…
A: * Program Explanation :- First create variable for marks and give name ms. Take the value form the…
Q: Payroll Program with input validation: Design a payroll program that prompts the user an employee's…
A: To write: To write a C++ program that calculates the gross pay using the given interval of range and…
Q: C++ Mobile Service ProviderModify the program in Problem 5 so that it also displays how much…
A: Code:
Q: Example-6 A number of rivers (N), each river has three (pH) values. Write a program to read the (pH)…
A: Include all the required headers in the answer program. Declare the main function. Declare the…
Q: My Solutions > Tax Calculator (conditional flow control) The simplest income tax calculation for a…
A: We need to write a function using Matlab to compute income tax.
Q: Complete the given program so that will ask the user to enter 5 fruit items given the name, price,…
A: // simple list program using inheritance // Fruit is a base class with 3 derived classes: Apple,…
Q: Grades of 30 students entered on the keyboard will be entered. Write down the algorithm and flow…
A: Grades of 30 students entered on the keyboard will be entered. Write down the algorithm and flow…
Q: conditional structures Create a program that will determine if a number is divisible by 3 or 4
A: #include <iostream>using namespace std; int main(){ int num; cout<<"Enter a…
Q: conditional structures Create a program that will ask three (3) numbers from the user then display…
A: C++ program to print largest among the tree number
Q: C++ Programming point* go_far(point* other) Return the point bearing the x- and the y- coordinates…
A: Algorithm: Start Implement a struct point with 2 struct variables x,y Inside the struct implement…
Q: 1) Pseudo code algorithm 2) JAVA program ( IntelliJ ) The Meteorological service requires a…
A: Initialize variables, rainfallLevel <-- 0, currMax <-- 0, currMin <-- 9999, currAvg <--…
Q: Payroll Program with Input Validation Design a payroll program that prompts the user to enter an…
A: hourly_pay_rate = float(input("Enter employee's hourly pay rate (in $): ")) # taking user input…
Q: One acre of land is equivalent to 43,560 square feet. Design a program that asks the user to enter…
A: x = float(input("Enter the total square feet of the tract of land: "))y = (1/43560)*x print("The…
Q: Plan and code a C++ program utilizing selection structure. Write an interactive C++ program to…
A: Program plan: Prompt for the date Validate the date with day, month and yeat values Check for the…
Q: Requirements: Use f-strings and write pseudocode/step explanation program2_3.py Road Trip! You and…
A: The Pseudocode code is: Start Set price_per_gallon as 2.79 Read distance_in_miles, mpg_of_vehicle,…
Q: Complete the given program so that will ask the user to enter 5 fruit items given the name, price,…
A: Swift code to solve the given problem
Q: The age of student1, student2 and student3 is entered through the keyboard. Write a program to…
A: Given: The age of student1, student2 and student3 is entered through the keyboard. Write a program…
Q: Additional Problem: Write a program that displays the first and last words of a sentence input by…
A: I write the program in java, here the program takes a sentence and prints the first and the last…
Q: The Game of Nim Problem Description: Two players alternately take marbles from a pile. In each move,…
A: Program Requirements as per question: The program must define and use the following methods, int…
Q: Automobile Costs Problem: Design a modular program that asks the user to enter the monthly costs…
A: Here we will use the function to count each expanses.one use for counting monthly and another for…
Q: İnstruction: A certain store has the following scheme: Commodity Code: A - commodities are…
A: From the given scenario, Find the total amount paid with some given condition. Decision structure:…
Q: 4. Calculate employee's pay A program is required by a company to read an employee's number, pay…
A: We need to write a code to perform given functions.
Q: 32. Account Balance Design a hierarchy chart or flowchart for a program that calculates the current…
A: According to the information given:- we have to design hierarchy chart or flowchart for a program
Q: Design function called month_name() which takes the month number as a parameter and returns a string…
A: Store all the months names in list and then we return the value present at index number-1
Q: Assignment Plan and code a C program utilizing selection structure. Write an interactive C program…
A: #include <iostream>#include <string>#include <vector>#include <cmath>using…
Q: A. First and Last Design a program that asks the user for a series of names (in no particular…
A: Answer: Here is the python Code : END = "END"#creating a list to store the namesls = []#prompt…
Q: Lab 1-1: Stop and Analyze A local business employs five salespeople and pays a 3% bonus on a…
A: Logic:- initiate a loop from i=0 to 4 Input name Input amount Calculate…
Q: Sales Prediction The East Coast sales division of a company generates 58 percent of total sales.…
A: Hey there, I am authorised to answer any one question at a time when there are multiple questions…
Q: Programming Problem: Grading system conversion from percentage to numerical. The program will ask…
A:
Q: driven mileage and number of months since last service. The program should display the message 'Car…
A: Since, we are asked to check the mileage and the display the message if the mileage and number of…
Q: 2. SALES TAX Design a program that will ask the user to enter the amount of a purchase. The program…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read amount of…
Q: In programming language c A teacher has decided to plan extra hours of preparations for average…
A: If we want to store information about a student: his/her name, roll no, and marks. We can create…
Q: reate a change-counting game that gets the user to enter the number of coins required to make…
A: Required: C++ Visual 2019 Create a change-counting game that gets the user to enter the number of…
Q: (Dice Rolling) Write a program that simulates the rolling of two dice. The program should use rand…
A: #include <stdio.h>#include <stdlib.h>#include <time.h> int main() {…
Q: Programming Exercises Chapter 4, #1 Write a program that prompts the user to input a number. The…
A: As programming language is not mentioned, so we are providing answer in python language.
Q: To prepare for college, a child's parents promised to deposit $100 into a college account for the…
A: #include <iostream>using namespace std;int main(){ int year = 10,value = 100,total = 0;…
Q: First and Last Design a program that asks the user for a series of names (in no particular order).…
A: The, code has given below:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)(Numerical) Write an assignment statement to calculate the nth term in an arithmetic sequence. This is the formula for calculating the value, v, of the nth term: v=a+(n1)d a is the first number in the sequence. d is the difference between any two numbers in the sequence.Ron bought several acres of farm to grow and sell vegetables. Suppose that Ron wants to grow a maximum of two types of vegetables. Write a program that prompts Ron or the user to do the following: Enter the total farm area in acres. The number of vegetables (one or two) that the user wants to grow. If the user wants to grow trwo types of vegetables, then specify the portion,as a percentage, of the farm land used for each type of vegetable. Enter the seed cost, plantation cose, fertilizing cost, labor cost, for each acre. Enter vegetable selling price per acre. Output the total revenue. Output the profit/loss.
- Software Sales A software company sells a package that retails for $99. Quantity discounts are given below: Quantity Discount 10–19 20% 20–49 30% 50–99 40% 100 or more 50% Design a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount.Fat Gram Calculator Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories is not less than 0. According to nutritional formulas, the number of calories cannot exceed fat grams x 9. Make sure that the number of calories entered is not greater than fat grams x 9. Once corrected data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula: Percentage of calories from fat = (Fat grams x 9) / calories ANSWER IN PSEUDOCODE USE ONLY WHILE LOOPS DO NOT USE MODULES/FUNCTIONSFat Gram Calculator Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories is not less than 0. According to nutritional formulas, the number of calories cannot exceed fat grams x 9. Make sure that the number of calories entered is not greater than fat grams x 9. Once corrected data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula: Percentage of calories from fat = (Fat grams x 9) / calories ANSWER IN PSEUDOCODE
- C PROGRAM / C LANGUAGE Make a C program language. Input the number of players then input the number of goals scored for each. Print "Not Messi" if the highest goals exceed 10 and "Okay, fine, it's Messi" if it doesn't INPUT 1. Number of players 2. Goals scored by each player Constraints All of those goals are whole numbers The first line will contain a message prompt to input the number of players • The succeeding lines will contain a message to input the goals scored by each player • The last line contains appropriate resulting message EXPECTED OUTPUT A EXPECTED OUTPUT B Enter the number of players: 4 Goals score by player # 1: 7 Goals score by player #2: 2 Goals score by player #3: 5 Goals score by player #4: 1 Okay, fine it's Messi Enter the number of players: 5 Goals score by player # 1: 10 Goals score by player #2: 2 Goals score by player #3: 20 Goals score by player # 4: 1 Goals score by player # 4: 0 Not MessiOdd Even Number Problem Description Even Numbers are integers that are exactly divisible by 2, whereas an odd number cannot be exactly divided by 2. Example of even numbers are 2,4,6,8 and odd numbers are 1, 3, 5, 7, 9. Input The first line input contains an integer, which determines the number of test cases. Each of following lines represent sequence of integers that ends with 0. 2 34 1 8 5 22 0 10 7 16 -2 0 Output For each test case, the output will present the size of oddQueue and evenQueue following with the integers of odd and even numbers. oddQueue 2: 1 5 evenQueue 3: 34 8 22 oddQueue 1: 7 evenQueue 3: 10 16 -2 ** Your task is to write a program that will read the input and identify whether it is an odd number or even number. /******************************************************************************* Compilation: javac Queue.java** The Queue class represents a first-in-first-out (FIFO) queue of generic items.* It supports the usual enqueue and dequeue…Software Sales (see Chapter 3, Programming Exercises 12): A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10–19 10% 20–49 20% 50–99 30% 100 or more 40% Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. Submit: Algorithm, Python code with documentation, Output
- Hide Assignment Information Instructions The civil engineering department has asked you to write a program to compare three different designs of water towers shown in the diagrams below. The water towers are a cylinder topped with a half sphere. The engineers want to find the design that has the highest volume. The radius of the sphere and the radius and height of the cylinder for each of the three projects will need to be input by the user. The formula for the volume of a Sphere is:V = 4/3 π r3The formula for the volume of a Cylinder is:V = π r2 h Write two functions that will calculate the volume of a sphere and a cylinder respectively. Then, use these functions to write a program that will find the design with the largest volume. Hint: Remember that the tower only consists of a half sphere.METHODOLOGY A bookstore owner wants you to write a program that calculates the gross pay of an employee. The input to the program is the number of hours the employee works in one week and the employee’s hourly pay rate. The program is to calculate the employee’s gross pay including the possibility of overtime pay. Regular pay is the number of hours the employee worked (up to 40 hours) times the hourly rate. The program is to compute an overtime pay if the employee worked more than 40 hours. All hours beyond 40 should be multiplied to 1.5 for the OT differential pay The program should output the worker’s regular pay, overtime time, and the gross pay (sum of the regular pay and overtime pay). Create an IPO and flowchartchapter 7 assignment design a payroll program that prompts the user to enter an employee's hourly pay rate and the hours worked validate the user's input so that only pay rates in the range of $7.50 through $18.25 and hours in the range of 0 through 40 are accepted the program should display the employees gross pay.