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) In

匿名用户 最后更新于 2021-12-01 19:36 计算机类Computing

A shopkeeper in afruit shop wants to find total profit he has gained after sellingall the fruits. Develop a java program to find the profits usingthe concept of interface based on the followinginstructions. Save the project/file assellerYourID.

A) Interfacename: Fruitshop

MemberMethod:

–tocalculate and return profit

B) Classname: Shopkeeper implements Fruitshop

Member variables:sellingprice, costprice

Member Methods:

–Constructor to initialize member variables

–tocalculate and return profit

profit = sellingprice- costprice

C) Controllingclass : sellerYourID

–To createan object of Shopkeeper

–To printprofit of Shopkeeper

已邀请: