Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. A hydrofoil is a lifting surface, or foil, that operates in water. They are similar in appearance and purpose to airfoils used by airplanes.

image text in transcribedimage text in transcribedimage text in transcribed

2. A hydrofoil is a lifting surface, or foil, that operates in water. They are similar in appearance and purpose to airfoils used by airplanes. Boats that use hydrofoil technology are also simply termed hydrofoils. As a hydrofoil craft gains speed, the hydrofoils lift the boat's hull out of the water, decreasing drag and allowing greater speeds. Write a class named hydrofoils that has the following fields. MANUFACTURER - The manufacturer field references a String object that holds the manufacturer of the hydrofoil. NAME - The name field references a String object that holds the name of the hydrofoil. YEAR_MADE- The veanumade field is an int that holds the manufacturing year when the hydrofoils were made. SPEED - The speed field is an int that holds the current speed of the hydrofoil. In addition, the class should have the following constructor and other methods. Constructor - The constructor should accept the hydrofoil's manufacturer, name, year made and initial speed as arguments. These values should be assigned to the object's manufacturer, name, and we made fields. The constructor should also assign a chosen initial speed to the speed field. Accessors and Mutators - Appropriate accessor and mutator methods should get and set the values stored in an object's manufacturer, name, seal made and speed fields. The accelerate method The accelerate method should add 10 to the speed field each time it is called. The decelerate method The decelerate method should subtract 5 from the speed field each time it is called. The checklitt method - The shacklit check the current speed of the hydrofoil to determine whether the hull is in the water or lifted out of the water. Demonstrate the class in a program that creates these two hydrofoil objects: 1. Name: Freedom Manufacturer: Lockheed Year Made: 2008 Initial Speed (knots): the 1and 3 digit of your Matric Number. 2. Name: Independence Manufacturer. General Dynamics Year Made: 2010 Initial Speed (knots): the sum of the 4" and 6 digit of your Matric Number. ** if your matric number is 1715946, then the Initial Speed for Freedom is 2 & for Independence is 9. Once the hydrofoils are created display their details and then call the accelerate method five times for each object. After each call to the accelerate method, get the current speed of the hydrofoils, and display it. Then call the decelerate method five times. After each call to the decelerate method, get the current speed of the hydrofoil, and display it. At the end of the test run, determine whether the hydrofoil hull is in the water of lifted above it. Assume that the minimum speed to lift the boat's hull out of the water is at least 30 knots. Here is a sample run: You have just created a hydrofoil object Freedom made by Lockheed in the Year 2008 Current speed of the Freedom is: 11 Current speed of the Freedom is: 21 Current speed of the Freedom is: 31 Current speed of the Freedom is: 41 Current speed of the Freedom is: 51 Current speed of the Freedom is: 46 Current speed of the Freedom is: 41 Current speed of the Freedom is: 36 Current speed of the Freedom is: 31 Current speed of the Freedom is: 26 At the present speed of 26 knots, the Freedom's hull is in the water You have just created a hydrofoil object Independence made by General Dynamics in the Year 2010 Current speed of the Independence is: 30 Current speed of the Independence is: 40 Current speed of the Independence is: 50 Current speed of the Independence is: 60 Current speed of the Independence is: 70 Current speed of the Independence is: 65 Current speed of the Independence is: 60 Current speed of the Independence is: 55 Current speed of the Independence is: 50 Current speed of the Independence is: 45 At the present speed of 45 knots, the Independence's hull is is above water

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago