Answer to Question #238183 in Java | JSP | JSF for Nemo

Question #238183

Once the entire submission has been completed, the user must be informed that the product details have been successfully saved.


1
Expert's answer
2021-09-16T16:54:43-0400
public class Product {
    private String name;
    private double price;
    private String manufacturer;

    public Product(String name, double price, String manufacturer) {
        this.name = name;
        this.price = price;
        this.manufacturer = manufacturer;
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the name of the product: ");
        String name = in.nextLine();
        System.out.print("Enter the price of the product: ");
        double price = Double.parseDouble(in.nextLine());
        System.out.print("Enter the manufacturer of the product: ");
        String manufacturer = in.nextLine();
        Product product = new Product(name, price, manufacturer);
        System.out.println("The product details have been successfully saved");
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS