1. Write a java program that will display the numbers 1 to 100.Classify each

number as Odd or Even Numbers.

Expected Result:

1 is an Odd Number

2 is an Even Number

2. Define a class, MCMLength, to represent a length measured inmeters,

centimeters, and millimeters, each stored as integers. Includemethods to add

and subtract objects, to multiply and divide an object by aninteger value, to

calculate an area resulting from the product of two objects, and tocompare

objects. Include constructors that accept threearguments—meters, centimeters,

and millimeters; one integer argument in millimeters; one doubleargument in

centimeters; and no arguments, which creates an object with thelength set to

zero. Check the class by creating some objects and testing theclass operations.

thanks!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *