代写C代码 代做C程序 C辅导 C家教

远程写代码 Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

代写Java程序,可以远程写,也可以离线写,一对一手把手教学
JAVA CHARACTERISTICS 
Briefly elaborate any two distinguishing characteristics of Java with examples
(illustrate with figures if necessary).
PART B - PRINT SONG  
Notice that the following version of a children’s rhyme (which is also said to
be adapted from an Irish war song) has a cumulative structure. That is, the
verses are built from earlier verses usually by adding a line and sometimes by
varying repeated lines.
‘The Ants Go Marching’
The ants go marching one by one,
“Hurrah!, Hurrah!”
The ants go marching one by one,
“Hurrah!, Hurrah!”
The ants go marching one by one,
The little one stops to suck his thumb.
And they all go marching down,
To the ground, to get out, of the rain.
BOOM /'\ BOOM /'\ BOOM /'\
//Should be a blank line after each stanza ending with BOOM BOOM BOOM
…two…tie her shoe…
…three….climb a tree…
…four…shut the door…
…five…take a dive…
…six…pick up sticks…
…seven…pray to heaven…
…eight…check the gate…
…nine…check the time…
…ten…say “The End!”
Write a Java program in a project named Assignment1 that contains a class
named PrintSong with a main method that prints out the song The Ants go
Marching. The output should be exactly the same as the song above (in full
form, not in short form as written above to save space), including spelling,
capitalization, spacing, blank lines, and punctuation. For our amusement, you
must add an additional verse of your own making that follows the pattern of
1the other verses with eleven, but nothing offensive or unpleasant, please.
It is easy, of course, to write the program using a series of println statements
for each line of the song. But the goal the assignment is to take advantage of
the cumulative structure of the song to avoid redundancy.
That is, for each verse of the song, you should write a separate static method
that prints the whole verse. The main method will call these methods to print
the complete song. By looking at the structure of the song, however, you can
write additional methods that avoid the redundancy in the song.
For example,
The ants go marching one by one,
“Hurrah!, Hurrah!”
appears several times in the song. But your program should should have
only one println statement that includes that text string.
All but one or two methods must print more than just one line of the song. Do
NOT write a separate method for each unique line of the song and then
call these methods in order. You need to find several lines that appear
multiple times in the song and have a method that prints those lines. That
method can use println and/or call another method, which can, in turn, call
another method if need be, and so on.
Only consider whole lines of the song for redundancy. You can
ONLY consider redundant fragments of lines ONCE, such as "The ants go
marching”(not necessarily this one). You have to decide which
fragment/phrase will be the best since you can ONLY USE 1
FRAGMENT/PHRASE.
Specifically, you MUST NOT use the print statement and no variables,
parameters, conditionals, or loops.
Hint: Our solution uses X number of static methods in addition to
the main method. The main method includes println statements to print the title
and blank line, and calls methods to print each verse. The whole program
contains only one println statement for each unique line in the song.
Don't forget to include a screenshot of output and comments at the beginning
of program with assignment number, date, your name, email, the time it took to
write the program, and a brief description of the purpose of your program.
// JohnDoe
2//jd123@nyu.edu
// Assignment #0
// 20 May 2009
// 2 hours
//
// This program prints...
Items that we will look for when we grade include:
Is there a header with your information?
Does the program following programming conventions, such as
indentation and appropriate capitalization?
Does the program compile?
Does the program produce the exact same output as above?
Is there a method for each verse?
Are there redundant program statements (other than to print blank
lines)?
Has the structure of the song been used in the solution?
*******************************Happy Java-ing********************************
3

相关推荐