2023 This assignment has two parts The first part requires you to create a class and | Assignment Collections

Computer Science 2023 C++ Cellphone Assignment

2023 This assignment has two parts The first part requires you to create a class and | Assignment Collections

 

This assignment has two parts. The first part requires you to create a class and implement it. The second part requires you to use that class in a specified program. Any errors on the first part will not be carried over in grading to the second part. 

You should have 3 files (CellPhone.h, CellPhone.cpp & main.cpp) into a Zip file.

Part 1

96 points (Allocation of points is shown in brackets below)

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). (5) 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. (14)

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

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

(3)

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

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

The following private member functions are needed:

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

contacts array. (7)

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

(4)

• 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.” (5)

The following public member functions are needed:

2

• 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. (10)

• 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. (14)

• 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* (15)

• A function named powerDown that sets the cell phone’s status to off and sets the display

variable to “This device has been powered off” (5)

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. (5)

Part 2

30 Points (Allocation of points is shown in brackets below)

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”. (5)

2. Display a menu to the user with the following options: A. Turn off Cell 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 off the 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 off the cell phone, in which case the program ends. (15)

CODE ORGANIZATION – 10

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

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational