program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles.
Q: A mobile phone service provider has three different subscription packages for its customers: Package…
A: Code: #include <iostream>using namespace std;int main(){ char choice; int mins, extramins;…
Q: Sometimes we write similar letters to different people. For example, you might write to your parents…
A: Note: Since no programming language is mentioned in the question, the program has been provided in…
Q: A parking garage charges a $20.00 minimum fee to park for up to three hours. The garage charges an…
A: Sample Response: //C++ programming language, tested on CodeBlock IDE#include…
Q: Write a program to calculate the grade point average (GPA) of a student by getting their grades for…
A: Step 1:- Program Approach:- 1.Include the header file 2.Declare variables 3.Take the input for the…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: The given problem is related to programming language where the user will input the miles/gallon and…
Q: An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The…
A: Program: // include required header files #include <iostream> #include <iomanip>…
Q: An Internet service provider has three different subscription packages for its customers: Package A:…
A: Declare all variables Input the package Input the hours Calculate the bill as per package…
Q: code
A: Introduction Java is basically a type of programming language that is very much beneficial and can…
Q: A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an…
A: Steps/Algo: Ask the user to enter the number of hours parked. Calculate charges using the…
Q: You found an exciting summer job for five weeks. It pays a per hour rate (which will be input to the…
A: Given: You found an exciting summer job for five weeks. It pays a per hour rate (which will be input…
Q: Airline companies apply baggage restrictions for their passengers. An airline company has decided to…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: Write a program that reads the marks of a student in the test (te), midterm (mid), assignment…
A: Code: #include<stdio.h> int main(){ int tm,mid,assig,fe,pm; printf("Enter…
Q: positive
A: Introduction Here we will provide a sample of a program where we can rectify whether the result is…
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: You are working for a lumber company, and your employer would like a program that calculates the…
A: Objective: This program would compute the total cost of woods of different types where the costs for…
Q: You are working for a lumber company, and your employer would like a program that calculates the…
A: Since you are not specifying any language for implementation, I am using C++. Program #include…
Q: Jim works at a food bank and is trying to schedule the volunteers. He has three volunteers. The…
A: The program will starts by initializing an empty list called volunteers. It will then prompts the…
Q: Write a program to calculate the net pay of an employee. Input the basic pay and calculate the net…
A: class EmployeeSalary: hraPay = 0 conveyancePay = 0 medicalAllPay = 0 netPay = 0 def…
Q: An International Internet phone company has three different subscription packages for its…
A: Given: To write a program that calculates a customer’s monthly bill. It should input the customer…
Q: When Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas…
A: This program is used to calculate and find the car's gas mileage at any time. We know the formula to…
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: Please program in C++
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Suppose you are a cashier at a grocery store and you want to write a program that takes a purchase…
A: Suppose you are a cashier at a grocery store and you want to write a program that takes a purchase…
Q: An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The…
A: Program code: // include required header files #include <iostream> #include <iomanip>…
Q: A rod is used to hang a load (force) of 1000 N. There are 4 ingredients with their respective…
A: Task : The task is to create two lists to store details for the : ingredient names strengths
Q: The New Telephone Company has the following rate structure for long-distance calls: The regular…
A: Solution:
Q: the electrical resistance r (in ohms) of a metal wire is given by the formula r = (ml)/ a where m is…
A: As no programming language is mentioned it is solved using basic C++
Q: A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $1 per…
A: #include <stdio.h>#include <stdlib.h> double calculateCharges(double hours) { double…
Driving is expensive. Write a
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output the gas cost (gasCost) with two digits after the decimal point, which can be achieved as follows:Put gasCost to output with 2 decimal places Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Note: Small expression differences can yield small floating-point output differences due to computer rounding. Ex: (a + b)/3.0 is the same as a/3.0 + b/3.0 but output may differ slightly. Because our system tests programs by comparing output, please obey the following when writing your expression for this problem. First use the dollars/gallon and miles/gallon values to calculate the dollars/mile. Then use the dollars/mile value to determine the cost per 10, 50, and 400 miles. Note: Real per-mile cost would also include maintenance and depreciation.An oil slick occurs when an underwater refinery pipe ruptures, pumping oil into the water. The spilled oil sits on top of the water and causes a natural disaster. For simplicity, suppose that the oil sits on top of the water in the form of a circle. Write a program that prompts the user to enter the rate at which the ruptured pipe pumps oil (in gallons) per minute, the thickness of the oil on top of the water, and the number of days for which the area is covered by the spilled oil. The program outputs the spilled area (in kilometer) and the volume of oil (in gallons) on top of the water after each day.A parking garage charges a $20.00 minimum fee to park for up to three hours. The garage charges an additional $5.00 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24- hour period is $50.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and printsthe parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format: Car Hours Charge1 1.5 20.002 4.0…
- A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and prints the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format Sample output Enter the hours parked for 3 cars: 1.5 4.0 24.0 Car Hours Charge 1 1.5 2.00 2 4.0 2.50 3 24.0 10.00 TOTAL 29.5 14.50You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table: The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no integers following it on the line. The program…Suppose you are a cashier at a grocery store and you want to write a program that takes a purchase subtotal and calculates the total purchase cost, including 7% tax.
- Write a program to calculate the grade point average (GPA) of a student by getting their grades for all their subjects. Grades and their grade points areGrade S 10 pointsGrade A 9 pointsGrade B 8 pointsGrade C 7 pointsGrade D 6 pointsGrade E 5 pointsGrade F 0 pointsThe program should input the number of subjects, followed by the grade obtained in each subject. The program should calculate the average of the grade points and print it.A mobile phone service provider has three different subscription packages for its customers: 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 are provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of minutes that were used. The program should display the total charges.а. Write a program that calculates and prints the fare for an airline. There are two plans: Plan Ticket fare Baggage Weight Fare Tax Economy 1200 $ 25 18% or 10% Business 3000 $ 35 20% or 12% Extra weight is charged by 20$/Kg for Economy, and 15$ for Business. A fare tax is added to the ticket fare: 18% for Economy and 20% for Business if the ticket type is "roundtrip". The fare is 10% for Economy and 12% for Business if the ticket type is "one-way". The tax percentage is applied on the original ticket fare. i. Ask the user to enter the Customer ID. A valid Customer ID must contain 5 digits. If the user inputs an invalid Customer ID the user must re-enter the account. Ask the user to enter the plan code (The user will enter e or E for Economy and b or B for Business). Any invalid input must be corrected by asking the user to re-enter. ii. iii. Ask the user to enter the weight. You may assume that the user will not enter a negative number. iv. Ask the user to enter 'y' if it is a…
- The New Telephone Company has the following rate structure for long-distance calls: The regular rate for a call is P8 per minute. Any call started after 6:00P.M. (1800 hours) but before 8:00 A.M (0800 hours) is discounted 50%. Any call longer than 60 minutes receives a 15% discount. All calls are subject to 4% federal tax on the cost after any discounts. Write a program that takes the start time for a call based on a 24-hour clock and the length of the call in minutes. The gross cost (before any discounts or tax) should be displayed followed by the net cost (after discounts are deducted and tax is added).An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges. Requirements: Please include a Flowchart and the pseudocode for your program and use Visual BasicAn Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges. Using Visual Basic I need help finishing this code this is what I got so far Dim decpackageA As DecimalDim decpackageA1 As DecimalDim decpackageB As DecimalDim decpackageB1 As DecimalDim decpackageC As DecimalDim inthours_worked As IntegerDim dectotal_chargespackageA As DecimalDim dectotal_chargespackageB As DecimalDim dectotal_chargespackageC As DecimalDim dbltotal_charges As Double 'Assign the textbox…