Java application that defines a class boat

Assignment Help Business Management
Reference no: EM131695690

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();

   }

}

Reference no: EM131695690

Questions Cloud

Describe the multiple-scenario approach : A random sample of 166 firms in the Fortune top 1,000 was chosen, and 59 of the firms replied that they used the multiple-scenario approach.
Speculate on why the auditors did not detect the fraud : Dixon, Illinois: Using Public Funds to Support a Show Horse Operation. Speculate on why the auditors did not detect the fraud
Data integrity and data consistency : 1. Compare and contrast the differences between data integrity and data consistency. Please provide an example for each one.
What is the approximate p-value : According to an article in the New York Times, new Internet dating Web sites use sex to advertise their services.
Java application that defines a class boat : 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
Current average price for an independent television station : Executives at Gammon & Ninowski Media Investments, a top television station brokerage, believe that the current average price for an independent television.
Discuss gender issues in the working environment : Do you think that there are still some gender issues in the working environment. How can the issue be resolved in the future
Determine the machine asset value at the end of year : Health Guard Labs recently purchased a new pill dispensing machine. Determine the machine asset value at the end of year one
How does proximity influence attractiveness : What attributes make someone attractive. How does proximity influence attractiveness. Are people with similar interests more or less attractive than people

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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