Product calculation
import java.util.InputMismatchException; import java.util.Scanner; public class ProductCalculation { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); try { // Input product details System.out.print("P. Name: "); String productName = scanner.nextLine(); System.out.print("Quantity: "); int quantity = scanner.nextInt(); System.out.print("Price: "); double price = scanner.nextDouble(); ...
Comments
Post a Comment