Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE260 assesment Sir it is urgent.do fast. Please solve this code in python3 paste with proper intendent blocks by pressing (CTRL+SHIFT+V),Also please provide code screenshot,

CSE260 assesment

Sir it is urgent.do fast. Please solve this code in python3 paste with proper intendent blocks by pressing (CTRL+SHIFT+V),Also please provide code screenshot, Thank you.

Do not need comments just give me solution as fast as possible. I am running out of time. Attach a screenshot with your solve.

: Design Vegetable class and Fruit class which inherit from Food class so that the following code provides the expected output.

[Assume, the price for a vegetable or a fruit per kg is the same irrespective of its size. The add_Vegetables() and add_fruits methods in both child classes should work for any number of parameters and any size of the fruit/vegetable ]

class Food: def init(self, name, rich_in): self.name = name self.rich_in = rich_in

def str(self): s = f"Name: {self.name} Rich in {self.rich_in}" return s

# Write your codes here. # Do not change the following lines of code. g1 = Vegetable("Tomato", "folate, vitamin C, and potassium", 60) g1.add_Vegetables("Red large Tomato - 5kg","Green small tomato - 2kg","red Medium Tomato - 3kg","green Large tomato - 2kg","Yellow Medium Tomato - 1kg") print('====================================') g1.show_Cost() print('====================================') print(g1) print('====================================') g2 = Fruit("Apple", "fiber, vitamin C, and various antioxidants", 90) g2.add_Fruits("Red small Apple - 9kg", "Green small Apple - 5kg", "red Large Apple - 9kg") print('====================================') g2.show_Cost() print('====================================') print(g2)

OUTPUT: ==================================== Tomato , total cost: 780 BDT ==================================== Name: Tomato Rich in folate, vitamin C, and potassium Price: 60 BDT per kg Vegetable Details: Red : ['large-5kg', 'Medium-3kg'] Green : ['small-2kg', 'Large-2kg'] Yellow : ['Medium-1kg'] ==================================== ==================================== Apple , total cost: 2070 BDT ==================================== Name: Apple Rich in fiber, vitamin C, and various antioxidants Price: 90 BDT per kg Fruit Details: Red : ['small-9kg', 'Large-9kg'] Green : ['small-5kg']

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions