Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java and with the testing plz Problem 1: An electronics Shop wants to keep track of its inventory. It needs to save information about

image text in transcribed in java
and with the testing plz
Problem 1: An electronics Shop wants to keep track of its inventory. It needs to save information about each cell phone it has. For each cell phone, it needs to know its brand, production year, memory size, number of cameras and price 1. Create a Java class "Cellphone" that has the following attributes: (brand, production year, memory size, number of cameras and price). Give all attributes a suitable type and a private visibility. 2. Write two constructors for the class CellPhone: one without parameters, and another with parameters to fill all its attributes. 3. Write an accessor and a mutator method for each attribute. Make all methods public. 4. Write a "toString()" method to display the attributes of the class "Cellphone" Testing: 5. Create a new Java Main class "TestElectronics" to test your "Cellphone" class. The class should have a main method to do the following: a. Create an object of type "Cell Phone using the constructor without parameters b. Set the brand of the cell phone to "Android", production year to "2020", memory size to 200, number of cameras to 3, and price to 2500.00 using the mutator methods. c. Display the cell phone object using the toString() method. d. Create another object of type "Cellphone" using the constructor with parameters, setting the and give it appropriate values using the initialization constructor. e. Display the cell phone using the toString() method. f. Open a file called "electronics.txt" that has all the information about the available cell phones in the store. The file will look like this: Android 2020 400 3 3450.00 Apple 2019 360 3 2350.00 Huawei 2020 380 2280.50 Android Then the main method should read the information about each cell phone from the input file, create an object of type "Cellphone" and initialize its attributes, then display this object using the toString() method 2 2 2019 350 2380.00 1 UAEU United Arab Emirates University UAEU College of Information Technology & Find and print the average price for all cellphones in the file. h. Find and print the number of cell phones that has 3 or more cameras

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

Step: 3

blur-text-image

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

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

90 Basic budgeting and accounting concepts.

Answered: 1 week ago