Question
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 busi
If a taxi was used anytime during the trip, the company allows up to S10 per day. Anything beyond this must be paid by the bu
.Must produce a working program that follows each rule stated above . Your user interface must provide clear instructions for
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 number of days spent on the trip The departure time on the first day of the trip, and arrival time on the last day of the trip The amount of airfare . . . Conference or seminar registration fees * Rent a car or use taxis during the trip * Rental car type . Miles driven, if rent a car Parking fees for each day, if rent a car . Taxi fees for each day, if use taxis . Hotel expenses for each day, if number of days spent on the trip is greater than 1 The total travel expenses and reimbursement are calculated as follows: Both airfare and registration fees can be reimbursed If a car was rented, the total car rental fee can be reimbursed. Calculate the total car rental fee as the table below Car type Rental fee per day Gas fee per mile driven Sedan 20 0.24 SUV 25 0 27 Van 30 0.32 Convertible 50 0.45 The total car rental fee is: rental fee per day for a car type chosen number of days on the trip gas fee per mile driven miles driven . If a car was rented, the company allows up to $6 for parking per day Anything beyond this must be paid by the businessperson. To Do Dashboard Calendar Inbox
If a taxi was used anytime during the trip, the company allows up to S10 per day. Anything beyond this must be paid by the businessperson . The company allows up to $90 per night for hotel expense. Anything beyond this must be paid by the businessperson. The amount of each meal eaten. On the first day of the trip, a meal is allowed as an expense if the time of departure is BEFORE (and including) Meal type Departure time 7 am Breakfast Lunch 12 noon Dinner 6 pm For example, if departure time is 6:30 am, all 3 meals on the first day are reimbursed, if departure time is 9 am, only lunch and dinner on the first day are reimbursed. On the last day of the trip, a meal is allowed as an expense if the time of arrival is AFTER (and including) Meal type Arrival time Breakfast 8 am Lunch 1 pm Dinner 7 pm For example, if arrival time is 7:30 am, all 3 meals on the last day are NOT reimbursed, if arrival time is 5 pm, only breakfast and lunch on the last day are reimbursed. The company allows up to $9 for breakfast, $12 for lunch, and $16 for dinner. Anything beyond this must be paid by the employee. Reimbursement rule for If a payment goes beyond the maximal allowable amount for a certain item, the businessperson gets the maximal allowable amount reimbursed, otherwise, the businessperson gets how much he or she paid reimbursed. the company: For example, if the businessperson spent $120 for the hotel first night and $70 for the second night, and spent $10 for the dinner first night and $20 for the second (both meals are allowed to reimburse), then the allowable expenses for these two items are 90 70+10 16 186 To Do Dashboard Calendar Notifications Inbox
.Must produce a working program that follows each rule stated above . Your user interface must provide clear instructions for the user and information about the data being presented . The program should never end until the user tells you to . The program must involve ANY TWO of the following functions as defined below: o void update total (float &total_expense, float &total_reimbursement, float expense to add, float reimbursement to add); I/update total expense and total_reimbursement using references o void update total (float total_expense, float total reimbursement, float expense to add, float reimbursement to_add); //update total expense and total reimbursement using pointers o void meal_fee (int days_of trip, double departure time, double arrival time, double meal expense, double meal_reimbursement); //calculate the total meal expense and reimbursement fee using references o void meal_fee (int days_of_trip, double departure time, double arrival time, double meal expense, double meal_reimbursement); I/calculate the total meal expense and reimbursement fee using pointers All functions need to be 15-20 lines. Whitespace, single curly braces, and the function header do not count. Functions over 20 lines need justification in comments Do not put multiple statements into one line Error checking: o Re-prompt user for any bad inputs (includes other data types) o Do not accept negative numbers for any dollar amount or for miles driven Do not accept number less than 1 for the number of days o Only accept valid times for the time of departure and the time of o arrival .No global variables allowed (those declared outside of many or any other function, global constants are allowed e goto is NOT allowed
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream.h>

