Question: Write a method with the following header double getDiscount Price(char status, double price) The method takes as parameters a character indicating whether a person is

Write a method with the following header double getDiscount Price(char status, double price) The method takes as parameters a character indicating whether a person is a student or not ('y for student. 'n for non-student), and the price of a cinema ticket. The method returns the price of the ticket after discount as follows: . if the person is a student, the discount is 50%. Hence, the new price is equal to the initial price * 0.5 if the person is not a student, the person does not receive any discount b) Write a test program that prompts the user to enter the information for n persons: a character and a price. The program then computes the prices after discount for each person by invoking the method above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
