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

  Create a sense of meaning and purpose for yourself

Identify how your personal model of leadership helps you create a sense of meaning and purpose for yourself, others, organizations, and society.

  Whats interesting about charismatic leadership

Charismatic Leadership/stewardship/servant relationship and what's interesting about charismatic leadership and the topics under it?

  What are the required basic financial statements

Which financial statement do you believe is more important to the local citizen, and why?

  Identify the types of execution styles you are using

Select a brand and target audience and design two advertisements, each using a different execution style to deliver the same message to the target audience but in a different way.- Identify the types of execution styles you are using and present yo..

  Statute that prohibits the advertising of video games

The Wisconsin state legislature enacts a statute that prohibits the advertising of video games "because the games might be harmful to minors."

  Discussion on statute of frauds

Damon, for consideration, orally make promise to pay Gary $300 a month for as long as Gary lived, with payments to be made on the 1st day of every month.

  Evaluate where the organization excels in design thinking

Evaluate where the organization excels in design thinking. Detail where the organization needs improvement. Make specific recommendations that the organization can undertake to improve design thinking and innovation.

  Tiebout model of local public good provision

Explain why, in the Tiebout model of local public good provision, efficiency will not be achieved if there are externalities across city borders from the public

  Organizational behavior - leadershipleadership focusat the

organizational behavior - leadershipleadership focusat the beginning of 2009 we are under new leadership in our federal

  Recognize the nature of service

Recognize the nature of service. Distinguish the roles and positions in the dining room.

  Analyze how your company applies compensation practice

Analyze how your company applies compensation practice to determine the positive or negative impact to the company and its stakeholders.

  Do employees have either a moral or legal right to park cars

In your view, do employees have either a moral or a legal right to park cars with guns in them in the company parking lot? What do you believe should be the property rights and safety concerns of employers?

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