Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A shopkeeper in a fruit shop wants to find total profit he has gained after selling all the fruits. Develop a java program to find

A shopkeeper in a fruit shop wants to find total profit he has gained after selling all the fruits. Develop a java program to find the profits using the concept of interface based on the following instructions. Save the project/file as sellerYourID.

A) Interface name: Fruitshop

Member Method:

to calculate and return profit

B) Class name: Shopkeeper implements Fruitshop

Member variables: sellingprice, costprice

Member Methods:

Constructor to initialize member variables

to calculate and return profit

profit = sellingprice - costprice

C) Controlling class : sellerYourID

To create an object of Shopkeeper

To print profit of Shopkeeper

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions