Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P1 See the HW08P1.py file provided. Each comment line specifies a requirement. In the line after each comment, write a Python statement to meet that

P1 See the HW08P1.py file provided. Each comment line specifies a requirement. In the line after each comment, write a Python statement to meet that requirement.

class Stock(object): def __init__(self,name="A",qty=10): self.__name = name self.qty = qty def get_item_name(self): return self.__name def show_double(self): x = self.qty * 2 print(x) def show_increase_by(self, y): x = self.qty + y print(x) item1 = Stock() #Create an object - item2 - with name of B and qty of 5

#Display the name of item1

#Display the qty of item1

#Set the qty of item1 to 24 (without recreating the entire object)

#Using the method provided, show what would be twice the qty of item1

#Using the method provided, show what would be the qty of item1 with 10 added

#Assign the qty of item1 minus 5 to a variable named temp_qty

#Display the value in temp_qty

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

What is an employee assistance program?

Answered: 1 week ago

Question

Define and measure service productivity.

Answered: 1 week ago