Create the mouse program

Assignment Help JAVA Programming
Reference no: EM13727402

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.

Reference no: EM13727402

Questions Cloud

Specific marketplace situation : Question 1: Analyze the specific marketplace situation in detail, including organizational strengths, weaknesses, environmental opportunities, and threats (SWOT analysis).
Describe how did the organization approach the development : How did the organization approach the development and implementation of the new strategy
Naturalistic observations and evaluation : Conducting an ethnographic study is a fun way of gathering research about your social environment. You may have done an ethnography before without really being aware of it. In a small way, this assignment recreates what ethnographers do when they ..
Calculate commission earned for hourly employees : As supervisor for a retail company, you supervise six people in your location. You are responsible for their payroll and commissions each week. This task would normally take a couple of hours on paper, but you now have the expertise needed to auto..
Create the mouse program : 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 d..
What financial statements would be critical and why : What financial statements would be critical and why, Explain how the subject company would approach creating their budgets
Result in the highest expected payoff to the firm : The manager for a growing firm is considering the launch of a new product. If the product goes directly to market, there is a 40 percent chance of success. For $90.000, the manager can conduct a focus group that will increase the product's chance of ..
An investment project has annual cash inflows : An investment project has annual cash inflows of $8,600, $8,300, $8,700, and $7,300, and a discount rate of 11 percent. If the initial cost is $21,900, the discounted payback period for these cash flows is  years. (Round your answer to 2 decimal plac..
Effective ways of identifying leadership potential : 1. What are some effective ways of identifying leadership potential? 2. What are some effective ways of developing leadership skills?

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Write a java program to read the numbers from the disk file

Write a Java program to read the numbers from the disk file and store them in an integer array ( not an ArrayList ).

  Ask the user to input a grade (integer from 1-100)

Program should still ask the user to input a grade (integer from 1-100) and then output the letter grade.  Scale:  Greater than 90 is an "A"; Greater than 80 to 90 is a "B", Greater than 70 to 80 is a "C", Greater than 60 to 70 is a "D", and 60 or le..

  Write a piece of code that prints the values

Write a piece of code that prints the values requested in each part, given these variables:

  Write a program that displays the squares

Using a for loop, write a program that displays the squares of all integers greater than 0 and less than or equal to a given number n. Use the c ++ programming language to write the code.

  Build a very straightforward and fully functional machine

Build a very straightforward and fully functional machine learning classifier with the K-Nearest Neighbor (KNN) algorithm. The KNN model will read a set of data specified by the user, decide the appropriate class of the new instance, and finally o..

  Write a graphical user interface class

Write a graphical user interface class called SentenceCounterGUI. It should be able to manipulate the sentence of words and have the behaviour label.

  Represent one book in java

Represent one book in java

  Approximate the volume of cheese in a rectangular hunk

You will create a program that will approximate the volume of cheese in a rectangular hunk of Swiss cheese. For this approximation you will assume that the holes in the Swiss cheese are of two types: spherical bubbles (all of the same size) or cyl..

  Project socket programming - udp objectives - learn socket

project socket programming - udp objectives - learn socket programming in java udp-nbsp cement your understanding of

  Negatively impacting health care currently

Identify and explain at least two events that are negatively impacting health care currently. Tell us why you think these items are negatively impacting the access to care, and make sure that you cite your references.

  Write class encapsulating the concept of weather forecast

Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.

  Write an isr and startup code for a system

Write an ISR and startup code for a system that lights up LED0 on the PSoC Eval1 board (assuming that a wire is connecting P1[0]) to show "Low Voltage" whenever there is a supply voltage monitor interrupt.

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