Modify it to read qty from keyboard and rejects values greater than or equal to zero

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
Modify it to read qty from keyboard and rejects values greater than or equal to zero
Bclass Fruits:
def
init
(self, fruitname, price, qty):
self.price
price
self.qty
qty
self.fruitname
= fruitname
def computeTotal(self):
total =
self.price *
self.qty
print ("Thanks for your purchase")
print ("Your "
+ self.fruitname +" total is = "
, total)
myfruits
myfruits.computeTota1()
Fruits("orange", 0.5, 6)
%3D
Transcribed Image Text:Bclass Fruits: def init (self, fruitname, price, qty): self.price price self.qty qty self.fruitname = fruitname def computeTotal(self): total = self.price * self.qty print ("Thanks for your purchase") print ("Your " + self.fruitname +" total is = " , total) myfruits myfruits.computeTota1() Fruits("orange", 0.5, 6) %3D
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Matrix multiplication
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage