Sale!

CSC 110 Assignment 3 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (11 votes)
  1. Write a program that computes the tax and tip on a restaurant bill. The program should ask the user to enter the charge of the meal. The tip should be 15% of the total after the tax. Display the meal charge, tax amount, tip amount, and total bill on the screen.
  2. The following algorithm describes how to extract the dollars and cents from a price given as a double floating-point value. For example, a price 2.95 yields values 2 and 95 for the dollars and cents.
  • Assign the price to an integer variable dollars.
  • Multiply the difference price –dollars by 100 and add 0.5.
  • Assign the results to an integer variable cents.

 

Implement the algorithm into a Java program. Read a price and print the dollars and cents.

  1. A video club wants to reward its best members with a discount based on the member’s number of movie rentals and the number of new members referred by the member. The discount is in percent and is equal to the sum of the rentals and the referrals, but it cannot exceed 75 percent. (Hint: Math.min) Write a program to calculate the value of the discount.

Here is a sample run:

Enter the number of movie rentals: 56

Enter the number of members referred to the video club: 3

The discount is equal to 59%.