Write comments before every line in your program

Assignment Help Computer Engineering
Reference no: EM132085667

some one tried to answer this question and the programm did not work. any expert out there ', thanks i appreciate it.

7.11111111 program requirements

As a reminder, you should be including comments in your programs . Comments should be placed periodically throughout your program. Your comments should explain the logic of what you are doing.

You do not need to write comments before every line in your program. Instead, you should add comments at the beginning of a section of code to explain what the next few lines are trying to accomplish.

Pay close attention to the directions!! Make absolutely certain that you are doing exactly what the assignment asks you to do. If you don't understand the problem, make sure to ask your instructor or an assistant.

Part 1

Begin by creating a new Java project.

Create a new Java class inside your project folder.

The name of the class should be: TwelveDays

Write a java application program that will print the verses of the song The Twelve Days of Christmas to the screen. In this song, each verse adds one additional line of output to the song.

The first verse should print the following:

On the 1st day of Christmas my true love gave to me
A partridge in a pear tree.

The second verse should print the following:

On the 2nd day of Christmas my true love gave to me

Two turtle doves, and

A partridge in a pear tree.

The third verse should print the following:

On the 3rd day of Christmas my true love gave to me

Three French hens,

Two turtle doves, and

A partridge in a pear tree.

There are a total of 12 verses to the song, and each verse will add one additional line to the song. The final verse should print the following:

On the 12th day of Christmas my true love gave to me

Twelve drummers drumming,

Eleven pipers piping,

Ten lords a leaping,

Nine ladies dancing,

Eight maids a milking,

Seven swans a swimming,

Six geese a laying,

Five golden rings,

Four calling birds,

Three French hens,

Two turtle doves, and

A partridge in a pear tree.

After each verse is printed, ask the user to press "Enter" to continue.This will allow your program to pause after each verse to give the user time to read the verse before moving on to another.
You should NOT ask the user to press "Enter" after the last verse.

Program Restrictions

You CANNOT write tons of print statements to simply print out the entire song.

Your program MUST include a loop. The loop should be designed to repeat exactly 12 times. Each trip through the loop should print one verse to the screen.

Inside the loop, you MUST use a switch statements to control the lines that are printed to the screen.< >For the statement "On the Xth day of Christmas my true love gave to me":Begin by printing "On the X" where X is the value of your loop counter.Next, use a switch statement to print "st" or "nd" or "rd" or "th" to the screen. At this point, depending on the value of the loop counter, this will cause one of the following lines to be printed:
On the 1st
On the 2nd
On the 3rd
On the 4th
etc.Now, print the rest of the line to the screen:

" day of Christmas my true love gave to me"After the first line has been printed, use another switch statement to control which lines of the verse are printed to the screen.

Each case statement is allowed to contain a single println statement so that each case statement is printing a single line of output to the screen.

Reference no: EM132085667

Questions Cloud

Describe how the developer and you can make this tool easy : Explain the project's goals and indicate why you included the requirements, time frames, and necessary tasks that you did.
Themes that unify postcolonial literature : How British colonization affected literature, comment specifically on the themes that unify postcolonial literature?
Central focus of the play : Is it an effective technique that in Glaspell's "Trifles," Mrs. Wright is the central focus of the play but never appears on stage herself?
Increasingly frenzied mental state : How does Othello's language change and shift as a means to show his declining and increasingly frenzied mental state?
Write comments before every line in your program : Comments should be placed periodically throughout your program. Your comments should explain the logic of what you are doing.
Behn looks at the various options : In The Rover, Behn looks at the various options open to women throughout their lives - what options does Behn suggest are open to women?
How does the his character reflect this theme : Using the character of Oedipus as the basis for this answer, how does the his character reflect this theme?
Highlights of social issues : Can you tell me what highlights of social issues (child labor, womens rights, ect) in "to an athlete dying young"?
Explain why lt randomly should be fired if he reused : Lt. Will Crypt Randomly, a member of the Sealand1 Navy, is in charge of sending secret messages to his country's ships using one-time pads (OTP).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd