Answer to Question #235809 in Java | JSP | JSF for Princess

Question #235809
Q.1.2

If the user selects to capture a new product, you are required to save all the information supplied by the user into memory. To achieve this, you may use arrays or array lists.

Sample Capture Product Screenshot

CARTURE & NEW SODUCT

Inter the product code: Ass

Enter the product nass: EliteBook

Select the product category:

Laptop - 2

Caming Const

Product Category >>

Indicate the product warranty. Innar (1) for 6 months or any other tey for 2 years. 2 Enter the stock level for Elitalock 1 Enter the supplier for litellook IT 4 Africa Product details has been saved successfully!!!

Enter the price for EliteBook 15000

Intex (1) to launch masu úz any other key to exist
1
Expert's answer
2021-09-10T23:52:32-0400
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    Scanner in =new Scanner(System.in);
	    String [] products=new String [5];
	    System.out.println("Capture & new Soduct");
	    
	    System.out.println("Enter the product code: ");
	    String p_code=in.next();
	    products[0]=p_code;
	    System.out.println("Enter the product nass: ");
	    String p_nass=in.next();
	    products[1]=p_nass;
	    System.out.println("Select product category: \\n1. Laptop \n2. Caming Const");
	    String p_category=in.next();
	    products[2]=p_category;
	    System.out.println("Enter the product warranty: ");
	    String p_warranty=in.next();
	    products[3]=p_warranty;
	    System.out.println("Enter the product price: ");
	    String p_price=in.next();
	    products[4]=p_price;
	    
	    System.out.println("Product code: "+p_code);
	    System.out.println("Product nass: "+p_nass);
	    System.out.println("Product category: "+p_category);
	    System.out.println("Product warranty: "+p_warranty);
	    System.out.println("Product price: "+p_price);
	    
	}
}

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