#include <iomanip.h>

using namespace std;

int Get_Number_of_days(int);

void Get_Time (double&, double&);

double Get_AirFare(double);

double Get_CarRental_Fee (double);

double Get_Vehicle_Expenses(double);

void Get_Parking_Fee(double&,double&);

void Get_Taxi_Fee(double&,double&);

double Get_Reg_Fee(double);

void Hotel_Fee(double&,double&);

void Meal_Expenses (double&,double&);

            int main()

            {

                int number_of_days;

                double Arrival_Time;  

                double Departure_Time;

              double AirFare;

                double Rental_Car_Fee;

                double Vehicle_Expense;

                double Car_Milage = .38;

                double Parking_Fee;

                double Taxi_Fee;

                double Registration_Fee;

                double Total_Spent;

                double Total_Allowed;

                double Total_From_Company;

                double Total_Meal_Expense;

                double Total;

                double Parking_Allowed;

                double Taxi_Fee_Allowed;

                double Hotel_Expense;

                double Night_Rate;

                double Hotel_Expense_Allowed;

                double Hotel_Expense_Total;

                double Breaksfast_Charges_Allowed;

                double Lunch_Charges_Allowed;

                double Dinner_Charges_Allowed;

                double Breaksfast_Charges;

                double Lunch_Charges;

                double Dinner_Charges;

                double TOTALMeal_Expense_Allowed;

                string Name_of_Employee;

                int d;

                double Spent_on_Parking;

                double Spent_on_Taxi;

                double spentTotal_Meal_Expense;

                

                cout<<"Employee Expense Report"<<endl;

                cout<<"====================="<<endl<<endl;

                

                cout<<"Name of the Employee: ";

                cin >>Name_of_Employee;

                cout<<endl;

                  

                number_of_days = Get_Number_of_days(number_of_days);

                d = static_cast<int>(number_of_days);

                cout<<endl;

                

                Get_Time (Departure_Time,Arrival_Time);

                cout<<endl;

                

                cout <<"TRAVEL "<<endl;

                cout <<"==========="<<endl;

                AirFare = Get_AirFare(AirFare);

                Rental_Car_Fee = Get_CarRental_Fee(Rental_Car_Fee);

                Parking_Allowed = 6 * number_of_days;

                Get_Parking_Fee(Spent_on_Parking, Parking_Allowed);

                Taxi_Fee_Allowed = 10 * number_of_days;

                Get_Taxi_Fee (Spent_on_Taxi,Taxi_Fee_Allowed);

                cout <<endl;

                

                cout <<"FEE"<<endl;

                cout <<"============="<<endl;

                Registration_Fee= getRegistration_Fee(Registration_Fee);

                Hotel_Expense_Total = number_of_days * Night_Rate;

                Hotel_Expense_Allowed = 90 * number_of_days;

                Hotel_Fee (Hotel_Expense_Total,Hotel_Expense_Allowed);

                cout<< endl;

                

                cout <<"MEAL"<<endl;

                cout <<"============"<<endl;

                Breaksfast_Charges_Allowed = 9.00 * number_of_days;

                Lunch_Charges_Allowed = 12.00 * number_of_days;

                Dinner_Charges_Allowed = 16.00 * number_of_days;  

                TOTALMeal_Expense_Allowed = Breaksfast_Charges_Allowed+Lunch_Charges_Allowed+Dinner_Charges_Allowed;

                Total_Meal_Expense= Breaksfast_Charges +Lunch_Charges +Dinner_Charges;

                Meal_Expenses (TOTALMeal_Expense_Allowed,spentTotal_Meal_Expense);

                cout<<endl;

           

                //Calculating Total Spendings

                Total_Spent=AirFare+Rental_Car_Fee+Vehicle_Expense+Parking_Fee+Taxi_Fee+Registration_Fee+Hotel_Expense+Car_Milage+Total_Meal_Expense;

                Total_Allowed= AirFare+Car_Milage+Rental_Car_Fee+Parking_Allowed+Taxi_Fee_Allowed+TOTALMeal_Expense_Allowed+Hotel_Expense_Allowed;

           

                //Totals for the Employee Travelling

                cout <<"Employee Expense Report for "<<Name_of_Employee<<endl<<endl;

                cout << "Total Number_of_days of trip: "<<number_of_days<<endl;

                cout << fixed << setprecision(2);

                cout << "Departure time: "<< Departure_Time<<"Arrival time: "<<Arrival_Time<<endl;

                cout<<setprecision(2)<<showpoint<<fixed;

                cout<<endl;

                cout<<"Spent”<< "Allowed"<<endl;

                cout <<"Airfare”<<AirFare<<AirFare<<endl;

                cout <<"Car Rental”<<Rental_Car_Fee<<Rental_Car_Fee<<endl;

                cout <<"Milage"<<Car_Milage<<Car_Milage<<endl;

                cout <<"Parking"<<Parking_Fee<<Parking_Allowed<<endl;

                cout <<"Taxi”<<Taxi_Fee<<Taxi_Fee_Allowed<<endl;

                cout <<"Registration"<<Registration_Fee<<Registration_Fee<<endl;

                cout <<"Hotel"<<Hotel_Expense_Total<<Hotel_Expense_Allowed<<endl;

                cout<<"Meal"<<spentTotal_Meal_Expense<<TOTALMeal_Expense_Allowed<<endl;

                cout <<"TOTALS"<<setw(21)<<Total_Spent<<otal_Allowed<<endl;

                cout <<endl<<endl;

               

                system ("pause"); //It will pause the system for some time until you press any key.

                return 0;

            }

           

            //Asking employee about number of days spent on the trip

            int Get_Number_of_days(int number_of_days)

            {

                        cout << "How many number_of_days were spent on the trip?" << endl;

                          cin >> number_of_days;

                          

                          while (number_of_days < 1)

                          {

                                cout << "Please enter a number greater than 1" << endl;

                                cin >> number_of_days;

                          }

                          

                          return number_of_days;

            }

           

