Consider a class called contact to use in a mobile phone


(1) Consider a class called Contact to use in a mobile phone contact list.

Draw a UML diagram for this class with three attributes of your choosing and accessor and mutator methods for each attribute. (use | and --- for the boxes)

(2) A program contains the following method definition:

public static char gender(int num)

{ char letter;

if(num == 1) letter = ‘m’;

else letter = ‘f’;

return letter;

}

Write a statement that passes 2 to this method and assigns its return value to a variable named sex.

Request for Solution File

Ask an Expert for Answer!!
Other Subject: Consider a class called contact to use in a mobile phone
Reference No:- TGS0625933

Expected delivery within 24 Hours