1 provide java code for a simple class of your choice be


1. Provide Java code for a simple class of your choice. Be sure to include at least one constructor, two methods and two fields. The fields should be private.

Create a test class to construct and call the methods of your class.

Describe your class and demonstrate your code functions properly.

Respond to other student postings by testing their Unique classes.

2. Discuss about the benefit of using a method. How do you define a method?  How do you invoke a method?

How is an argument passed in a method? Can the argument have the same name as its parameter?

What is method overloading? It is permissible to define two methods that have the same name but different parameter types?

3. Let's design and implement some methods to exercises the methods.

a) Provide Java code for a method that would calculate the perimeter of a rectangle. Be sure to include an example call to your method and explain the code you developed. The program prompts the user to enter the width and height of the rectangle.

b) Provide Java code for a method that would convert Fahrenheit to Celsius. Be sure to include an example call to your method and explain the code you developed. Use formula C=(F-32)*5/9.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: 1 provide java code for a simple class of your choice be
Reference No:- TGS01691954

Now Priced at $30 (50% Discount)

Recommended (92%)

Rated (4.4/5)