Create a class named cellphone which will represent the code

Assignment Help Computer Engineering
Reference no: EM131990615

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.

Reference no: EM131990615

Questions Cloud

Create a classroom layout for an inclusive general education : Identify why the Brown v. Board of Education case was so important to the development of current services to students with disabilities?
Summarize effective methods to communicate : Summarize effective methods to communicate with all stakeholders, considering their individual interests, priorities.
How you would like to involve the department heads : Briefly outline the steps you may use to facilitate this change process. Describe how you would like to involve the department heads with this process.
Dividend-discount model predict high line stock should? sell : Its dividend payout ratio remains? constant, for what price does the? dividend-discount model predict High line stock should? sell?
Create a class named cellphone which will represent the code : Create a class named CellPhone which will represent the code to manage cell phone's operating system. Split your declaration and definition into a header file.
Maximum potential profit from this option strategy : What is the maximum potential loss and maximum potential profit from this option strategy?
Define differences between internal and external consultants : Your HRD team is not familiar or comfortable with the role of consultant. Discuss with them the roles, functions, and responsibilities of consultants.
What was the price of the red royal food share : what was the price of the Red Royal Food share when Goran bought it?
Dividend-discount model predict highline stock : what price does the? dividend-discount model predict Highline stock should? sell?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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