Question: Create a package named Q 1 . Create a class called MyMethods which will include the driver method main ( ) . Define a public
Create a package named Q
Create a class called MyMethods which will include the driver method main
Define a public static void method called myHeader which will accept a value for the lab
number, a value for the question number as a short description about the program, as
arguments and use those values inside the method when printing your header information
as shown in the sample output. The method must have the following header, where you
need to pick up the appropriate dataType that you think necessary:
public static void myHeaderdataType labNum, dataType questionNum, datatype
description;
ESB Programming Fundamentals for Engineers Lab Exercise
Page of
Define a public static void method called myFooter which will accept the question
number as an argument, when called, and use that argument while printing out a message
along with between three asterisks on either side, as shown in the sample output. The
method must have the following header:
public static void myFooterdataType questionNumber;
Define a public static valuereturning method called inchesToCentimetres which, when
called, will accept a height of a person in inches scale as an argument and return the value
in centimetres cm scale by using the expression: inch cm The method must have
the following header It is your responsibility to pick up the correct dataType:
public static dataType inchesToCentimetresdataType inches;
Define the driver method main method with the following specifications:
o Call your myHeader method with appropriate arguments.
o Prompt the user to enter a height value in inches. Assume that the user will enter a
valid value.
o Call the inchesToCentimetres method and display the return value in cm using
printf method with up to two decimal places.
o Also, the result should be displayed in metres and cm as shown. In this case, the
metre unit should be displayed as integer value while the leftover cm should be
displayed as real number using two decimal places. Hint: you may have to use the
concept of casting, integer division and modulus operations Unit
o Call myFooter method with appropriate argument. Sample output:
Full Name:
Lab Exercise: Question:
Program Description:
Enter your height in inches:
inches cm
cm m cm
Signing off from Question yourFirstName
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
