Graderpractice for programmers

254275 OOP - Practice Before Final Exam 2/2563

Awaiting submission
Write a class named Notebook with members for brand, model, cpu , ram , ssd and price. The class needs a constructor and get methods for each member.
  public static void main(String[] args)
  {
      Notebook mmaxmax = input();
      System.out.println("Brand: " + mmaxmax.getBrand());
      System.out.println("Model: " + mmaxmax.getModel());
      System.out.println("CPU: "+ mmaxmax.getCpu());
      System.out.println("Ram: "+mmaxmax.getRam()+" GB");
      System.out.println("SSD: "+mmaxmax.getSsd()+ " GB");
      System.out.println("Price: " + mmaxmax.getPrice() + " baht");
  }

  private static Notebook input()
  {
      Scanner pp = new Scanner(System.in);
      String brand = pp.nextLine();
      String model = pp.nextLine();
      String cpu = pp.nextLine();
      int ram = Integer.parseInt(pp.nextLine());
      int ssd = Integer.parseInt(pp.nextLine());
      int price = Integer.parseInt(pp.nextLine());
      return new Notebook(brand,model,cpu,ram,ssd,price);
  }
Awaiting submission
Reuse your Notebook class from question 1. Add a method named toString() that returns the brand model and pricel (separated by a space).
Awaiting submission
Write a method name CheckExpensive that returns true if the notebook has price more than or equals 35000 bath
Awaiting submission
OS is a subclass of Notebook. Notebook has a String member named operatingSystem (e.g. "Windows OS" or "Mac OS"). Write the Notebook class.
  public static void main(String[] args)
  {
      OS natasittttt = input();
      System.out.println("Notebook name: " + natasittttt.getModel());
      System.out.println("Operating System: " + natasittttt.getOperatingSystem());
   }

   private static OS input()
   {
     Scanner pp = new Scanner(System.in);
     String brand = pp.nextLine();
     String model = pp.nextLine();
     String cpu = pp.nextLine();
     int ram = Integer.parseInt(pp.nextLine());
     int ssd = Integer.parseInt(pp.nextLine());
     int price = Integer.parseInt(pp.nextLine());
     String op = pp.nextLine();
     return new OS(brand,model,cpu,ram,ssd,price,op);
   }
Awaiting submission
Reuse your OS class from question 5. Add a method named isAppleOs that returns true if the operating system is "Mac OS" should accept input in any case