Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop the inheritance diagram and then write a C++ program as explained below. You will be using classes and single inheritance, and appropriate member functions,

Develop the inheritance diagram and then write a C++ program as explained below. You will be using classes and single inheritance, and appropriate member functions, constructors, destructors, etc. to handle the tasks outlined below.

The program declares two classes with base/derived relationship and contain their own data members in the private access region of each class and their own member functions in the public access region.

The base class is named Computer and will contain the following data members (in the private access region):

Manufacturer - Manufacturer

Price - Price

The derived class is named Laptop and will contain the following data members (in the private access region):

Serial Number - Serial Number of the laptop

Warranty - Laptop warranty period (in years)

After the declaration of the classes, and their member functions, declare two objects of the Labtop class named c1 and c2 in main(). Initialize c1 via the Laptop class default constructor, using specifications for the first laptop of your choice. Prompt the user to provide the necessary data for the c2. The overloaded constructor for the Laptop class will be used initially for the second set of data. Your program will then display the information about the Laptops c1 and c2 in a tabulated form as shown below. You will need to define and implement all of the needed accessor and mutator member functions. The member functions will allow you to access the data members and modify them. No global functions to be used in this assignment.

c1 c2

Manufacturer

Price

Serial Number

Warranty

You will select the types of data for the two classes and must be documented clearly in your code.

Grading:

Inheritance Diagram 10 points

Choice of data selected 10 points

Documentation 10 points

Proper development of classes

and member functions 10 points

Program completeness 50 points, this includes program correctness, efficient programming, using right constructs for the solution, and proper use of coding as emphasized in class

Sample correct outputs 10 points

Notes:(please read very carefully)

1. Make sure your media is VIRUS FREE!(grade of 0 will be given for infected media). Use Technology lab PCs for the test.

2. Comment your program.

3. Use meaningful prompts.

4. Provide a brief description of the problem being solved.

5. Be sure to include a header file at the beginning of your program as shown in the course syllabus and sample folder..

6. NO global declarations allowed, except for the function prototypes.

7. Use classes, member functions, and strings.

8. Full member -function prototyping is required. Member functions must have their purposes fully explained.

8A. No member function should be defined within a class (i.e., no body of a function should be seen inside any class)

9. Make sure to use constructor(s) and destructors for all classes. Some classes may have more than one constructor.

10. Parameter passing to functions will be by address, and return value from functions will be as specified in the member function prototypes.

10a. At the due date, submit your H8 containing the components of the program specified in the guidelines. You need to include inheritance diagram, the list of your .cpp file, and the sample run of the program in the Word document. The source files for H8.cpp and all related files (.cpp and header files) and the Visio file H8.vsdx will be uploaded as well. Unrelated files should not be present when you upload them to the Blackboard. Homework must be uploaded to the Blackboard by 9 PM of the due date and late homework will not be accepted.

10. Use Microsoft Visual Studio Enterprise 2015 compiler using default compiler settings.

11. Use Microsoft Visio 2013 to develop your flowchart.

12. Adherence to the ANSI C++ required.

13. Do not use and in this assignment and all other assignments.

14. Do not use any #define in your program until the time that is required for class declaration header files.

15. No goto statements allowed in any program that you develop in this course.

16. Non-compliance with these notes will cost you points.

17. No collaboration on this assignment and all other assignments allowed. If you violate this policy, your grade for the course will be F.

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

Students also viewed these Databases questions

Question

Calculate the pH of a 0.36 M CH3COONa solution.

Answered: 1 week ago