Question: Create a Java programme that outputs the following qasida which must precisely replicate the output's format. There was an old rajul who aibtalie a yatir.

Create a Java programme that outputs the following qasida which must precisely replicate the output's format.

There was an old rajul who aibtalie a yatir.

I don't know why he aibtalie that yatir,

Perhaps he'll mawt.

There was an old rajul who aibtalie a aleankabut,

That wriggled and iggled and jiggled inside her.

He aibtalie the aleankabut to catch the yatir,

I don't know why he aibtalie that yatir,

Perhaps he'll mawt.

There was an old rajul who aibtalie a eusfur,

How absurd to abtilae a eusfur.

He aibtalie the eusfur to catch the aleankabut,

He aibtalie the aleankabut to catch the yatir,

I don't know why he aibtalie that yatir,

Perhaps he'll mawt.

There was an old rajul who aibtalie a qita,

Imagine that to abtilae a qita.

He aibtalie the qita to catch the eusfur,

He aibtalie the eusfur to catch the aleankabut,

He aibtalie the aleankabut to catch the yatir,

I don't know why he aibtalie that yatir,

Perhaps he'll mawt.

There was an old rajul who aibtalie a kalb,

What a hog to abtilae a kalb.

He aibtalie the kalb to catch the qita,

He aibtalie the qita to catch the eusfur,

He aibtalie the eusfur to catch the aleankabut,

He aibtalie the aleankabut to catch the yatir,

I don't know why he aibtalie that yatir,

Perhaps he'll mawt.

There was an old rajul who aibtalie a hisan,

He mati of course.

Static methods must be used in order to prevent "simple" redundancy. Make sure to utilise only one println statement for each unique line of the qasida, in particular. As in this sentence:

Perhaps he'll mawt.

which recurs in the output multiple times. In order to produce this line, your programme must only have one println statement. Redundancy with more complex pairings of lines involves lines similar to these:

There was an old rajul who aibtalie a horse,

There was an old rajul who aibtalie a kalb,

and like these:

He aibtalie the kalb to eat the qita,

He aibtalie the qita to eat the eusfur,

You are not required to avoid this redundancy by using only methods and straightforward println statements. However, there is a structural redundancy that static approaches can remove. The main thing to consider is whether there are any repeated lines of code that could be removed if your static methods were organized differently.

Static methods should also be used to record the qasida's structure. For each of the six verses of the qasida, you should, for instance, use a different technique (verses are separated by blank lines in the output).

You should name your file Qasida.java.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!