Semester: Spring 2018
Total Marks: 20
Due Date: July 26, 2018
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/ from other students).
Software allowed to develop Assignment
– Dev C++
Student will be able to analyze and implement the concepts of:
- Classes and Objects
- Constructors in classes
- Getter and Setter functions in classes
You have to submit only.cpp file on the Assignments interface of CS201 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.
👉 Recommended: ENG201 GDB SOLUTION Spring 2018
Write a C++ program that will create a class named Laptop.
This class will have 4 data members
Also write getter and setter functions for each data member of the class. For example:
You are required to write a default and a parameterized constructor for this 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 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.
You must use setter functions inside the parameterized constructor for initialization of the data members with the values passed by arguments. Also you have to use getter functions in the main() to show the values of data members. Marks will be deducted if any of these requirements is not fulfilled.
CS201 Assignment_3 Solution Spring_2018 ————————— Download