Computer Science, asked by unzilakhan47, 1 year ago

given that the cost price of an article is rupees 60. 25 and is sold for Rs 89.75 write a program that calculates the profit percent of the sale using the formula profit percentage =profit/ CP ×100 where profit = SP- CP


Ankit02: Name The Platform ?
Ankit02: Want In Java ?
unzilakhan47: yes
Ankit02: OK Wait ...
shivansh2283: printing with scanner is the easiest to deal with

Answers

Answered by Ankit02
65

Your Answer :-

class Price

{

   public static void main ()

   {

       double cp = 60.25;

       double sp = 89.75 ;

       double profit = sp-cp;

       double percent = profit / cp * 100 ;

        System.out.println ( + percent );

}

}



I have given a basic program if u want the use of Scanner or Buffer Reader tell me in Comments section .

I will provide u Further info ......

# Be Brainly

Attachments:

nitish8089: string args also leave in main
nitish8089: String..args
nitish8089: sorry String...args
Ankit02: brother .
there is no rule that adding String args is compulsion .
nitish8089: it's compulsory in java...
nitish8089: you can overload main method ... but then not work like this...
Ankit02: No .
It is used in complex .
The given one is a basic just for learning and as u can see in the lappy screen
Prakhar2908: Excellent program !
Ankit02: wait . i m inboxing u .
chatting in comments will disturb the other users .
sneha19052003: nice ans!!
Answered by nitish8089
34

public class Program{

public static void main(String...args){

double cp=60.25;

double sp=89.75;

double profit=sp-cp;

double profitPercantage=(profit*100)/cp;

System.out.println("Profit Percentage: "+profitPercentage);

}

}


sp218: gr8
unzilakhan47: i think this 1 is wright
nitish8089: no now it's correct.. initially sp=87.25 but really sp=89.25
Similar questions