Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need task4 answer thank you so much Aims and Objectives This laboratory has been designed to help you e learn how to define classes which

need task4 answer thank you so much image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Aims and Objectives This laboratory has been designed to help you e learn how to define classes which are instantiated in the main method of an application; gain further practice with defining methods which are only used within a class (object) and those which are intended to be invoked using an object reterence. Getting Started Create a directory called prac4 (in your cpl directory) and make it your current working directory All programs wil be created from scratch and so there are no files to copy. Start jGrasp and be prepared to write complete class definitions. The program will contain "boat objects. Task 1 On completion of this task you will have demonstrated the ability to construct a simple class definition containing instance variables and methods, and a class containing only a main method which creates an instance of a class (an object) and accesses instance variables, and invokes methods, through a reference to the object Use jGrasp to create a new file called BoatMaker_16.java containing two class definitions 1. Boat this class contains: i. an instance variable, regNum, of type int initialised to -1 ii. an instance variable, bClass, of type String initialised to "unknown" iii. an instance variable name of type String which is initialised to "unknown" iv. a method print which does not return a value (i.e. the return type is void), has no formal parameters and prints the boat's name, class and registration number. in the following format Boat name, Class-bClass, Registration #-KAregNum where the words in italics should be replaced with the values of the corresponding instance variables. 2. BoatMaker 16 -this class should contain a main method which performs the following actions

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago

Question

Explain the different types of Mergers.

Answered: 1 week ago

Question

What is dividend payout ratio ?

Answered: 1 week ago