Ask Computer Engineering Expert

Assignment

Part 1

Create a class named CellPhone which will represent the code to manage a cell phone's operating system. Split your declaration and definition into a header (.h) file and an implementation file (.cpp). It must meet the requirements specified below:

The private member variables needed are:

• An array of structs of the type Contact (you must create this struct yourself) named contacts. Each struct should be able to store a contact's First Name, Last Name, home contact
number and mobile contact number. Your class should be able to store a maximum of 200 contacts.

• A variable of type string named display that will contain the text that the cell phone's display will show at any time.

• A variable of type bool named on that indicates whether the cell phone is turned on or not.

• A variable of type string named currentCall that contains the contact number of a currently active call.

• A variable of type bool named callActive that indicates whether a call is currently active or not.

The following private member functions are needed:

• A function named contactCount that returns the number of contacts currently stored in the contacts array.

• A function named showOutput that outputs the content of the display variable to the screen.

• A constructor function that sets the class variable on to true, and sets display to the message "Welcome to the CIS3100 Operating System. Your virtual cell phone is now on."

The following public member functions are needed:

• A function named newContact that accepts a new contact's First Name, Last Name, home contact number and mobile contact number as parameters and stores the new contact in the contacts array. This function should first check to see if there is any room to store new contacts and return false if there is not.

• A function named dialContact that accepts an existing contact's First Name & Last Name, searches the contacts array for this contact, asks the user whether they'd like to dial the home contact number or the mobile contact number, then stores the user choice in the currentCall variable. The contact number chosen should also be stored in the display variable.

• A function named displayContactNumberInformation that accepts an existing contact's home contact number or their mobile contact number as a parameter and retrieves the contact from the contacts array. After retrieving the contact, it should store the contact information in the display variable in the following format:

First Name: Contact's First Name

Last Name: Contact's Last Name

*Replace the above content in bold with the respective text from the contact*

• A function named powerDown that sets the cell phone's status to offand sets the display variable to "This device has been powered off"

Please note that in the class above, anytime the display variable changes, the function showOutput should be invoked/called in order to show the new content on the screen.

Part 2

In a main.cpp file, make use of the class you create in Part 1 by including the class header file.

This main part of your program should perform the following steps:

1. Display a welcome message to the user - "Hello User. Would you like to turn on this cell phone?" If the user says yes, initiate your CellPhone class, and proceed to step 2. If the user says no, end the program with "Thank you. Please restart the program when you wish to use the device".

2. Display a menu to the user with the following options:

A. Turn offCell Phone

B. Add A New Contact

C. Display Contact Information

D. Dial Contact

You should accept a choice from the user and perform the the corresponding function listed below

A - Turn offthe cell phone using the powerDown function of the CellPhone class

B - Accept a new contact by requesting the proper information from the user and invoking the newContact function

C- Display the information for an existing contact by requesting the number from the user and invoking the displayContactNumberInformation function.

D - Dial a contact by accepting the contact First Name and Last Name from the user and invoking the dialContact function.

The menu should be recurring on screen until the user chooses to turn offthe cell phone, in which case the program ends.

CODE ORGANIZATION

Consider carefully how you structure/organize this part of the program's code.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92828266
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As