Create a customer object and make sure it has values for all

Assignment Help JAVA Programming
Reference no: EM132077778

Answer the following question :

1) Define Customer.java according to the following class diagram and information.

Customer

-customerID: int

- firstName: String

-lastName: String

+ Customer()

+ Customer(int, String, String)

+ getCustomerID(): int

+ setCustomerID(int)

+ getFirstName(): String

+ setFirstName(String)

+ getLastName(): String

+ setLastName(String)

+ toString(): String

• the first constructor doesn't have any parameter and sets each of three instance variables to 0, null, and null, respectively;

• the second constructor uses three passed-in parameters to update values of the instance variables. • toString() method return a String value for all instance variables of a Customer object. A sample return value of toString() for a Customer object is as follows. Customer ID: 4838156\nName: John Smith

2) Define Account.java according to the following class diagram and information.

Account

______________________________

-accountNo: int

- customer: Customer

- balance: double

______________________________

+ Account(int, Customer, double)

+ getAccountNo(): int

+ setAccountNo(int)

+ getCustomer(): Customer

+ setCustomer(Customer)

+ getBalance(): double

+ setBalance(double)

+ deposit(double)

+ withdraw(double): boolean

+ toString(): String

• the constructor uses three parameters to update values for accountNo, customer, and balance.

• deposit(double) uses value from the input parameter to update the existing balance (by adding the parameter's amount to the existing balance).

• withdraw(double) reduces the current balance by the value of the input parameter. Return true if the current balance is not less than the parameter's value and then reduces the existing balance accordingly; otherwise, return false and do not update the existing balance.

• toString() returns a String for all instance variable values of an Account object. A sample return value of toString() for an Order object is as follows.

Customer ID: 4838156\nName: John Smith\nAccount Number: 5820389\nBalance: $5,280.05

3) Define AccountApp.java according to following requirements to interact with the Customer and Account classes.

• create a Customer object and make sure it has values for all its instance variables. Tip: you don't need to use Scanner to collect input from keyboard. For simplicity, you can use hard-code values for parameters.

• call toString() method of Customer class and use system.out.println() to print out the returned value.

• create an Account object and make sure it has values for all its instance variables. Similarly, you can use hard-code parameter values.

• call deposit and withdraw methods of the Account object. Similarly, you can use hard-code parameter values as deposit and withdrawal amounts.

• call toString() method of Account class and use system.out.println() to print out the returned value.

4) In the following class diagram, Account was defined in the above step 2). Now define SavingAccount.java in which (8 points)

• the constructor uses four passed-in parameters to update values of all instance variables.

• toString() returns a String for all instance variable values of an SavingAccount object. A sample return value of toString() for an SavingAccount object is as follows. The interest rate has three decimal places. Customer ID: 4838156\nName: John Smith\nAccount Number: 5820389\nBalance: $5,280.05\Interest Rate: 2.750% Account

- accountNo: int

- customer: Customer

- balance: double

+ Account(int, Customer, double)

+ getAccountNo(): int + setAccountNo(int)

+ getCustomer(): Customer

+ setCustomer(Customer)

+ getBalance(): double

+ setBalance(double)

+ deposit(double)

+ withdraw(double): boolean

+ toString(): String

SavingAccount

- interestRate: double

+ SavingAccount (int, Customer, double, double)

+ getInterestRate(): double

+ setInterestRate(double)

+ toString(): String

Reference no: EM132077778

Questions Cloud

What is the maximum profit : How many pounds of each blend should she make to maximize profits? What is the maximum profit?
Write a method to recursively computer ackermann function : Write a method to recursively computer the Ackermann function. Note that the Ackermann function grows extremely quickly for even small values of m and n.
Find the first derivative of f(x) : Let f(x)=e^e^x. Answer the following questions. 1. Find the first derivative of f(x).
Write a program that reads the data from the file produced : Write a program that reads the data from the file produced in Part A, and produces a report showing the courses taught .
Create a customer object and make sure it has values for all : Define Customer.java according to the following class diagram and information. Define Account.java according to the following class diagram.
Find out the prime numbers from a given range of numbers : Write a program called PRIME2 to find out the prime numbers from a given range of numbers (for ex: from 1 to 50) using for loop.
Validate correct program operation by examining the update : The program should begin by loading the contents of four signed integer operands (A, B, C, and D) from memory into registers.
Satisfy the hypotheses of the mean value theorem : For what values of? a, m, and b does the function? f(x) satisfy the hypotheses of the mean value theorem on the interval [0,4]??
Display the gross pay with a dollar sign using visual basic : Display the gross pay with a dollar sign and two decimal places. Save the solution and then start the application.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd