<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS441 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Assignment No. 02<br />
SEMESTER Fall 2019<br />
CS441- Big Data Concepts	<br />
Total Marks: 20</p>
<p dir="auto">Due Date: 28/09/2019</p>
<p dir="auto">Please read the following instructions carefully before submitting assignment:<br />
It should be clear that your assignment will not get any credit if:</p>
<p dir="auto">o	Assignment is submitted after due date.<br />
o	Submitted assignment does not open or file is corrupt.<br />
o	Assignment is copied (From internet/students).</p>
<p dir="auto">Software allowed to develop Assignment</p>
<ul>
<li>Python editor</li>
</ul>
<p dir="auto">Objectives:<br />
To enable students to write, execute a program in Python. Moreover to familiarize students with  the concepts of:</p>
<p dir="auto">•	Classes and objects<br />
•	Constructor<br />
•	Object declaration<br />
•	Methods/functions calling</p>
<p dir="auto">Assignment Submission Instructions<br />
You have to submit <a href="http://only.py" target="_blank" rel="noopener noreferrer nofollow ugc">only.py</a> file on the Assignments interface of CS441 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.</p>
<p dir="auto">Lectures Covered: This assignment covers Weeks # 03 - 05<br />
Deadline<br />
Your assignment must be uploaded/submitted on or before 28/09/2019.</p>
<p dir="auto">Question statement:</p>
<p dir="auto">Write a Python program that will create a class named Product.</p>
<p dir="auto">This class will have 4 data members:</p>
<ol>
<li>Name</li>
<li>Brand</li>
<li>Price</li>
<li>Quantity</li>
</ol>
<p dir="auto">The Product class will have the following setter functions:</p>
<p dir="auto">setName (), which takes a single parameter<br />
setBrand(), which takes a single parameter<br />
setPrice(), which takes a single parameter<br />
setQuantity(), which takes a single parameter</p>
<p dir="auto">The Product class will have the following getter functions:<br />
getName()<br />
getBrand()<br />
getPrice()<br />
getQuantity()</p>
<p dir="auto">You are required to write a parameterized constructor for this class.</p>
<p dir="auto">In parameterized constructor, you will initialize all the data members with the values passed to it as an arguments. The message “Parameterized constructor called” should be displayed whenever an object is created with the parameterized constructor.</p>
<p dir="auto">Now, create an object by using the parameterized constructor and display the values of data members through calling getters functions.</p>
<p dir="auto">Then set the values of the data members by calling the setters functions and then display its values by calling getters functions.</p>
<p dir="auto">Sample Output:<br />
<img src="https://i.imgur.com/RUT8bno.png" alt="557f4778-6ab5-4dd1-b364-f463824e31e7-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">To solve this assignment, you need to install latest Python compiler or you can run (check) your code through online compiler at the following link:</p>
<p dir="auto"><a href="https://www.onlinegdb.com/online_python_compiler" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.onlinegdb.com/online_python_compiler</a><br />
=====================================Ended=======================================</p>
<p dir="auto">For any query about the assignment, contact at <a href="mailto:CS441@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">CS441@vu.edu.pk</a></p>
<p dir="auto">GOOD LUCK</p>
]]></description><link>https://community.secnto.com//topic/714/cs441-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:44:59 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/714.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Nov 2019 15:20:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS441 Assignment 2 Solution and Discussion on Tue, 21 Jan 2020 12:45:26 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Solution:</strong></p>
<pre><code>class Product:
    
    Name = "NULL"
    Brand= "NULL"
    Price= 0
    Quantity= 0

         
        
    def __init__(self, na, br, pr, qty):
        print
        print "--------------------------------"
        print "Pametarized Constructor called:"
        print "--------------------------------"
        self.Name = na
        self.Brand = br
        self.Price = pr
        self.Quantity=qty
        
              
    def setName(self, n):
        self.Name = n
        
    def setBrand(self, b):
        self.Brand=b
        
    def setPrice(self, p):
        self.Price=p
        
    def setQuantity(self, q):
        self.Quantity=q

        

    def getName(self):
        return self.Name
    
    def getBrand(self):
        return self.Brand

    def getPrice(self):
        return self.Price
    
    def getQuantity(self):
        return self.Quantity
    

P1= Product("Computer","DELL",48000,5)

print
print "Object values initialized through Constructor:"
print
print "Name: " , P1.getName()
print "Brand: ", P1.getBrand()
print "Price: ", P1.getPrice()
print "Quantity: ", P1.getQuantity()


P1.setName("Cloths")
P1.setBrand("Bonanza")
P1.setPrice(4500)
P1.setQuantity(10)
print
print "-------------------------------------------------"
print
print "Object values assigend thorugh setter functions:"

print
print "Name: " , P1.getName()
print "Brand: ", P1.getBrand()
print "Price: ", P1.getPrice()
print "Quantity: ", P1.getQuantity()
</code></pre>
]]></description><link>https://community.secnto.com//post/2932</link><guid isPermaLink="true">https://community.secnto.com//post/2932</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 21 Jan 2020 12:45:26 GMT</pubDate></item></channel></rss>