AssignmentView more random threads:
- answer
- Plz Help Me In My Assignment Fall 2011_MGT101_1.
- Assignment No. 1 CS101 Need Solution ????
- CS201_3rd_Assignment
- FIN622 Corporate Finance Assignment No.1 Fall Semester 2012...
- STA301 First Assignment idea solution October, fall 2012
- ACC501 Business Finance-Assignment NO 2 Spring 2014 Due...
- CS201_4rth_Assignment_Fall2011
- All Past Assignments with Solutions Of MGT502...
- BUSINESS FINANCE (ACC501) ASSIGNMENT NO. 01 Solution...
Write a C++ program that will create a class named Computer. This class will have 4 data members
1. Vendor
2. CPU
3. Hard disk
4. RAM
You are required to write a default and a parameterized constructor for this class. Also write getter and setter functions for each data member of the class.
In the default constructor, you will initialize all the data members with default values. The message “Default constructor called…” should be displayed whenever an object is created using default constructor.
In parameterized constructor, you will initialize all the data members with the values passed to it as arguments. You are required to use setter functions inside parameterized constructor to initialize the data members. The message “Parameterized constructor called…” should be displayed whenever an object is created with parameterized constructor.
In the main() function, create 2 objects (1 using default and 1 using parameterized constructor) and display the values of data members of both objects using getter functions.
Sample output for the program is shown below:
Sponsored Links