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...

  • 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...

  • 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....

  • Java Program Please help me with this. It should be pretty basic and easy but I...

    Java Program Please help me with this. It should be pretty basic and easy but I am struggling with it. Thank you Create a superclass called VacationInstance Variables destination - String budget - double Constructors - default and parameterized to set all instance variables Access and mutator methods budgetBalance method - returns the amount the vacation is under or over budget. Under budget is a positive number and over budget is a negative number. This method will be overwritten in...

  • Computer Science 111 Introduction to Algorithms and Programming: Java Programming Net Beans Project #4 - Classes...

    Computer Science 111 Introduction to Algorithms and Programming: Java Programming Net Beans Project #4 - Classes and Objects (15 Points) You will create 3 new classes for this project, two will be chosen (THE TWO CHOSEN ARE TENNIS SHOE AND TREE) from the list below and one will be an entirely new class you invent. Here is the list: Cellphone Clothes JuiceDrink Book MusicBand Bike GameConsole Tree Automobile Baseball MusicPlayer Laptop TennisShoe Cartoon EnergyDrink TabletComputer RealityShow HalloweenCostume Design First Create...

  • Programming: Create a class called City with two public variables: a string to store the name...

    Programming: Create a class called City with two public variables: a string to store the name of the city and a float to store the average temperature in Fahrenheit. Create one object of the class that you create and ask the user to enter the city name and the average temperature in Fahrenheit. Store these in the object of the class that you create. Then display the contents of the class. Once that is working, make the variables private and...

  • Java Task 2: Write a program where you create an ArrayList object that can store letters....

    Java Task 2: Write a program where you create an ArrayList object that can store letters. Show how can you add a letter to the ArrayList, remove a letter from theArrayList, replace a letter in the ArrayList, insert a letter in a specific location in the ArrayList, and display all the letters in the ArrayList. Task 3: Write a program where you create an ArrayList object that can store Circle object (you created circle class in your previous PAs). Create...

  • Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and...

    Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and name variables (do not include topTrick). Note: The type refers to what the breed typically does; for example, a corgi would be a “cattle herding dog.” A Shiba Inu would be a “hunting dog.” Create the setTopTrick() mutator method Dog is parent class Corgi and Driver are subclasses Complete the Corgi class: Using the UML Class diagram, declare the instance variables. Create the two...

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
ADVERTISEMENT