Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Alliteration

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Alliteration

Grade settings: Maximum grade: 100


Disable external file upload, paste and drop external content: Yes
Run: Yes Evaluate: Yes
Automatic grade: Yes Maximum execution time: 32 s
Tina and Louis played a game where one has to tell a letter and the other has to form a sentence
with all the words starting with the same letter(Case Insensitive).

The sentence should contain a minimum of 3 words and maximum any number of words. For a
minimum of three words, a score of 2 is given. Each additional word gets a score of 2.

Develop a Java application to check the rules of the game and print the score as given in the
sample input, output.

Note:

In the Sample Input / Output provided, the highlighted text in bold corresponds to the input given
by the user and the remaining text represents the output.

Adhere to the code template, if provided.

Sample Input 1

Enter the letter

She sells seashells

Sample output 1

Good,You get a score of 2

Sample Input 2

Enter the letter

Friendly fire fighting frogs fence for fabulous French food.

Sample output 2

Good,You get a score of 14


Sample Input 3

Enter the letter

Hannah's home has heater

Sample output 3

Good,You get a score of 4

Sample Input 4

Enter the letter

Jack and Jill

Sample output 4

No score

You might also like