Professional Documents
Culture Documents
6.) Create a class Utility with three static methods add () the first
add () will take 2 arguments, add them, and return the result,
second add () will take 3 arguments, add them, and return the
result,third add () will accept an array of integers, add elements
in the array and return the result.
Invoke the all the three overloaded methods from main () within
the same class
7.)Draw the class diagram for the following and Develop a java
program that reads the number of kilograms of type double,
through console, converts it to pounds, displays the result.(HINT:
1kg = 2.2046 pounds )
8.) A Company launched app is to be launched. The task is to
store data of customer in a class with attributes customer Name,
Mobile, distance and fare. Write mutators for
a) name – has only characters
b) mobile – 10 digits
c) distance - must be a positive value (in terms of kms)
A method to compute fare at the rate of Rs.20 per km and
toString() method to print
data. Modularize to package level with main () in PassengerDemo
class to create an
object and obtain the data through console.