Write a program ShippingCharges.cpp that asks for the weight of the package and the distance it is to be shipped, then displays the charges. For example: If weight = 5 kg and distance = 1600 miles, then the calculation is shipping rate = $2.20 and the distance rate factor is round-up of (1600 / 500 = 3.2), which is 4. Thus the shipping charge is $2.20 x 4 = $8.80 Input validation: Do not accept values of 0 or less for the weight of the package. Do not accept weights of more than 20 kg (this is the maximum weight the company will ship). Do not accept distances of less than 10 miles or more than 3,000 miles. These are the company's minimum and maximum shipping distances. Terminate program is invalid input detected.
Q: Write a program that prompts the user to input an integer and then outputs both the individual…
A: Note :- As per our guidelines we are supposed to answer only one question. Kindly repost for the…
Q: Write a program that computes the cost of the postage on first-class mail according to the following…
A: Algorithm for calculating the cost of the delivery of the mail:Step1: Declare…
Q: Write a program that accepts a number of minutes and converts it both to hours and days. For…
A: As no programming language is mentioned it is solved using basic C++
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, q3 = 3 located at…
A: For the given points (1, 2, 3), (3, -4, -5) and (-4, 2, -6) The rij is the distance between charges…
Q: Write a program to find the equivalent series and parallel resistance for 3 resistor values. Your…
A: As there is no programming language mentioned in question . program is attempted in c language user…
Q: Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: ncreme
A: The program provided below calculates flame theoretical temperature when a mixture of methane,…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: Purpose of the program: This program computes the taxable income and the federal tax amount for a…
Q: Write a program with total change amount as an integer input, and output the change using the fewest…
A: void change(int amount, int *dollar, int *quarters, int *dimes, int *nickels, int *pennies) {…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: The question is to write a code for the given problem and no language has been mentioned, here C++…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: According to the information given:- We have to create the program in that we as user to tell his…
Q: Write a program to take orders for a computer shop and print a bill. Your program asks for the…
A: **THIS CODE IS WRITTEN IN PYTHON SINCE NO PROGRAMMING LANGUAGE WAS MENTIONED. #input values item…
Q: Write a program that asks the user to enter 2 integers of 4 digits and displays the different digits…
A: Program Explanation: Declare the header files Declare and define the function to compare two…
Q: Suppose that the first number of a sequence is x, where x is an integer. Define a0= x; an+1=an/2 if…
A: Following is the C++ program that takes as input from user the value of x. Then using the while loop…
Q: Write a program that calculates the electricity bill. The rates of electricity per unit are as…
A: Introduction of program In this program, we will give input on Electricity Unit Consumed. Charges…
Q: Write a program that asks the user for his name and salutes him using it. The prompt must be "What…
A: According to the Question below the solution: Output:
Q: ask3.c 4. Task 3: Using a.. 1 Your code goes here... Collapse 4. Task 3: Using a nested loop Write a…
A: Since you are not specify any language for implementation I am doing in C language. Program…
Q: Write a program that can be used by a small theater to sell tickets for performances. The theater’s…
A: Introduction: In this question, we have to write a program that asked for the prices of each seat of…
Q: Write a program that converts a given number of minutes into hours:minutes:seconds format. For…
A: C++ Program for above : #include <iostream> #include <iomanip> using namespace std;…
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: Program code: #include <stdio.h> int main(){ char code; float gallon, bill;…
Q: Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the…
A: Start input age through get_age function if person is not in between 18 to 75 the print message…
Q: Write a program that prompts the user to enter the three dimensions, possibly with decimals, of a…
A: //Solution in C++ #include<iostream>#include <iomanip>using namespace std;int main(){…
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: Program code: #include <iostream>#include <cmath>using namespace std;int main(){int…
Q: а. Write a program that calculates and prints the fare for an airline. There are two plans: Plan…
A: Code: #include <cctype> #include <iostream> #include <cstring> #include…
Q: Write a program that prints the day number of the year, given the date in the form month-day-year.…
A: Programming Approach Declare a header file. Using namespace. Define function prototypes Declare a…
Q: Write a program that can suggest an activity based on the temperature. If the temperature is between…
A: Hi. As you have not mentioned any programming language, I will choose Python. Let's move on to…
Q: Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height. It…
A: Python code to find BMI of person is given below.
Q: Write a program called p3.py that prints out a classic hangman stick figure. The program should ask…
A: We need to create the program according to the given output for the hangman in python.
Q: In Python: Write a program with total change amount as an integer input, and output the change…
A: Approach: Defining the main function Getting the input from the user that is the change Checking…
Q: Write a program that prompts the user for a U.S. dollar amount and then converts it to Japanese Yen,…
A: Purpose: In this the dollar has to be converted into yen, Pound, Currency and then it has to…
Q: Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: Python code :- def question9(): print("Question 9) # arrays to store miles and gas used…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: PROGRAM: //header files #include <iostream> #include<iomanip> //using namespace using…
Q: Write a program that prompts the user to enter the distance todrive, the fuel efficiency of the car…
A: Program Plan: importing the libraries of utility class for scanner and other mathematical…
Q: Write a program that computes the fuel efficiency of a multi-leg journey. The program will first…
A: We need to write a Python program for given scenario.
Q: Imagine you are working for a lumber company, and your employer would like a program that calculates…
A: The company sells pine, fir, cedar, maple, and oak lumber. The lumber is priced by board feet. One…
Q: Write a program that prompts the user to enter apoint (x, y) and checks whether the point is within…
A: Program Approach: Importing necessary packages to get standard input and output. Defining a class…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Please find the answer below :
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: Python Code Standard_Exemption = 4000; Tax_Salary = 0.0 tax = 0.0 child = 0 Marital_Status =…
Q: Write a program that calculates the potential energy of 3 charges q1 = 1, q2 = 2, 43 = 3 located at…
A: please do upvote for my efforts thanks! answer: CODE #include…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: Actually, c++ is a powerful general purpose language. The, code has been below:
Q: Write a program that asks users when their birthday is. Use information provided to give them their…
A: Your solution is here with an output.
Q: Write a program that computes the cost of postage on a first-class letter according to the following…
A: Use an if-else block to find the cost of postage and then another if-else block to check for special…
Q: Write a program that will read a number and will display the factors of the number. Factors are…
A: Program code: x=int(input("Enter a number: "))print("The factors of",x,"are:")for i in range(1, x +…
Q: Write a program that helps the user count his change. The program should ask how many quarters the…
A: Java program is asked for the given requirements.
Q: Implement a program that calculates the bill of a sandwich stand. The program should ask the user to…
A: We need to write a program that calculates the bill of a sandwich stand. The program will ask the…
Q: Write a program that asks the user to enter two positive integers, the height and length of a…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Write a program that displays a table of speeds in kilometers per hour with their values converted…
A: PROGRAM CODE: #include <iostream>#include <iomanip>using namespace std; int main(){ int…
Q: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For…
A: Purpose of the program: This program computes the taxable income and the federal tax amount for a…
Use relational and logical operators to make decisions using selection structures
Use an if else structure to validate the values and then use if else if ladder to calculate amount
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Using c++ 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 Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, 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 reentered 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 inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the total chargesusing c++ 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 Hospital medication charges Charges for hospital services (lab test, etc.) The program should ask for the following data if the patient was an out-patient: Charges for the hospital services (lab test, etc.) Hospital medication charges The program should use two 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 information. Both functions should return the total charges.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…
- Fox International sells pre-paid calling card with the following features: Calls to USo 1.2 cents per minute plus a 49 cent connection fee per call Calls to Europeo 2.3 cents per minute plus a 49 cent connection fee per call Calls to Australiao 6.4 cents per minutes plus a 49 cent connection fee per callWrite a program that work out the charges for the month. The program should accept the followinginformation: Account holders name Card number Starting Balance on card For US callso Total number of minutes of all callso Total number of calls made For European callso Total number of minutes of all callso Total number of calls made For Australian callso Total number of minutes of all callso Total number of calls madeYou are NOT expected to error check your inputs for this assignment. (e.g. checking for negative values,etc.). There is NO GST charged on the calls as the GST was paid when the card was purchased.Format of output:Review the test plan to see how the user would like the…Mobile Service ProviderA mobile phone service provider has three different subscription packages for itscustomers:Package A: For $39.99 per month 450 minutes are provided. Additional minutes are$0.45 per minute.Package B: For $59.99 per month 900 minutes are provided. Additional minutes are$0.40 per minute.Package C: For $69.99 per month unlimited minutes provided.Write a program that calculates a customer’s monthly bill. It should ask which packagethe customer has purchased and how many minutes were used. It should then displaythe total amount due.Input Validation: Be sure the user only selects package A, B, or C.Pakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to5). Once per day, each agent passes in a slip for each different type of product sold. Every agentpasses in between 0 to 5 slips each day. Each slip has the following information on it: The agent number The product number Total rupees of that product sold that day.Write a program in C++ that will read all this information for last month’s sales and brief thetotal sales by agent by product. The output should be in tabular form.
- 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 insuranceAn 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.Prompt 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…
- Problem 2: Employee Payment The Stark Industry needs a program to calculate how much to pay their hourly employees. They have the following rules: An employee gets paid (hours worked) × (base pay), for each hour up to 40 hours. For every hour over 40, they get overtime = (base pay) × 1.5. If the number of hours is greater than 60, print an error message. Example: If an employee works for 45 hours, and his base pay is $8 , the he will get= (40 * 8)+ [5* (8 * 1.5)] = $380 Create a new class called StarkIndustry. Write a method that takes the base pay and hours worked as parameters, and prints the total pay or an error. Write a main method that calls this method for each of these employees: Employee No Base pay Hours Worked Employee 1 $7.20 35 Employee 2 $8.20 47 Employee 2 $10.50 73 You will have to submit StarkIndustry.java file.A business law class of 25 students takes a midterm exam that has 100 true- or-false questions. The instructor, who is also a computer fanatic, wants to devise a program to obtain a printout with the student's name, score, and letter grade, according to the following schedule: 50 or below F 51 - 55 D 56 – 60 C- 61 - 65 66 – 70 C+ 71 - 75 B- 76 - 80 81 - 85 86 – 90 B B+ А- 91 - 95 A 96 – 100 A+ In addition, the instructor wants to include the total number of students scoring each of the 11 possible grades. How would you use the FORTRAN language to solve his problem?use C++ programming language 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 Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, 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 reentered 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 inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the…