Download as pdf
Download as pdf
You are on page 1of 3
Woite a program to compute the monthly bill o be paid according to the given conditions Calls made Rate Up to 100 calls No charge For the next 100 calls 90 paise per call For the next 200 calls 80 paise per call ‘More than 400 calls 70 paise per call However every customer has to pay Rs. 180 per month as monthly rent for availing the service Question 5. Define a class Student takes in the name, Roll No. and the total marks of five subjects of 20 students Each student Is assigned a stream based on the following criteria: Average marks Stream 90 and above Science with Computers 80 - 89 Science without Computers 70 - 79 Commerce with Maths 60 - 69 Commerce without Maths. write a program to declare the class ‘Student’ and calculate the average of every student and the stream assigned to them. Display the result in the format given below: Name Roll No. Total Marks Average Stream [151 Question 8. A Credit card company allows a limit to spend %15000 to its clients. It also offers a cash back facility according the table shown below. Input the amount spent by the use and display the cash back amount he is entitled to. Use minimum number of conditions to solve the problem. Amount (in €) Cash Back (in %) First 1000 100 Next 2000 200 + 2% of amount exceeding 1000 Next 4000 400 + 4% of amount exceeding 3000 Next 8000 800 + 8% of amount exceeding 8000 Write a program to declare the class ‘Credit’ that takes in the name of the client and the amount spend by him. Calculate the cash back amount and print it along with all the other details, Question 6. A hotel is giving seasonal discount on the total amount to be paid by the parson staying at the time of check out. The charges for one day stay is 7850.0 per room. The discount will be given as per the following criteria: Number of days stayed Upte 5 days > Sdays and <= 10 days > 10 days and <= 20 days More than 20 days Discount on total amount 10% 15% 20% 25% Write a program to input name of guest, total number of days stayed in the hotel Calculate the total amount to be paid and discount amount. Find the net balance to be paid excluding the discount. Print the bill including all the data Question 6. (5) An airlines announces discount on tickets depen: the followin: \g upon destination chosen by the passenger from Destin; Rate of ticket (per person) America Rs. 50000.0 Singapore Rs. 20000.0 Japan Rs. 40000.0 Thailand Rs. 30000.0 The discount will be given as per the given criteria: Ticket Amount Discount on Total amount Above Rs. 200000 25% Rs. 150001 to Rs. 200000 20% Rs, 100001 to Rs. 150000 15% Less than Rs. 100000 10% Write a Java program to input name of the passenger/group head (in case of more than 1 passengers), number of passengers and destination code vi Japan, and T or t for Thailand. : A or a for America, or s for Singapore, J or j for Calculate the total ticket amount and discount amount. Find the net balance to be paid excluding the discount. Print name, number of passengers, destination code, discount and total ticket amount to be paid. calculate() - to calculate bill for a customer according to given conditions kilometers travelled(km) Rate/km 1km Rs 25 l18 km Rs 25 display()- To display the details in the following format Q. 5. A wholeseller offers discount to his retailers according to the following tariff: Goods Worth Discount Upto Rs. 5000 5% Greater than 5000 and upto 10000/- 10% Greater than 10000 and upto 20000 15% Greater than 20000/- 20% Write a program to accept the total sales and calculate the discount for purchasing goods. Program to display the output as shown below: Amount a Rs. 7500 Discount offered : 10% Discount Amount : Rs. 750 Amount Payable : Rs. 6750 void computer()— to compute the rental charge. The rent for a mobike is charged on the following basis: Fisst five days 500 per day. Next five days 3400 per day. Rest ofthe days © 200 per day. void display() — to display the details in the following format: BikeNo. PhoneNo. Name No. of days (iii) void calculate() - _ Tocalculate the price after discount. Discounts calculated based on the following criteria Price Discount Less than or equal to 1000 2%of price More than & 1000 and less than or equal to 3000 10% of price More than % 3000 15% of price (iv) void display) - To display the name and price of the book after discount.

You might also like