Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

Java application that defines a class Boat. The Boat class should provide three fields/attributes: 1) name is a variable of type String, 2) sail position is a variable of type boolean, 3) speed is a variable of type float.

The Boat class must define a constructor and three methods: goFastgoSlow, whereIsTheSail.

goFast sets the position of the sail to true and increase the speed of the boat by 10 mph and prints the following text (BlueSea is the boat name):

BlueSea is raising the sail at the speed of 10 mph.

goSlow sets the position of the sail to false and decreases the speed of the boat by 5 mph and prints the following text:

BlueSea is lowering the sail at the speed of 5 mph.

whereIsTheSail prints the name of the boat and "sail is up" or "sail is down" depending on the sail position:

BlueSea sail is up.

Note: The boat speed should not exceed 100 mph (max speed is 100 mph) and cannot go below 0 mph.  

Start out by writing a Java class Boat. Provide the methods described above. Create the main class (call it SimpleBoatMain) with a static main method (example provided below). Inside the main method, a new instance of class Boat and then invoke the proper methods as shown below:

public class SimpleBoatApp {

   public static void main (String[] args) {

       Boat simpleBoat = new Boat("Destinty");

       simpleBoat.goFast();   

       simpleBoat.goSlow();

       simpleBoat.whereIsTheSail();

       simpleBoat.goFast();

       simpleBoat.whereIsTheSail();

    simpleBoat.goFast();

   }

}

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92504387
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

Why is federal income tax important to a company can it

Why is federal income tax important to a company? Can it effect the hiring process for employees?

Think about the most cohesive group that you have ever been

Think about the most cohesive group that you have ever been in. How does it compare to less cohesive groups in terms of similarity, stability, size, support, and satisfaction?

Discuss the transportation and logistics management and its

Discuss the transportation and logistics management and its impact on various economic activities.

What are costcos key success factors ksfs which of the 11

What are Costco's key success factors (KSFs)? Which of the 11 sociotechnical principles can be seen in Costco?

The decision to globalize operations is very complex and

The decision to globalize operations is very complex and not without risks. Chose a company that has not yet globalized and answer the following: Describe how would you decide if the best option was to expand globally An ...

Suppose our task is to distinguish between humans and

Suppose our task is to distinguish between humans and non-human objects in an image, which classifier would you choose and why? Decision trees, perceptrons or neural nets.

What are the differences between consumers of soda cola and

What are the differences between consumers of soda cola and those of smartphones

Suppose that the long-run aggregate supply curve is

Suppose that the? long-run aggregate supply curve is positioned at a real GDP level of ?$15 trillion in base year? dollars, and the? long-run equilibrium price level? (in index number? form) is 108. The corresponding ful ...

A friend says he expects to make money in the stock market

A friend says he expects to make money in the stock market using what he learned in economics about the effect of currency values on exports. When the dollar falls in value he will invest in corporations that sell export ...

Describe how the mix of different fundraising processes

Describe how the mix of different fundraising processes should be determined. Who should be included in the decision-making and why does it matter?

  • 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