You are on page 1of 3

Revision Assignment

1. Write a program to that has utilities functions (methods). E.g. • Meter to


inch
• Kilometer to feet
• Celsius to Fahrenheit
• Gigabyte to Megabyte
• Kilobytes to bytes
• Gram to kilogram
• Seconds to minutes,
• Liter to milliliter
• You can add more conversion

Hints
Create a class Utilities that has different methods for unit conversion. Eg.

public class Utilities {


public void convertMeterToInch (double meter){ double
inch = meter * 39.3701;
System.out.println(meter + “m = “+inch +“ inches”); }

// Add other methods for conversion


}

Now, create object of Utilities class and call each of the methods and see the result.
2. Suppose you need to design a hotel booking application that has some functionalities. How
would you create a simple program with appropriate class name and methods?

You might also like