Question

Please include comments in java Create a command line program that can be used for computer...

Please include comments

in java

Create a command line program that can be used for computer inventory purposes

  • Create a super class that will store the following data:
    • CPU speed
    • Amount of RAM
    • Hard Disk size
    • Operating System
  • Allow the user to enter data using any units of measurement they desire (i.e. - 500GB or 1TB for hard disk size).
  • Create a class that inherits from the previous class and stores information for a Windows based computer. Store the following additional information:
    • Manufacturer
  • Create a class that inherits from the first class and stores information for a Mac based computer. Store the following additional information:
    • Type of Mac (iMac, Mac Mini, etc.)
  • Create display methods in the Windows and Mac classes to display all information including info from the super class.
  • Make all variables in the previous three classes private or protected as appropriate.
  • Create accessor and mutator methods for all variables in the previous classes.
  • Create a demo program:
    • Create one object from the Windows class. Call each mutator method and assign a value to it (do not ask for user input).
    • Create one object from the Mac class. Call each mutator method and assign a value to it (do not ask for user input).
    • Display the values for both the Windows and Mac objects.
0 0
Add a comment Improve this question Transcribed image text
Answer #1


import java.io.*;
class Super throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
protected int CPUspeed=Integer.parseInt(br.readLine());
protected int AmountofRAM=Integer.parseInt(br.readLine());
protected int HardDisksize=Integer.parseInt(br.readLine());
protected String OperatingSystem=b.readLine();
}
class Windows extends Super throws IOException{
{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
private String Manufactuer=br.readLine();
Super s=new Super();
void display()
{
System.out.println(s.CPUspeed+"="+s.AmountofRAM+"="+s.HardDisksize+"="+s.OperatingSystem);
System.out.println(Manufactuer);
}
public void set Manufactuer(Manufactuer)
{
this.Manufactuer=Manufactuer;

}
}

class Mac extends Super throws IOException{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
private String type=b.readLine();
Super s=new Super();
void display()
{
System.out.println(s.CPUspeed+"="+s.AmountofRAM+"="+s.HardDisksize+"="+s.OperatingSystem);
System.out.println(type);
}
public void set type(type)
{
this.type=type;

}
}
class Demo
{
public static void main(String[] ar){
Windows w=new Windows();
Mac m=new Mac();
w.display();
m.display();
public void getManufactuer()
{
return Manufactuer;

}
public void gettype()
{
return type;

}
}
}

Add a comment
Know the answer?
Add Answer to:
Please include comments in java Create a command line program that can be used for computer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PLEASE INCLUDE COMMENTS In java Create a Java Program Add the following comments at the beginning...

    PLEASE INCLUDE COMMENTS In java Create a Java Program Add the following comments at the beginning of the file: Your name. The name of the class(es) used in the program. The core concept (found below) for this lesson. The date the program was written. Include a recursive method separate from the main method that will add together all of the even numbers between and including 1 and the value the user supplies. For instance, if the user enters 10 then...

  • Create the following program in java please Write a class Store which includes the attributes: store...

    Create the following program in java please Write a class Store which includes the attributes: store name and sales tax rate. Write another class encapsulating a Book Store, which inherits from Store. A Book Store has the following additional attributes: how many books are sold every year and the average price per book. Code the constructor, accessors, mutators, toString and equals method of the super class Store and the subclass Book Store; In the Book Store class, also code a...

  • Java Question 3 Implement a program to store the applicant's information for a visa office. You...

    Java Question 3 Implement a program to store the applicant's information for a visa office. You need to implement the following: A super class called Applicant, which has the following instance variables: A variable to store first name of type String. A variable to store last name of type String. A variable to store date of birth, should be implemented as another class to store day, month and year. A variable to store number of years working of type integer...

  • python code? 1. Create a class called Person that has 4 attributes, the name, the age,...

    python code? 1. Create a class called Person that has 4 attributes, the name, the age, the weight and the height [5 points] 2. Write 3 methods for this class with the following specifications. a. A constructor for the class which initializes the attributes [2.5 points] b. Displays information about the Person (attributes) [2.5 points] c. Takes a parameter Xage and returns true if the age of the person is older than Xage, false otherwise [5 points] 3. Create another...

  • Java Project In Brief... For this Java project, you will create a Java program for a...

    Java Project In Brief... For this Java project, you will create a Java program for a school. The purpose is to create a report containing one or more classrooms. For each classroom, the report will contain: I need a code that works, runs and the packages are working as well The room number of the classroom. The teacher and the subject assigned to the classroom. A list of students assigned to the classroom including their student id and final grade....

  • 5.4 Java Create a program that generates SuperLotto lottery numbers. Create a class called SuperLottoPlus.java Create...

    5.4 Java Create a program that generates SuperLotto lottery numbers. Create a class called SuperLottoPlus.java Create a method called generateSuperLottoNumbers() that returns an array of 6 random SuperLotto lottery numbers. The first 5 numbers must be from the range 1 to 47 The 6th number (the MEGA) must be from 1 to 27. Create a method called printTicket() that takes an integer array as an parameter it will loop through the integer array and print out the data Display the...

  • Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super...

    Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...

  • This is for Java Programming Please use comments Customer and Employee data (15 pts) Problem Description:...

    This is for Java Programming Please use comments Customer and Employee data (15 pts) Problem Description: Write a program that uses inheritance features of object-oriented programming, including method overriding and polymorphism. Console Welcome to the Person Tester application Create customer or employee? (c/e): c Enter first name: Frank Enter last name: Jones Enter email address: frank44@ hot mail. com Customer number: M10293 You entered: Name: Frank Jones Email: frank44@hot mail . com Customer number: M10293 Continue? (y/n): y Create customer...

  • (2 bookmarks) In JAVA You have been asked to write a program that can manage candidates...

    (2 bookmarks) In JAVA You have been asked to write a program that can manage candidates for an upcoming election. This program needs to allow the user to enter candidates and then record votes as they come in and then calculate results and determine the winner. This program will have three classes: Candidate, Results and ElectionApp Candidate Class: This class records the information for each candidate that is running for office. Instance variables: first name last name office they are...

  • I need this in java please Create an automobile class that will be used by a...

    I need this in java please Create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class: private string make private string model private string color private int year private int mileage. Your program should have appropriate methods such as: default constructor parameterized constructor add a new vehicle method list vehicle information (return string array) remove a vehicle method update vehicle attributes method. All methods...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT