Display a welcome message to the user

Assignment Help Programming Languages
Reference no: EM131993205

Question: 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: (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). 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 o? and sets the display variable to "This device has been powered o?"

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: (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".

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

A. Turn o? 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 o? 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 o? the cell phone, in which case the program ends.

CODE ORGANIZATION - 10

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

Reference no: EM131993205

Questions Cloud

What is the total price you must pay for the bond : what is the total price you must pay for the bond? The last coupon date was July 01, 2016 and the next coupon date is December 31,2016.
How was enrique as a child : 1. How was Enrique as a child? How did he change as a teenager? Adult? Why did he change so much?
Consequences of unprotected sex : Are there countries, other than the United States, that are having success with health policies to address the issue of unprotected sex and sexually transmitted
Examples of nonverbal and verbal communication : Discuss cases and examples of nonverbal and verbal communication. How are they different? How are they similar?
Display a welcome message to the user : 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.
The benchmark price–sales ratio for the company : If the benchmark price–sales ratio for the company is 5, how much will you pay for the stock?
Difficult for a modern speaker of english : Why is it more difficult for a modern speaker of english to read and comprehend the english of Shakespeare (1500 CE) than for an Hebrew speaker
Converting design diagrams into program code : The students who have no expertise in object-oriented programming are required to validate their system design using interaction diagrams.
What is the reason that no writing system in existence : What is the reason that no writing system in existence, except for the IPA (which has not been adopted by any language)

Reviews

Write a Review

Programming Languages Questions & Answers

  How to produce javascript code

Using the prompt and alert functions, invite the user to input 5 marks (integers) in the range 0-100.

  Write a program which validates that the entry is a integer

Write a program which: Asks the user to enter a positive integer greater than or equal to 0, Validates that the entry is a positive integer and Outputs the digits in reverse order with a space separating the digits.

  Create multiple functions with the same name

Function overloading is a feature in many programming language, which means that you can create multiple functions with the same name but the parameters within the functions should be different.

  Determining smallest possible number people in parade

Group of people are arranging themselves for parade. Determine the smallest possible number people?

  Design a c# windows phone 8 application

Design and implement a C# Windows Phone 8 application based on the SoundBoard app in the Windows Phone 8 Development for Absolute Beginners textbook.

  Provide a brief history of the language

Provide a brief history of the language (1-2 slides) including standards if any. What need does this language fill that others do not and discuss the language in terms of the paradigms described in Chapters 1-5 of our textbook. Provide code sample..

  What is access control

What is access control? What is a data classification model? How is data classification different from a clearance leve?

  Use a while loop to calculate terms of summation

Write function called estimate_pi that uses this formula to calculate and return estimate of π. It must use a while loop to calculate terms of summation until last term is smaller than 1e-15.

  Determine the output displayed in the list box

Determine the output displayed in the list box by the lines of code

  Program to compute pearson correlation coefficient

Write down a program to compute Pearson correlation coefficient by using parallel loop templates from Intel Threading Building Blocks library (TBB).

  Pseudocode for linear search by using clrs3e style

Write pseudocode for linear search by using CLRS3e style used in, which scans through the sequence, looking for v.

  Write program to merge two files that contain polynomials

Write a program that merges two files that contain polynomials. To merge two files, the input files must be in sorted order.

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