I need help writing functions in C++ that asks for and return the following: 1. The amount of any car rentals 2.Miles driven, if a private vehicle was used. Vehicle expense is 0.27 $ per mile driven. 3.Parking fees.(The company allows up to 6 per day. Anything in excess of this must be paid by the employee), 4. Taxi fees(The company allows up to 10$ per day, for each day that taxi was used. Anything in excess must be paid by the employee. The functions must be written using loops.
Solution:
#include <iostream>
using namespace std;
int amount_rentals(){ //function that returns amount of car
rentals
int amount;
cout<<"The amount of car rentals"<<endl;//read input
and return it
cin>>amount;
return amount;
}
float miles_driven(){//function that reads miles and returns
cost
float miles;
cout<<"The number of miles driven"<<endl;
cin>>miles; //read miles driven and return cost
return miles*0.27;
}
int parking(){//function that reads parking fee and return
it
int park;
cout<<"Enter parking fee"<<endl;
cin>>park;//read input from user
if(park>6){//If parking is greater than 6 then subtract it
park=park-6;
}
else{
return 0;
}
return park;//return park value
}
int taxi_fee(){//function that return taxi fee
int taxi;
cout<<"Enter taxi fee"<<endl;
cin>>taxi;//read input from user
if(taxi>10){//If taxi is greater than 10 then subtract it
taxi=taxi-10;
}
else{
return 0;
}
return taxi;//return value
}
int main()//main function
{
cout<<"The amount of car
rentals:"<<amount_rentals()<<endl;//call functions and
print output on console
cout<<"The cost in $ for miles
driven"<<miles_driven()<<endl;
cout<<"The parking fee to be paid by
employee"<<parking()<<endl;
cout<<"The taxi fee to be paid by
employee"<<taxi_fee()<<endl;
return 0;
}
Screenshots:
The output is attached below for reference.
Please follow them.

I need help writing functions in C++ that asks for and return the following: 1. The...
Travel Expenses Create a GUI in C# Visual Studios application that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of taxi charges, if any...
creat a GUI APPLICATION that calculates and displays the total travel expenses of a business person on a tripmhere is the information that a user provide:-number ofdays on the trip,amount of airfare,amount of car rental fees,if any,number of miles driven,if the private vehicle was used,amount of parking fees,amount of taxicharges,conference or seminar fees,lodging charges per night.The company reimburses trevel expenses according to following policy:$37 per day for meals,parking fees,upto $10 per day,taxi charges up to$ 20.00per week.lodging charges up to...
Please help, need to code for this business assignment using
c++.
Business Expense Reimbursements Calculator Problem statement: Business trip is part of the enterprise culture. Suppose a businessperson just completed a business trip for your company. Now, you are tasked to write a program that calculates and displays the total travel expenses, allowable expenses for the trip, and the excess that must be paid by the businessperson, if any The program should prompt the user for the following . The...
JAVA Hello I am trying to add a menu to my Java code if someone can help me I would really appreacite it thank you. I found a java menu code but I dont know how to incorporate it to my code this is the java menu code that i found. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JRadioButtonMenuItem; public class MenuExp extends JFrame { public MenuExp() { setTitle("Menu Example");...
For each of the 5 examples below, I need help understanding
if:
1) Is there an externality? Is it positive, negative or a
consumption or production externality
2) If there is an externality, is it likely that private markets
will arise that allow the externality to be internalized?
3) If the conditions of a Coase theorem are not met, could the
government intervene and how?
(a) Your fellow 14.41 classmate asks questions when things are confusing. (b) A rise in...
Help me please. #1: Benedict Company incurred the following costs. 1. Sales tax on factory machinery purchased $ 5,000 2. Painting of and lettering on truck immediately upon purchase 700 3. Installation and testing of factory machinery 2,000 4. Real estate broker’s commission on land purchased 3,500 5. Insurance premium paid for fi rst year’s insurance on new truck 880 6. Cost of landscaping on property purchased 7,200 7. Cost of paving parking lot for new building constructed 17,900 8....
Hello dear, Please i need help to solve this problem in Finance 1. Apply What You’ve Learned - Auto Purchase Scenario: You are in the market for a new car. You do not have a trade-in, but you have saved $2,500 toward a down payment. You currently earn $4,000.00 gross monthly income, of which 35% is withheld for various deductions. You have heard of the 20% rule of thumb, but want to limit your payments to no more than 15%...
I need help writing c++ code to make this program. 1. Define a function that can read the input file answers.dat. This function should not print anything. 2. Define a function that computes the quiz score of the function by comparing the correct answers to the student’s answer. The result should be a percentage between 0 and 100, not a value between 0 and 1. This function should not print anything. 3. Define a function that prints the report as...
Must be written in C++ Bank Charges A bank charges $15 per month plus the following check fees for a commercial checking account: $0.10 per check each for fewer than 20 checks (1-19) $0.08 each for 20–39 checks $0.06 each for 40–59 checks $0.04 each for 60 or more checks Write a program that asks for the number of checks written during the past month, then computes and displays the bank’s fees for the month. Input Validation: Display an error...
Solve it in
access
Group Project Note: All documents should be prepared and presented in a professional manner, with a cover page showing the group number and the names of group members. Nothing should be hand written hand drawn Michiana Car Rentals Database System Michiana Car Rentals, Inc., headquartered in South Bend, IN, wants to build a database system which would track information customer billing. Usually, a customer picks up a car and then returns after a period of time....