Computer Science, asked by aseemalatheef, 11 months ago

Create a class Movie with the following private member variables. String movieName String movieCategory int ticketCost Include appropriate getters and setters method in Movie class. Write the following method in the Movie class: public int calculateTicketCost(String circle)--This method should take circle as argument. Return 0 when any one of the following condition met : If circle is gold and movie category is 2D set ticket cost Rs.300 If circle is gold and movie category is 3D set ticket cost Rs.500 If circle is silver and movie category is 2D set ticket cost Rs.250 If circle is silver and movie category is 3D set ticket cost Rs.450 Return -1 if category is invalid. Return -2 if circle is invalid and -3 if both are invalid. Create a Main class to get the input and to display the output Get the input for Movie using the method - public static Movie getMovieDetails(). Invoke this method from the main method and store the Movie object. Get the input for circle using the method - public static String getCircle(). Invoke this method from the main method and store the circle value. Next, invoke the calculateTicketCost method in Movie by passing this circle and calculate the ticket cost and set to the ticketCost attribute and print the output. If the return from calculateTicketCost is zero, the output should be be "The ticket cost is=". If it returns -1, the output should be "Sorry there is no type of category in theater." If the return is -2, the output should be "Sorry!!! Circle is Invalid." If the return is -3, the output should be "Sorry!!! Both circle and category are Invalid."

Answers

Answered by devuashiwal111
0

vdhvdhbfhn ngtjxdtbji hdfhvh

Similar questions