Answer to Question #240218 in Java | JSP | JSF for 447235

Question #240218
You have to design your own Java console application about any valid problem that your application must solve. Your solution can include solving a business problem, a new idea or even a game. Your application must make use of concepts such as arrays, loops, inheritance, constructors and information hiding. Output must be shown in the form of a report using the console.
1
Expert's answer
2021-09-22T00:01:59-0400
import java.util.Scanner;
//solving product problems
public class Main {
 public void SearchP() {
    System.out.println("Searching the product!");
  }
 public void SaveP() {
    System.out.println("The product saved successfully!");
  }
 public void UpdateP() {
    System.out.println("The product has been updated");
  }
 public void DeleteP() {
    System.out.println("The product deleted!");
  }
 public void DisplayMenu() {
    System.out.println("Displaying the menu!");
  }
 public void CaptureP(){
    System.out.println("The product has been captured!");
  }
 public void ExitApplication() {
  }
  public static void main(String[] args) {
      int Q;
    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);
    Q=input.nextInt();
    Main S = new Main();
    if(Q==1){
    S.SearchP(); }
    else if(Q==2){
    S.UpdateP();}
    else if(Q==3){
    S.DeleteP();}
    else if(Q==4){
    S.DisplayMenu();}
    else if(Q==5){
    S.CaptureP();}
    else if(Q==6){
    S.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