A shopkeeper sells 2 calculators at the selling price 5000 . he earns 20% profit on one and suffers 20% loss on another . calculate toal cost price
Answers
Answer:
the lines which are not bold are called comments and are neglected by the compiler.
Step-by-step explanation:
package com.sample.sample2;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
double cp1,cp2,profit,loss;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the S.P of calculators");
double sp=scan.nextDouble();
double profitPercent=20,lossPercent=20;
/* formula for profit percent = profit/sp*100
* formula for loss percent = loss/sp*100
* where cp is cost price and sp is selling price
* profit=(profit percent *sp)/100
* loss=(loss percent *sp)/100
* hence by calculating profit and loss we can calculate cp*/
profit=(profitPercent*sp)/100;
loss=(lossPercent*sp)/100;
cp1=sp-profit;
cp2=sp+loss;
System.out.println("Cost price of Calculator which the shopkeeper sold on profit: \u20B9"+cp1+
"\nCost price of Calculator which the shopkeeper sold on loss: \u20B9"+cp2);
package com.sample.sample2;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
double cp1,cp2,profit,loss;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the S.P of calculators");
double sp=scan.nextDouble();
double profitPercent=20,lossPercent=20;
/* formula for profit percent = profit/sp*100
* formula for loss percent = loss/sp*100
* where cp is cost price and sp is selling price
* profit=(profit percent *sp)/100
* loss=(loss percent *sp)/100
* hence by calculating profit and loss we can calculate cp*/
profit=(profitPercent*sp)/100;
loss=(lossPercent*sp)/100;
cp1=sp-profit;
cp2=sp+loss;
System.out.println("Cost price of Calculator which the shopkeeper sold on profit: \u20B9"+cp1+
"\nCost price of Calculator which the shopkeeper sold on loss: \u20B9"+cp2);
Explanation: the lines which are not bold are called comments and are neglected by the compiler.
hope it's help you..........
mark me brainlist, and follow me...........
Answer:
first calculator cp= (sp*100) /(100+20%)
= 5000*100/100+0.2
=500000/100.2
=4990.01rs
second calculator cp= sp*100/100-20%
=5000*100/99.8
=5010.02
total cp= first calculator cp+second calculator cp
= 4990+5010= 10000 rs
hope this help