Ramirez_RD

Samson_Item_Main

Feb 25th, 2025
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. import java.util.*;
  2. public class Samson_Item_Main {
  3.     static void main_Method(Scanner sc){
  4.         Samson_Item item = new Samson_Item();
  5.         System.out.println("Enter the Following Information:");
  6.         System.out.print("Item Code: ");
  7.         item.setItemCode(sc.nextInt());sc.nextLine();
  8.         System.out.print("Item Name: ");
  9.         item.setItemName(sc.nextLine());
  10.         System.out.print("Item Classification: ");
  11.         item.setItemClassification(sc.nextLine());
  12.         System.out.print("Item Shelf Number: ");
  13.         item.setItemShelfNumber(sc.nextInt());
  14.         System.out.print("Item Level: ");
  15.         item.setItemLevel(sc.nextInt());
  16.         System.out.print("Item Price: ");
  17.         item.setItemPrice(sc.nextDouble());sc.nextLine();
  18.         System.out.print("Item Packaging: ");
  19.         item.setItemPackaging(sc.nextLine());
  20.        
  21.         item.display_SamsonItem();
  22.     }
  23.     public static void main(String []args) throws Exception{
  24.         Scanner sc = new Scanner(System.in);
  25.         try{
  26.             main_Method(sc);
  27.         }catch(InputMismatchException er){
  28.             System.out.println("Error Occured, Invalid Data Type. . .");
  29.         }finally{
  30.             sc.close();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment