Answer to Question #239050 in Java | JSP | JSF for Jaden

Question #239050
1. In your solution, you must create a class called Products, which will contain all your working
methods.
2. This class will, as a minimum, contain the following methods, but you are encouraged to
add more methods:
• SearchProduct();
• SaveProduct();
• UpdateProduct();
• DeleteProduct();
• DisplayMenu();
• CaptureProduct();
• ExitApplication();
3. Finally, create a main class to run your application
1
Expert's answer
2021-09-20T23:53:15-0400
import java.util.Scanner;
public class Main {
 public void SearchProduct() {
    System.out.println("Searching the product!");
  }
 public void SaveProduct() {
    System.out.println("The product saved successfully!");
  }
 public void UpdateProduct() {
    System.out.println("The product has been updated");
  }
 public void DeleteProduct() {
    System.out.println("The product deleted!");
  }
 public void DisplayMenu() {
    System.out.println("Displaying the menu!");
  }
 public void CaptureProduct(){
    System.out.println("The product has been captured!");
  }
 public void ExitApplication() {
  }
  public static void main(String[] args) {
      int x;
    System.out.print("Choose the operation to perform:\n1.SearchProduct\n2.UpdateProduct\n3.DeleteProduct\n4.DisplayMenu\n5.Capture the product\n6.Exit the application ");
     Scanner input=new Scanner (System.in);
    x=input.nextInt();
    Main P = new Main();
    if(x==1){
    P.SearchProduct(); }
    else if(x==2){
    P.UpdateProduct();}
    else if(x==3){
    P.DeleteProduct();}
    else if(x==4){
    P.DisplayMenu();}
    else if(x==5){
    P.CaptureProduct();}
    else if(x==6){
    P.ExitApplication();}
      else{
          System.out.print("Invalid option!");}
      }
  }

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