//Function to ask the employee about departure time of the trip

            void Get_Time (double &Departure_Time, double &Arrival_Time)

            {

                       cout << "At what time did you depart for the trip? Kindly enter in 00.00 format." ;

                       cin >> Departure_Time;

                       cout <<endl;

                       

                       while ( Departure_Time <0 || Departure_Time > 23.59)

                       {

                             cout << "Error: Please enter a number between 00.00 and 23.59";

                             cin >> Departure_Time;

                        }

                      

                       cout << "At what time did you arrive for the trip? (Kindly enter in 00.00 format)" ;

                       cin >> Arrival_Time;

                       

                        while ( Arrival_Time <0 || Arrival_Time > 23.59)

                       {

                             cout << "Kindly provide a number between range 00.00 and 23.59";

                             cin >> Arrival_Time;

                        }

                    }

            //Function to get expenses for airplane travel

            double Get_AirFare (double AirFare)

            {      

                     cout << "What was the Total cost of the air fare?" << endl;

                     cin >> AirFare;

                     while (AirFare < 0) //Validating airfare

                     {

                           cout << "Kindly provide a number greater than 0." << endl;

                           cin >> AirFare;

                     }

                     

                     return AirFare;

            }

            //Car Rental Function

            double Get_CarRental_Fee (double Rental_Car_Fee)

            {

                   cout << "What was the Total cost of any car rentals?" << endl;

                   cin >> Rental_Car_Fee;

                   while (Rental_Car_Fee < 0) //Validating rental amount

                   {

                         cout << "Error:Please enter a number greater than 0. Try Again!" << endl;

                         cin >> Rental_Car_Fee;

                   }

                   

                   return Rental_Car_Fee;

            }

           

            //Function to total parking fee

            void Get_Parking_Fee(double &Spent_on_Parking, double &Parking_Allowed)

            {

                int number_of_days;

                double Parking_Fee;

                

                   cout << "How much was spent on parking?" << endl;

                   cin >> Parking_Fee;

                   

                   while (Parking_Fee < 0) //Validating parking fee total

                   {

                         cout << "Error:Please enter a positive number. Try again!" << endl;

                         cin >> Parking_Fee;

                   }

                   

                   Spent_on_Parking = number_of_days * Parking_Fee;

                   Parking_Allowed = number_of_days * 6;

            }

           

            //Function for taxi fees total

            void Get_Taxi_Fee (double &Spent_on_Taxi, double &Taxi_Fee_Allowed)

            {

                double Taxi_Fee;

                int number_of_days;

                   cout << "How much was spent on taxi fare?" << endl;

                   cin >> Taxi_Fee;

                   while (Taxi_Fee < 0) Validating data from employee

                   {

                         cout << "Only positive numbers are allowed!" << endl;

                         cin >> Taxi_Fee;

                   }

                   

                   Spent_on_Taxi = number_of_days * Taxi_Fee;

                   Taxi_Fee_Allowed = 6 * number_of_days;

            }

            //Function for Employee’s conference fees

            double getRegistration_Fee (double Registration_Fee)

            {

                   cout << "How much was spent on conference fees?" << endl;

                   cin >> Registration_Fee;

                   

                   while (Registration_Fee < 0)

                   {

                         cout << "Only positive numbers are allowed!" << endl;

                         cin >> Registration_Fee;

                   }

                   

                   return Registration_Fee;

            }     

            //Total cost of the hotel

            void Hotel_Fee (double &Hotel_Expense_Allowed, double &Hotel_Expense_Total)

            {

                int number_of_days;

                double Hotel_Expense;

                   cout << "How much did you spend on hotel rooms?" << endl;

                   cin >> Hotel_Expense;

                   

                   while (Hotel_Expense < 0)

                   {

                         cout << "Only positive numbers are allowed!" << endl;

                         cin >> Hotel_Expense;

                   }

                   Hotel_Expense_Allowed = 90 * number_of_days;

                   Hotel_Expense_Total= Hotel_Expense * number_of_days;

            }

            //Calculating Meal expenses total

            void Meal_Expenses(double &TOTALMeal_Expense_Allowed,double &spentTotal_Meal_Expense)

            {

                int number_of_days;

                int numNumber_of_days;

                double Breakfast;

                double Lunch;

                double Dinner;

                double Day_First;

                double Day_Last;

                double Departure_Time;

                double Arrival_Time;

                double Breaksfast_Charges_Allowed;

                double Lunch_Charges_Allowed;

                double Dinner_Charges_Allowed;

                double BreakfastFee;

                double Lunch_Charges;

                double Dinner_Charges;

                

                for(int number_of_days = 1; number_of_days <= numNumber_of_days; number_of_days++)

                    {       

                        cout << "Day:" << number_of_days << endl;

                        

                if (number_of_days < 2 && Departure_Time > 00.00 && Departure_Time <= 7.00)

                    {

                        cout << "Enter the cost of Breakfast: ";

                        cin >> BreakfastFee;

                        cout << "Enter the cost of Lunch: ";

                        cin >> Lunch_Charges;

                        cout << "Enter the cost of Dinner: ";

                        cin >> Dinner_Charges;

                    }

                        

                if (number_of_days < 2 && Departure_Time > 7.00 && Departure_Time <=12.00)

                    {

                        cout << "Enter the cost of Lunch: ";

            cin >> Lunch_Charges;

                        cout << "Enter the cost of Dinner: ";

                        cin >> Dinner_Charges;

                    }

                    

                if (number_of_days < 2 && Departure_Time > 12.00 && Departure_Time <=18.00)

                    {

                        cout << "Enter the cost of Dinner: ";

                        cin >> Dinner_Charges;

                    }

                if (number_of_days > 1 && number_of_days < numNumber_of_days )

                   {  

                        cout << "Enter the cost of Breakfast: ";

                        cin >> BreakfastFee;

                        cout << "Enter the cost of Lunch: ";

                        cin >> Lunch_Charges;

                        cout << "Enter the cost of Dinner: ";

                        cin >> Dinner_Charges;

                   }

                

                if (number_of_days == numNumber_of_days && Arrival_Time > 8.00 && Arrival_Time <= 13.00)

                    {

                        cout << "Enter the cost of Breakfast: ";

                      cin >> BreakfastFee;

                        

                    }

                    

                if (number_of_days == numNumber_of_days && Arrival_Time > 13.00 && Arrival_Time <= 19.00)

                    {

                        cout << "Enter the cost of Breakfast: ";

                        cin >> BreakfastFee;

                        cout << "Enter the cost of Lunch: ";

                        cin >> Lunch_Charges;

                    }

                    

                if (number_of_days == numNumber_of_days && Arrival_Time > 19.01)

                    {

                        cout << "Enter the cost of Breakfast: ";

                        cin >> BreakfastFee;

                        cout << "Enter the cost of Lunch: ";

                        cin >> Lunch_Charges;

                        cout << "Enter the cost of Dinner: ";

                        cin >> Dinner_Charges;

                    }

                    cout <<endl;    

            }

            Breaksfast_Charges_Allowed = 9.00 * number_of_days;

                Lunch_Charges_Allowed = 12.00 * number_of_days;

                Dinner_Charges_Allowed = 16.00 * number_of_days;  

                TOTALMeal_Expense_Allowed = Breaksfast_Charges_Allowed+Lunch_Charges_Allowed+Dinner_Charges_Allowed;

                spentTotal_Meal_Expense= BreakfastFee +Lunch_Charges +Dinner_Charges;

            }

