Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Question 1: Create the Mouse program. Test it with interesting data.

Question 2: Modify the MouseDriver program you just created in Question #1. Currently, it uses the same value of growthRate for both mice. Change the program so it accepts a different value of growthRate for each mouse. Test it with different growth rates for the two mice.

Question 3: Modify the MouseDriver program you just created in Question #2. Currently, it creates two mice. Create three mice. Use interesting names for the mice (instead "gus" and "jaq").

Question 4: Change the Mouse program you just created in Question #3. Instead of Mouse, use Tree. Instead of MouseDriver, use TreeDriver. Instead of days, useyears. Instead of weight, use height. Instead of the names of three mice, use the names of three tress, like fig and date and sequoia. Make the sequoia tree really, really tall. Remember to make appropriate changes to the print instruction. Test it with interesting data.

Question 5: Create a driver program that works with the following BankAccount class:

/***************************************
* BankAccount.java
* This class stores and prints information for a bank account.
***************************************/

public class BankAccount
{
private String customer; // customer's name
private int accountNum; // bank account number

// This method stores a customer's information:
public void setCustomer(String customer)
{
this.customer = customer;
}

// This method stores an account's number:
public void setAccountNum(int accountNum)
{
this.accountNum = accountNum;
}

// This method prints a bank account's information.
public void printAccountInfo()
{
System.out.println(
this.customer + "'s account number is " + this.accountNum + ".");
}
} // end class BankAccount

Test the program with interesting data for customer name and account number.

Question 6: Get the CircleDriver program from the brilliant PowerPoint lecture to work with the Circle class. Test it with interesting data.

Question 7: Create the Mouse2 program. Test it with interesting data.

~~~~~~~~~~~~~

Extra Credit:

1. When a method tries to return a double, and the method call is expecting anint, the program won't compile. Remember the Russian dolls? A double won't fit in an int.

Question: What happens when a method tries to return an int, and the method call is expecting a double? It should work, right? Modify the Mouse2Driver program and the Mouse2 class to find out!

2. Start with the Mouse2 and Mouse2Driver programs. Add a method that will copy the contents of one mouse into another mouse. Add a method to print all three variables. Then print the values of the variables in both mice to show they're the same.

Java, Programming

  • Category:- Java
  • Reference No.:- M91266779
  • Price:- $50

Guranteed 36 Hours Delivery, In Price:- $50

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As