QuestionQuestion

Develop a Computer class that describes your computer. The class must have at least five attributes comprised of a minimum of three different data types. At least one method should be defined in your class. Prepare a program that utilizes the Computer class and prompts the user for information about their existing computer followed by information about a future, more desirable computer. Use Scanner class for data input. You must use at least two variables of data type integer and calculate or quantify the improvement over the existing computer using these variables. Display a table that displays all the information to the screen, such as the attribute values and the results of the calculations. Your program should create at least two instances of your Computer class.

Be sure to use variables, the Scanner class and calculations. The program should output the values of the instance variables and the results of any calculations.

Input data for the current computer as well as for the desired computer. Your assignment submittal should include your properly commented java code and the class file.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public Computer(String brand, int ram_size, double cpu_speed, int core_num, String color, String type) {
       brands = new String[]{"HP","Lenovo","Dell","Asus","Apple"};
       types = new String[]{"desktop","notebook","laptop"};
       colours = new String[]{"white","black", "blue","brown","red","pink"};
       setBrand(brand);
       setRam_size(ram_size);
       setColor(color);
       setCpu_speed(cpu_speed);
       setType(type);   
       setCore_num(core_num);
    }

    /**
    * guess the price of this computer
    * @return
    */
    public double guessPrice(){
       double price = 500;
       price += core_num * cpu_speed * 85;
       price += (double)ram_size / 512.0 * 25.0;
       price += 100.0;
       for (String b : brands) {
            if (b.equalsIgnoreCase(brand)) {...
$15.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats