Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Science And Engineering Of Materials

Authors: Donald R. Askeland, Wendelin J. Wright

7th Edition

1305076761, 978-1305076761

More Books

Students also viewed these Programming questions