create program on eclips java

profileGhost90
scan2.pdf

COSC 210 - Fundamentals of Computer Science Assignment 1 Problem Statement

Create three classes: Customer, Video, and Invoice that might be used in a video rental store application. The Customer class represents a customer. It should have 5 pieces of information (i.e. instance variables) including customer name (as String), customer address as four separate instance fields for street (as String), city (as String), and zip code (as String). The Video represents a video being rented. It should have 4 pieces in information including video name (as String), year (as an integer), copy number (as integer), and daily rental rate (as double). An Invoice represents a rental of a video to a given customer. In includes 4 pieces of including the Customer renting the video, the Video being rented, date rented (use java.util.Date), and the number of days rented (as an integer).

For your Customer class provide a constructor that takes the customer name and address as parameters. Provide getter and setter methods for all instance variables.

For you Video class, provide a constructor that takes video name, year, copy number and daily rate as parameters. Provide getter methods for all instance variables, but only setter methods for the daily rate.

For the Invoice class, provide a constructor that takes a Customer, Video, and days rented as parameters and initializes the a field to today's date (use new Date/l). Provide getter methods forall instance variables. Provide a getSubtotal method that returns the calculated value that is the number of days rented times the daily rate of the video, a getTax method which returns a calculated by multiplying the subtotal by 6%, and a getTotal method which returns the subtotal plus tax. Lastly, provide a printInvoice method that prints a complete invoice (i.e. all customer information, video being rented, and calculated totals):

I N V 0 ICE

Date: 09/14/2015

To: Bill Jones 99 Main Street Any town, PA 15000

- \ e.J io 10

Renting:

Matrix (1989), copy 3 at: Number of days: Subtotal: Tax at 6%: Total:

$ ~ 1.99 / day

3 $ $ $

5.97 .36

6.33