Plan the logic for an airport services company program to determine service fees
ID: 3571228 • Letter: P
Question
Plan the logic for an airport services company program to determine service fees. The program prompts the user for their name and the type of service needed—parking or shuttle. Depending on the service type, the program gets additional information from the user and then calls one of the methods described below, to determine their fee, and then displays the user’s name, the service type and the fee. The methods are:
a) calculateParkingFee method
i) requires to be passed information (“Y” or “N”) that indicates whether the user is a member of the company’s frequent parker program, and the number of days of parking required
ii) if the user is a member, they receive a 10% discount on the regular parking fee of $12 per day
iii) the method returns the total parking fee
b) calculateShuttleFee method
i) requires to be passed the number of passengers and the total number of bags being brought by the passengers
ii) determines the shuttle fee as follows:
(1) a base fee of $29 per passenger
(2) the base fee includes one free bag per passenger; any additional bags are charged a fee of $2 each
iii) the method returns the total shuttle fee
Here is an example of how he likes methods to be done! This is very confusing for me! I really REALLY need the help on this, it's an EMERGENCY.
Chapter 9 Examples Programming Exercise 2, page 421 Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills, in other words, the method calculates the number of 20s, 10s, 5s, and ls needed. Answer: This is the only variable used in the main program. Therefore, it is declared here. All other variables are used only by individual methods start those variables are declared there, locally in those methods. Declarations num amount Entered num QUIT 0 output Welcome to the Bill Breaker!" output This program will accept a dollar amount as input and "r display a breakdown of the amount into the fewest "possible smaller bills. amount Entered input DollarAmount Call the inputDollarAmount method. It wi get a dollar amount from the user and return that to us, store that dollar amount in the amount Entered variable. while amountEntered QUIT dollarConversion (amount Entered) amount Entered input Dollar Amount end while stop The method's return type, i.e., what type of data this method will return to whoever calls it. Name of the method num inputDollarAmount Declarations num dollars Declare local variables output Enter a dollar amount or QUIT to quit" input dollars return dollars The method's return type, i.e., this method returns nothing, so, its return type is void. The method's name void dol Conversion (num amount) The method's parameter list. This method has only one parameter Declarations the parameter's name is amount, its data type is num.Explanation / Answer
calculateParkingFee method( char n,int no,int fee)
{ if(strcmp(n,Y)==0)
{int tot=fee-12;
return tot;
}
}