Create a computer class

Assignment Help JAVA Programming
Reference no: EM13166154

Create a computer class and assume computers have the following fields:

  • String manufacture,
  • double price,
  • int year

In addition, the computer has the following methods:

void start() {

            System.out.println( manufacture + " computer starts." );

}

void process(String fileName)

{

            System.out.println( manufacture + " computer is processing " + fileName );

}

void shutdown ()

{

            System.out.println( manufacture + " computer is shut down);

}

In addition, create a constructor which is used to initialize all these three fields when we create objects. The example can be found in the slides.

Create a ComputerTest class, in its main() method, create two computers, assume one computer is made by Sony, the year is 2012, and the price is 700 dollars; The other is made by Apple, the year is 2001, and the price is 1800 dollars;

Then call the start(), process(String fileName), and shutdown() functions of these two computers. Assume the name of the file processed by Sony computer is "Mid-Exam", and the name of the file processed by Apple computer is "Final-Exam".

 

 

Reference no: EM13166154

Questions Cloud

What is overloading and what is overriding : What is overloading and what is overriding? Wrtie JAVA code code to explain it.
The number of data items being manipulated : A function of n, the number of data items being manipulated. For each expression, determine the dominant term and then classify the algorithm in big-O terms.
State what is the molar solubility of caco3 : If the pH is buffered at 8.2 (as is historically typical for the ocean), what is the molar solubility of CaCO3? F) If the pH is buffered at 7.5, what is the molar solubility of CaCO3?
Environmental elite : In the early 1970s, the environment became the focus of enormous media attention. At least some of the problems were real, if often exaggerated. Untreated sewage was being discharged into coastal estuaries. Toxic runoff from farms and factories was k..
Create a computer class : Create a computer class and assume computers have the following fields: String manufacture, double price, int year
Compute the molar solubility of caco3 : Calculate the molar solubility of CaCO3 ( Ksp = 4.5*10-9) neglecting the acid-base character
Linked list in c++ : If the following C++ code is valid, show the output. If it is invalid, explain why.
State combustion in oxygen to make carbon dioxide gas : Methanol undergoes combustion in oxygen to make Carbon Dioxide Gas & Liquid Water. Find Standard Enthalpy of Reaction?
Reads a set of integers from file : The code in file "hw5-stree.cpp" reads a set of integers from file and inserts them into a binary search tree. You are asked to implement two functions max() and depth() that compute the maximum element and the depth of the binary search tree.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

  Hasanodddigit that returns whether any digit

d named hasAnOddDigit that returns whether any digit of a positive integer is odd. Your method should return true if the number has at least one odd digit and false if none of its digits are odd. 0, 2, 4, 6, and 8 are even digits, and 1, 3, 5, 7, 9 a..

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

  Implement the application using a singly linked list

Implement the following application using a singly linked list. This application accepts from console and stores a list of 10 names of your friends in the singly linked list

  The program reads in names

Write a program and include the following methods. The program reads in names and ages (use 2 parallel arrays, maximum size 50) from a file called Stuff.dat.

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Populate a one-dimensional array

Populate a one-dimensional array with the following grades in this order: 93, 61, 72, 45, 84, 51, 70, 83, 96, and 66. Use a loop to call a method from main() that adds

  A program called invoice that will prompt the user for items

write a program called invoice that will prompt the user for items on and invoice and then print the total of the invoice

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  Write an interface for a bagadt that implements iterable

Write an interface for a BagADT that implements the Iterable interface. Include javadoc comments that will generate specifications for the BagADT so that someone who wants to implement this interface will know what each method does.

  Write a method called negative sum

Write a method called negativeSum that accepts a Scanner reading input from a file containing a series of integers, and print a message to the console indicating whether the sum starting from the first number is ever negative

  Method to store the product of the two arrays in third array

Write a method to store the product of the two arrays in the third array

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd