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. i dont understand how to plug in the numbers for profit and retail price
Solution
RetailTest.java
import java.util.Scanner;
public class RetailTest {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double retailCost = 0;
do{
System.out.print(\"Enter the retail price of a circuit board: \");
retailCost = scan.nextInt();
}while(retailCost <= 0);
double profit = retailCost * 0.4;
System.out.println(\"Profit is \"+profit);
}
}
Output:
Enter the retail price of a circuit board: 100
Profit is 40.0