Add a comment
Know the answer?
Add Answer to:
Please help, need to code for this business assignment using c++. Business Expense Reimbursements Calculator Probl...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Travel Expenses Create a GUI in C# Visual Studios application that calculates and displays the total...

    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...

  • Just need help with the first two questions, please! Accounting Cycle Review Project C. Brown recently...

    Just need help with the first two questions, please! Accounting Cycle Review Project C. Brown recently expanded to open a 2nd fly fishing shop, CB's Fly Shop2. In order to finance the 2nd shop, C. Brown contributed $20,000 and raised another $50,000 from friends and family. With the additional cash, he is able to get his 2nd fly shop open and operational in June 2015. He is too busy with it being prime fishing season to do the accounting and...

  • Need help on questions 3 and 4 please! Accounting Cycle Review Project C. Brown recently expanded...

    Need help on questions 3 and 4 please! Accounting Cycle Review Project C. Brown recently expanded to open a 2nd fly fishing shop, CB's Fly Shop2. In order to finance the 2nd shop, C. Brown contributed $20,000 and raised another $50,000 from friends and family. With the additional cash, he is able to get his 2nd fly shop open and operational in June 2015. He is too busy with it being prime fishing season to do the accounting and has...

  • JAVA Hello I am trying to add a menu to my Java code if someone can...

    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");...

  • Please see attached Pictures. This is a homework assignment for Legal environment of Business that i...

    Please see attached Pictures. This is a homework assignment for Legal environment of Business that i need help solving. Stacy mails Jennifer an offer to sell Jennifer 43 bags of rice for $107.00. Jennifer replies to Stacy by mail, stating, " agree to pay $105.75 for 43 bags of rice. Neither Stacy nor Jennifer are merchants. What is the status of Stacy's offer. 1. a. Jennifer has accepted it b. Jenifer has rejected it and counteroffered c, Jennifer has breached...

  • Gleim 6 Deductions from AGI [1] Which one of the following expenses does not qualify as...

    Gleim 6 Deductions from AGI [1] Which one of the following expenses does not qualify as a deductible medical expense? A. Cost of long-term care for a developmentally disabled person in a relative’s home. B. Special school for a deaf child to learn lip reading. C. Cost of elevator installed for individual who had heart bypass surgery (in excess of increase in value of individual’s home). D. Cost and care of guide dogs used by a blind person in his...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT