Question
Write a class to model a Computer. A Computer has a constructor that takes the brand as a String. It also takes a double, gigahertz.
Write a class to model a Computer. A Computer has a constructor that takes the brand as a String. It also takes a double, gigahertz. Call the instance variables brand and ghz. Gigahertz is a measure of the clock speed of a computer.
Computer implements the the Comparable interface. Computers are ordered by gigahertz. If two Computers have the same speed (gigahertz), then the Computer with the brand that comes first in the lexicographical (alphabetical) order is the smaller. For Example, "Apple" comes before "Surface" alphabetically and so is the smaller.
Computer has methods getGhz() and getBrand().
A toString method is provided for you.
Provide Javadoc
Please use this to check: http://www.codecheck.it/files/1708020100d6qg24xncmeaspfv5ajeq3fxy
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started