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