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

  A remote web-based file storage application

Develop a web-based application. The server-side part of the application must be developed using Java Servlets (possibly including JSP). The development of the client (browser) side will typically be a combination of HTML and Javascript.

  If there are 4 command line arguments

If there are 4 command line arguments (a b c filename.dat) then the engine should take a,b,c and store the resulting x1 and x2 in filename.dat working in silent mode (no use of screen)

  Regular expression that selects lines

Write a regular expression that selects lines containing the html BR tag. The rules for this tag are that, like all html tags, it starts with . In between are the letters b and r in that order

  Java program that allows the user to enter a letter

Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the ci..

  Design an application for pizza order process

Create an application to take and procedure a pizza order. The user should be able to make pizza order choices from listboxes, and the application should show the order price.

  Produce a design document

You will design and deliver a website foes fictional client part-1 Website Design Document and produce a design document

  Modify the scholarship application

Modify the Scholarship application so that if a user enters a grade point average under 0 or over 4.0, or a negative value for either of the activities, an error message appears.

  Create a gui version of the game mini sudoku.

Each row has the numbers 1 to 6,Each column has the numbers 1 to 6,Each group of 2 rows by 3 columns also has the numbers 1 to 6.

  Reverse the array, and find the largest element

find the max block of an array by splitting it into three parts: left, middle, right. And then reverse the array, and find the largest element.

  Create java applet to input miles driven and gallons used

Create the Java applet which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display miles per gallon obtained for each tankful.

  Sequence of method in vector class

Construct a Vector class implementing a number of vector operations as methods along with a testing program to verify the class is working.

  Pass in the number of gallons on board

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

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