Reference no: EM13970953
Programming Assignment
Creating Objects and Calling Accessor and Mutator Methods
I. The Assignment
This assignment is to write a "test" class (aka: a "driver" class or "client code") that uses the class Balloon.java, available on the class web page.
To use the Balloon class, download it and store it in the src folder of your NetBeans project. Make sure you save it as Balloon.java.
The best way to learn how to use the Balloon class - or any other Java class - is to consult the documentation, Balloon.html (online). You can also read the javadoc comments that appear just above the class declaration and above each method declaration, which explain what each method does, what the method's parameters are, and what value - if any - is returned by the method. The html "help" pages are generated from these comments.
Don't worry if you don't understand the code. It will all be covered later. It is not necessary to know how a method works as long as you know what it does and how to call it.
- Review declaring variables, creating objects, calling methods that return a value vs. "void" methods, and accessor and mutator methods before beginning.
To receive credit for this assignment, you must not modify the Balloon class in any way!
II. Your BalloonTester Class
Your BalloonTester class will have only a single method - main - and will perform each of the following operations, in the exact order listed below. Each operation may be done in one or two statements. Make sure you follow directions faithfully, and note that once you have done step 3, you can copy and paste it to do steps 6, 9, and 12.
1. Create a Balloon object with a name of your own choosing and an altitude of 100 meters.
2. Create a second Balloon object with a name of your own choosing, and specify an initial altitude of -100 meters.
3. Call the accessor methods of the Balloon class to get the name and altitude of each Balloon object. Print the data, one object per line.
4. Make the object you created in step 1 ascend to an altitude of 300 meters.
5. Call the adjustAltitude method to increase the altitude of the object you created in step 2 by 200 meters.
6. Call the accessor methods of the Balloon class to get the name and altitude of each object. Print the data, one object per line.
7. Call the adjustAltitude method to decrease the altitude of the object you created in step 1 by 150 meters.
8. Make the object you created in step 2 descend to the same altitude as the other object. You may assume that the other object is at a lower altitude.
To get credit for step 8., the statement(s) you write must always work, regardless of the actual altitude of the second object. It cannot depend on you knowing the altitude of the second object, but must utilize the fact that the object knows its own altitude. In other words, if you use a literal to set the altitude, it is not correct.
9. Call the accessor methods to get the name and altitude of each object. Print the data, one object per line.
10. Move the object you created in step 1 to an altitude that is three times its current altitude. As in step 8, the statement(s) you write must work for any altitude and may not depend on you "figuring out" the new altitude beforehand.
11. Attempt to move the object you created in step 2 to an altitude that is 200 meters below its current altitude.
12. Call the accessor methods to get the name and altitude of each object. Print the data, one object per line.
Accepting the special order
: Indicate the net income (loss) Harley would realize by accepting the special order.
|
Company budget for fixed advertising
: To make up for the promotions that the independent sales agents had been running on behalf of Marston, management believes that the company's budget for fixed advertising expenses should be increased by $410,000.
|
Data needed to evaluate this capital investment project
: What types of decisions need to be made when healthcare companies are getting ready to make an investment and indicate the main kinds of information/data needed to evaluate this capital investment project?
|
Arise during the investment decision making process
: Consider a healthcare organization that you are familiar with and present one or two challenges that is likey to arise during the investment decision making process, as well as any possible solutions.
|
Create a balloon object with a name of your own choosing
: Create a Balloon object with a name of your own choosing and an altitude of 100 meters. Create a second Balloon object with a name of your own choosing, and specify an initial altitude of -100 meters.
|
Forecasted statements and ratios
: Upton Computers makes bulk purchases of small computers, stocks them in conveniently located warehouses, ships them to its chain of retail stores, and has a staff to advise customers and help them set up their new computers. If sales are projected to..
|
Briefly describe the organization
: In a 1-page submission, briefly describe the organization, and then design the voluntary, supplemental, and other benefits that you believe to be the best fit for this organization based on your understanding of its needs and financial abilities
|
What is its self-supporting growth rate
: Maggie's Muffins, Inc., generated $2,000,000 in sales during 2013, and its year-end total assets were $1,300,000. Also, at year-end 2013, current liabilities were $1,000,000, consisting of $300,000 of notes payable, $500,000 of accounts payable, and ..
|
Problem regarding the tax return project
: Based on the information provided, you are to complete the appropriate 2014 individual tax form and any supporting schedules/forms for Jonathan Hales.
|