0% found this document useful (0 votes)
582 views2 pages

Alliteration

The document describes a word game where one player provides a letter and the other player forms a sentence using words that start with that letter. A Java application is to be developed to check the rules of the game and print the score. The rules are that the sentence must contain a minimum of 3 words starting with the given letter, and each additional word earns a score of 2. Sample inputs and outputs are provided showing correct sentences and their scores.

Uploaded by

Nikhil nani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
582 views2 pages

Alliteration

The document describes a word game where one player provides a letter and the other player forms a sentence using words that start with that letter. A Java application is to be developed to check the rules of the game and print the score. The rules are that the sentence must contain a minimum of 3 words starting with the given letter, and each additional word earns a score of 2. Sample inputs and outputs are provided showing correct sentences and their scores.

Uploaded by

Nikhil nani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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