Question
Code the working java application based on the given situational requirements. IMAGE TRANSCRIPT: Create a class named AA1_Section_FebLove_Lastname that has the following features: Accepts love
Create a class named AA1_Section_FebLove_Lastname that has the following features:
- Accepts love expressions (sentences) and displays the following messages after counting the number of sentences in the said letter (Hint: count the number of periods to count the number of sentences in the letter). Assume that the love sentences will always be terminated with a period.
- 1 to 2 sentences: "Friend Zone SECTION" o 3 to 4 sentences: "Romantic SECTION" o 5 or more sentences: "Old Soul SECTION"
- Call the Section Lastname class.
- From the AA1_Section_FebLove_Lastname class, call another class named Section_Lastname that has the following features:
- Accept and count the number of characters in the boy's name: (i.e. Jamiel)
- Accept and count the number of characters in the girl's name: (i.e. Jameela)
- Display the total number of characters of both the names of the boy and the girl _ Jamiel + Jameela is 6 characters + 7 characters = 13 characters
- Count the similar letters that can be found in both the names of the boy and the girl (disregard capital or UPPERCASE letters)
- Jamiel (j=1, a=1, m=1, i=0, e=1, 1=1, Total=5)
- Jameela (J=1, a=2, m=1, e=2, l=1, Total=7)
- Total Similar Characters: 12
- Compute the love percentage of the boy: "Total similar characters of the boy's name divided by total number of characters of both the names of the boy and the girl. Then get the percentage. (5/13 = 38% love percentage of boy)
o Compute the love percentage of the girl:
- Total similar characters of the girl's name divided by total number of characters of both the names of the boy and the girl. Then get the percentage. (7/13 = 54% love percentage of girl)
- Compute the love percentage if considered as a couple or combined: Total similar characters of the names of the boy and the girl divided by total number of characters of both the names of the boy and the girl. Then get the percentage. (12/13 = 92% love percentage as a couple)
Sample Run:
Type in your love expressions:
You may think I am a sentimental fool to write you this letter. Happy Valentine's Day to a very special friend. To me, it's a day when we express how much we appreciate all the special people in our lives.
Total number of sentences: 3
Romantic
__________________________
Welcome to Love Percentage
__________________________
Enter boy's name: Jamiel
Enter girl's name: Jameela
Total the number of characters of the boy's name: 6
Total the number of characters of the girl's name: 7
Total number of characters of the names of the boy and the girl: 13
Similar letters found in both the names of the boy and the girl:
Boy: Jamiel
j=1
a=1
m=1
=0
e=1
1=1
Total=5
Girl: Jameela
i=1
a=2
m=1
e=2
1=1
Total = 7
Total Similar Characters: 12
Love Percentage of Boy:
5/13 = 38% love percentage of boy
Love Percentage of Girl:
7/13 = 54% love percentage of girl
Love Percentage as a couple:
12/13 = 92% love percentage of as a couple
Note: Percentages may be more than 2 decimal places or a whole number as shown in the example.
However, make sure that floating point numbers (float or double is used as data type in the computations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started