Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2: 1. Using the Cellphone class in Lab 3, add a static member to the class Cellphone called noOfCell Phones (int). Add a static

image text in transcribed

Exercise 2: 1. Using the Cellphone class in Lab 3, add a static member to the class Cellphone called noOfCell Phones (int). Add a static getter and setter to the class for the new attribute. Increment this attribute in each constructor of the class. 2. Add a Copy Constructor to the Cellphone class. 3. Develop a GUI for the class Cell Phone as shown below. 4. Create an array of Cellphones. Call it all Phones with size = 10. 5. The Add button should add another cell phone to the table by creating a new Cellphone Objects (Hint: Use the split() method of the String class). Add the cellphone object to the all allPhones array. 6. The Load button opens the input file, reads line by line, creates an object of type CellPhone, add it to the allPhones array, then updates the table. 7. The Copy button should copy the selected cell phone and make a new one using the copy constructor. The new phone should be added to the allPhones array. 8. The noOfCellphones should be updated after each creation of a Cellphone object and adding this phone to the table and the array. It should be the same as the allPhones array length. 9. The Save button should take all phones in the allPhone array, and save it to the output file using the toString() method of each phone. 10. You should handle any possible exception in your application and test it before you submit. Design Preview (CellPhoneFrame] New Phone Nokia; 2012;100; 1; 10001 Add Input Fle: Electronics.txt Load Output fie: Electronics.out Save Total Number Of Cell Phones 1 Copy Cameras Brand Nokia Year 2012 Memory 100 Price 1000.0 1 Stabus OK Design Preview CellphoneFrame] New Phone Nokia; 2012;100; 1:1000 Add Input File: Electronics.but Load Output File: Electronics.out Save Total Number of Cell Phones 6 Copy Cameras Brand Nokia Android Phone Huawie Android Phone Year 2012 2020 2019 2018 2020 2019 Memory 100 400 360 380 350 360 3 3 2 2 3 Price 1000.0 3000.0 2000.0 2500.0 2200.0 2000.0 Status OK

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

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

7. Define cultural space.

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago