Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CIS 1068 Assignment 2 Get You a Cat Due Monday, February 5 40 points Description

ID: 3880344 • Letter: C

Question

CIS 1068 Assignment 2 Get You a Cat Due Monday, February 5 40 points Description This program tests your understanding of using static methods and print1n statements. You should writea Java class called Song that should be saved into a file called Song. java. The program should produce as output the following song, which is a shortened version of a classic American folk song named, Bought Me a Cat Bought me a cat and the cat pleased me, I fed my cat under yonder tree. Cat goes fiddle-i-fee. Bought me a hen and the hen pleased me, I fed my hen under yonder tree. Hen goes chimmy-chuck, chimmy-chuck, Cat goes fiddle-i-fee. Bought me a duck and the duck pleased me, I fed my duck under yonder tree. Duck goes quack, quack, Hen goes chimmy-chuck, chimmy-chuck, Cat goes fiddle-i-fee. wHK @AA. 4 5 6 7 8 K.

Explanation / Answer

Java Code :

OUTPUT :

Bought me a cat and the cat pleased me,
I fed my cat under yonder tree.
Cat goes fiddle-i-fee

Bought me a hen and the hen pleased me,
I fed my hen under yonder tree.
Hen goes chimmy-chuck, chimmy-chuck
Cat goes fiddle-i-fee

Bought me a duck and the duck pleased me,
I fed my duck under yonder tree.
Duck goes quack, quack,
Hen goes chimmy-chuck, chimmy-chuck
Cat goes fiddle-i-fee

Bought me a goose and the goose pleased me,
I fed my goose under yonder tree.
Goose goes hissy, hissy,
Duck goes quack, quack,
Hen goes chimmy-chuck, chimmy-chuck
Cat goes fiddle-i-fee

Bought me a sheep and the sheep pleased me,
I fed my sheep under yonder tree.
Sheep goes baa, baa,
Goose goes hissy, hissy,
Duck goes quack, quack,
Hen goes chimmy-chuck, chimmy-chuck
Cat goes fiddle-i-fee

Bought me a pig and the pig pleased me,
I fed my pig under yonder tree.
Pig goes oink, oink,
Sheep goes baa, baa,
Goose goes hissy, hissy,
Duck goes quack, quack,
Hen goes chimmy-chuck, chimmy-chuck
Cat goes fiddle-i-fee

Process finished with exit code 0