We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Assignment No. 05
Semester: Spring 2010

CS201: Introduction to Programming

 

Total Marks: 20

 

Due Date:15/07/2010

 

Instructions

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:

 

§         The assignment is submitted after due date.

§         The submitted assignment does not open or file is corrupt.

§         All types of plagiarism are strictly prohibited.

 

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. If you will submit code in .doc (Word document) you will get zero marks.

 

Objective

The objective of this assignment is to provide hands on experience of using

 

§         Basic concepts of C++ language and Programming

§         Functions of C/c++ language

§         Classes in c/c++ language

§         Operator overloading in C/C++

 

Guidelines

§         Code should be properly aligned and well commented.

§         Follow c/c++ rules while writing variables names, function names etc

§         Use only dev-C++ for this assignment.

 

 

Assignment

 

 

Problem Statement: Multiplication of two objects of same class

·        You are required to write a class. Class should have an array of 10 integers as its private data member.

Class should have

  • A default constructor which will initialize all array elements with zero.
  • Getter and setter functions
  • An operator overloading function which will overload * operator for this class.

 

  • You are required to create three objects of the same class.
  • You must assign values to first and second objects through setter functions. You can either take input arrays from user or use hard coded values.
  • Display the values of first and second object through getter functions.
  • Multiply both objects and store the result of multiplication in third object.
  • Multiplication means the 1st element of member array of object1 should be multiplied by 1st element of member array of object2. Similarly, 2nd element should be multiplied with 2nd and so on. In the end, display the result stored in third object.
  • Your program should support the statement like a = b * c, where a, b and c are objects of the same class.

 

 -------------------------------------------------------------------------

Sample output:

Object 1 :

1  

2   

3

4      

5   

6   

7   

8    

9   

10   

 

Object 2 :

10

9

8

7

6

5

4

3

2

1

 

Multiplication of both objects :

10

18

24

28

30

30

28

24

18

10

 

---------------------------------------------------------------------------

Deadline

Your assignment must be uploaded/submitted on or before 15-07-2010

 Please Discuss Here about this assignmnet . Thanks

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 188

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

ye output main answer show nai karta

RSS

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.