Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Langauge: Java Use java objected orientated programming. Create a program that creates custom set of phone based on phone properties..This is menu program that creates

Langauge: Java

Use java objected orientated programming. Create a program that creates custom set of phone based on phone properties..This is menu program that creates different price based on user choices. Each phone properties have two different options, case 1 and case 2. Follow the UML diagram below, dont change or add to the class. Dont use arraylist, map, hashcode, or string buffer. HINT: Use case options and while loop for the menu to repeat, use System.exit(0) for exit program, use null for delete current phone, you can use printf for fomatting. Make sure your displayReceipt and getTotalCost works. Use scanner class for user input.

The Phone Class

private Chip chip;

private Camera camera;

private Screen screen;

public Phone (Chip chip, Camera camera, Screen screen)

public Chip getChip()

public Camera camera()

public Screen screen()

public double getTotalCost()

public void displayReceipt()

The Chip class

Private String name;

Private price;

public Phone (name, price)

public String getName()

public double getPrice()

public String toString() -----creates string reprerssentation of object

Case 1:

Name: i7

Price: $245.76

Case 2:

Name: Amd

Price: $56.77

The Camera class

Private String name;

Private price;

public Camera(name, length, price)

public String getName()

public double getPrice()

publci String toString();

Case 1:

Name: Vivitar

Price: $59.76

Case 2:

Name: Cannon

Price: $100.77

The Screen class

Private String name;

Private price;

public Screen(name, length, price)

public String getName()

public double getPrice()

public String toString() --------create string representation of object

Case 1:

Name: Big eon

Price: $67.99

Case 2:

Name: Small pix

Price: $17.99

HOW it should look on console:

******** Main********

1.Choose Chip

2. Choose camera

3. Choose screen

4. Delete Current phone

5. Display receipt

6. Exit program

*********************

(if you pick case 1 from chip, case 1 from camera, case 2 from screen, this is how receipt would look like)

Please choose an option to build phone: 5

*****Receipt****

Vivitar

Price:.$59.76

Small pix

Price..$17.99

i7

Price $245.76

Total Cost: $323.51

******** Main********

1. Choose Chip

2. Choose camera

3. Choose screen

4. Delete Current phone

5. Display receipt

6. Exit program

*********************

Please choose an option to build phone: 6

Program existed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

=+3 In what ways can an MNE improve or change its approach to IHRM?

Answered: 1 week ago