Group Project
20. Using Files—Travel Expenses
This program should be designed and written by a team of students. Here are some suggestions:
• One student should design function main, which will call the other functions in the program. The rest of the functions should be designed by other team members.
• Analyze the program requirements so each student is given about the same workload.
• Decide on the function names, parameters, and return types in advance.
• Use stubs and drivers to test and debug the program.
• The program can be implemented either as a multifile program, or all the functions can be cut and pasted into the main file.
Here is the assignment. Write a program that calculates and displays the total travel expenses of a businessperson on a trip. The program should have functions that ask for and return the following:
• The total number of days spent on the trip
• The time of departure on the first day of the trip and the time of arrival back home on the last day of the trip
• The amount of any round-trip airfare
• The amount of any car rentals
• Miles driven, if a private vehicle was used. Vehicle allowance is $0.58 per mile.
• Parking fees. (The company allows up to $12 per day. Anything in excess of this must be paid by the employee.)
• Taxi fees. (The company allows up to $40 per day for each day a taxi was used. Anything in excess of this must be paid by the employee.)
• Conference or seminar registration fees
• Hotel expenses. (The company allows up to $90 per night for lodging. Anything in excess of this amount must be paid by the employee.)
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Starting Out With C++: Early Objects (10th Edition)
- Code it fast Screenshot attach for confirmationarrow_forwardMake sure to include flow-charts that cover: Overall program flow (use subprocess blocks to indicate where user-defined functions are called) Function that randomly generates birthdays - - Function that finds birthday matchesarrow_forwardPython code please. With in 10 min.arrow_forward
- Lab Activity 8: Functions Objectives: The objective of this Lab Assignment is to use functions. As you have learned already, the best approach to solve a problem is to break it down into individual steps. Do not forget about what you have previously learned and seen. This assignment will be asking you to use the knowledge you have acquired since the beginning of the semester. PART 1: Percentage of amino acid residues. Write a function that takes two arguments-a protein sequence and an amino acid residue code - and returns the percentage of the protein that the amino acid makes up. Test your function on the following examples: Sequence MSRSLLLRFLLFLLLLPPLP MSRSLLLRFLLFLLLLPPLP maralllrfllfllllpplp MSRSLLLRFLLFLLLLPPLP Amino acid residue M R L Yarrow_forwardProgramarrow_forwardThe Issue: You have a function that accepts a variety of parameters. It is impractical to provide them as traditional parameters. So, what are you going to do?arrow_forward
- Local declarations are those that are kept in the memory of the computer; but, how exactly are they kept in memory? If reaching one's objective can be done without making use of local declarations, then doing so is a waste of time. Why bother using value parameters when you can just use references as your arguments in any function? How crucial are value parameters when it comes to the processing of programmed data?arrow_forwardWhat benefits can you get from using a function?arrow_forwardFunction #2: largest Parameters: num1 - a floating point number being compared against num2 and num3 num2 - a floating point number being compared against num1 and num3 num3 - a floating point number being compared against num1 and num2 Description: Write a function that takes in three numbers as parameters and prints out the largest of the three. If two or all of the numbers are equal, or even all three, then just print the value once. Test Cases: >>>largest(433.1, 2340.32, 12323.7) 12323.7 >>>largest(12.0, 32.1, 32.1) 32.1 >>>largest(23.44, 23.44, 23.44) 23.44arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning