SUPERSTARWEBTECH

There is no elevator to success. You have to take the stairs. Take your first steps with SSWT!

CS201 Assignment no 3 Solution Spring 2018 Due Date: 26 July, 2018

CS201-Intro to Programming
Assignment No. 3

Semester: Spring 2018
Total Marks: 20
Due Date: July 26, 2018

CS201-Intro to Programming Assignment Instructions 

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

CS201-Intro to Programming Software Allowed

Software allowed to develop Assignment
– Dev C++

CS201-Intro to Programming Objectives 

Student will be able to analyze and implement the concepts of:

  • Classes and Objects
  • Constructors in classes
  • Getter and Setter functions in classes 
CS201-Intro to Programming Assignment Submission Instructions 

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

CS201-Intro to Programming Assignment no 3

Write a C++ program that will create a class named Laptop.
This class will have 4 data members

  • brand
  • processor
  • ram
  • hardDrive 

Also write getter and setter functions for each data member of the class. For example:
void setbrand(char[]);
void setCpu(char[]);
…………….etc
int getRam();
int getHD();
………………… etc
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.

CS201-Intro to Programming Assignment Sample Output

CS201-Intro to Programming ! Important Note !

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 Idea Video #Must Watch👀

CS201-Intro to Programming Assignment solution File ! Download !

  CS201 Assignment_3 Solution Spring_2018 ————————— Download

Author

Anam Afzal

Anam Afzal

Hi, I'm a Pakistani freelancer with a passion for helping businesses achieve their online goals through no-code solutions. I specialize in WordPress customization and ManyChat automation, and I'm always on the lookout for new ways to use technology to make businesses more efficient and successful. I'm also a big believer in the power of no-code tools to democratize technology and make it accessible to everyone. I'm passionate about sharing my knowledge and helping others learn how to use no-code tools to create their own websites, automate their workflows, and grow their businesses. If you're looking for a reliable and experienced no-code developer, I'm here to help. Please feel free to contact me to discuss your project requirements.
SHARE THIS POST