Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started