Question: Create an object-oriented Java program that will ask the user for 2 names (a boy's and a girl's). Compare the number of letters of
Create an object-oriented Java program that will ask the user for 2 names (a boy's and a girl's). Compare the number of letters of each of the names and check whose is greater in number. Follow the given requirements carefully: 1. Two (2) classes - MyMainClass & OtherClass 2. One (1) Constructor - sets the name of the girl and the boy (for the object) 3. Two (2) Accessors - getBoyNumLetters() & getGirlNumLetters (returns number of letters) 4. One (1) Mutator - check() (to check who has the higher number of letters) ATTRIBUTES: girl (String) boy (String) girlNum (int) boyNum(int) FOLLOW THE SAMPLE OUPUT: Enter a name of a girl: Elsa Enter a name of a boy: Alexander Elsa has 4 letters in her name. Alexander has 9 letters in his name. The boy's name has more letters than the girl's. Plagiarized work will be marked zero. Activa Go to S
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
