Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can we get a solution to this project please? Questions (50 points): 1. Given the following function header, compose a C++ programming statement that calls

can we get a solution to this project please?

Questions (50 points):

1. Given the following function header, compose a C++ programming statement that calls the function, passing the value 15 as an argument and assigning its return value to a variable named result.

int doubleIt(int value)

2. Given the following function header:

double harmonic(int a, int b, int c)

and the following function call:

double harmonicMean = harmonic(10, 25, 34);

What will be the value of the parameter variable named c after the call is executed?

3. Compose a C++ function named timesSeven. The function should accept an integer (int) argument. When the function is called, it should display the product of the argument multiplied times seven (7).

4. Compose a C++ function named getSpeed that uses a reference parameter variable named speed to accept an integer argument. The function should prompt the user to enter a number in the range of 20 through 70. Set the parameter variable to zero if the user enters a number outside the range of 20 through 70.

5. Given the following prototype statement for a function that determines the minimum value between two given integer values:

int minimum(int a, int b);

compose the prototype statement for an overloaded function that uses the same function name but determines the minimum value between two given double values.

Programming Exercise (50 points):

Write a C++ console application that calculates and displays the charges for multiple customers using a parking garage. The parking garage charges a minimum fee of $3.00 to park for up to three hours. The garage charges an additional $0.85 per hour or fraction of an hour for parking over three hours. The maximum charge for any given 24-hour period is $20.00. You may assume that no car parks for longer than 24 hours at a time.

Your program will use a function named calculateCharges to determine the charges based on the amount of time the car was parked. Your program will prompt the user for the number of hours parked in the garage. It will then display the parking charges for that transaction. Keep track of the number of transactions as well as accumulating the number of hours parked and the parking charges. Your program will execute repeatedly until the user enters a value for the number of hours parked that is less than or equal to zero. Your program will then display the number of transactions and totals for the number of hours parked and the parking charges.

Submit two files. A word processing file with your answers to the five Questions and a compressed file containing your solution to the Programming Exercise. Remember to submit them both at the same time.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

Students also viewed these Databases questions

Question

Challenges Facing Todays Organizations?

Answered: 1 week ago