using java An electronics company sells circuit boards at a
using java:
An electronics company sells circuit boards at a 40 % profit. If you know the retail price of a circuit board, you can calculate its profit with the following formula: Profit = Retail price x 0.4 Write a program that asks the user for the retail price of a circuit board, calculates the amount of profit earned for that product, and displays the results on the screen.
please help.
Solution
profit.java:
import java.util.Scanner;
public class profit
{
public static void main(String[] args)
{
double retail_price;
Scanner scanner = new Scanner(System.in);
System.out.println(\"Enter Retail Price: \");
retail_price = scanner.nextFloat();
System.out.println(\"The Amount Of Profit is: \" + (retail_price*0.4 ));
}
}
Sample output:
Enter Retail Price:
100
The Amount Of Profit is: 40.0
Enter Retail Price:
200
The Amount Of Profit is: 80.0
