//Calculate cost price of a product
import java.util.Scanner;
public class Product_cp {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Selling price for 15 items(in total) and enter profit per item:");
float sp_t=sc.nextFloat();
float p=sc.nextFloat();
float cp=(sp_t/15)-p;
System.out.println("Cost price per item:"+cp);
}
}
import java.util.Scanner;
public class Product_cp {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Selling price for 15 items(in total) and enter profit per item:");
float sp_t=sc.nextFloat();
float p=sc.nextFloat();
float cp=(sp_t/15)-p;
System.out.println("Cost price per item:"+cp);
}
}
No comments:
Post a Comment