questiona i describe the purpose of comments


Question:

(a) (i) Describe the purpose of comments when writing programs in Java.

(ii) Name the types of comments available and illustrate with simple examples.

(b) (i) What is the purpose of the ‘import' statement in Java programs?

(ii) With the help of an example show the syntax for importing one class from a package and all the classes from that package.

(c) (i) Describe the steps we need to write a Java application and to run the program. Also describe the tools required for each step.

(ii) Explain the difference between object declaration and object creation. Explain your answer with a suitable example.

(d) Write a Java application that accepts a person's weight and displays the number of calories the person needs in one day. A person needs 38 calories per Kg of body weight, so the formula would be

calories = bodyweight * 38;

Here you may use an input dialog from the class JOptionPane to request the user to enter the body weight and a message dialog to output the calories needed.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: questiona i describe the purpose of comments
Reference No:- TGS0373961

Expected delivery within 24 Hours