Question

Write a program that uses repetition and switch statements to print the song "The Twelve Days...

Write a program that uses repetition and switch statements to print the song "The Twelve Days of Christmas." One switch statement should be used to print the day (i.e., "first," "second," etc.).A separate switch statement should be used to print the remainder of each verse.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Write a program that uses repetition and switch statements to print the song "The Twelve Days...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • import java.util.Scanner; public class TwelveDays {    public static void main(String[] args)    {       final...

    import java.util.Scanner; public class TwelveDays {    public static void main(String[] args)    {       final int MAX = 12;       int lastDay = 0; //last day for the song, user will update       Scanner scan = new Scanner(System.in);       //Get the last day and use input validation //Begin 1st while       {       }                     int day = 1;      //loop control variable for song verses       //Begin 2nd while       {          //Output: "On the" + day...

  • Write a program that will prompt the number of shipping days as well as the day...

    Write a program that will prompt the number of shipping days as well as the day of the week an item that has been ordered may arrive. - use a switch statement to assign the day of the week as well as the number of the day (Sun = 0, mon = 1, etc.) - use another switch statement and modulus operator for finding a day of the week in the future

  • Write a program that uses String method regionMatches to compare two strings input by the user....

    Write a program that uses String method regionMatches to compare two strings input by the user. The program should prompt the user to enter two strings, the starting index in the first string, the starting index in the second string, and the number of characters to be compared. The program should print whether or not the strings are equal, (Ignore the case of the characters during comparison.) 四SAMPLE RUN #1: java StringCompare Highlight: None D Show Highlighted Only Interactive Session...

  • FOR RUBY: ----------------------------------- Create a program named Gifts. This program will describe the gifts for the...

    FOR RUBY: ----------------------------------- Create a program named Gifts. This program will describe the gifts for the 12 Days of Christmas. Each day describes one gift only. You cannot explicitly output the list of gifts, you need to get each day to display. For instance, for the 3rd day of Christmas, you display the gift for the 3rd day, then display the gift for the 2nd day, then the gift for the 1st day. Think about the logic for this.. in...

  • C++ Write a program that illustrates enumeration types. Define an enumeration type for the months of...

    C++ Write a program that illustrates enumeration types. Define an enumeration type for the months of the year. This should be global. Put it above the main program. Declare a variable of the enumerated type called month; Declare an array of unsigned integers called year[12] and initialize the array to the days in each month. (Just assume 28 for February.) 1. Write a loop that will progress from January through December printing out the days in each month. The index...

  • please complete this program. and make sure it works. code only written in c++ Thi s...

    please complete this program. and make sure it works. code only written in c++ Thi s project will introduce switch-statements and logical operators Write a program that uses a switch-statement and loops to decide how to assign airline passengers to a particular class of seating on a plane. Prompt for passengers to add, and then (for each passenger) prompt for both class, and destination. As each passenger is entered, print out what flight, and what class they are in. At...

  • Write them in python IDLE ***** 5. Average Rainfall Write a program that uses nested loops...

    Write them in python IDLE ***** 5. Average Rainfall Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations,...

  • Write a program that calculates the amount a person would earn over a 30-day period of...

    Write a program that calculates the amount a person would earn over a 30-day period of time if his/her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should display a table showing the salary for each day, and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the number of pennies. A sample output might look...

  • write code in C++ make it print just like like the above image. 5.12 (Drawing Patterns...

    write code in C++ make it print just like like the above image. 5.12 (Drawing Patterns with Nested for Loops) Write a program that uses for statements to print the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks ) should be printed by a single statement of the form cout (this causes the asterisks to print side by side). [Hint: The last two patterns require that each line begin with an appropriate...

  • Write a C++ program that uses: .selection constructs (if, if else, and switch) .multiway branches .looping...

    Write a C++ program that uses: .selection constructs (if, if else, and switch) .multiway branches .looping constructs (do and while loops) .Boolean expressions, bool and char types. 1. Develop a program that calculates charges for an Internet provider. The cost is determined by the amount of data used and the consumer plan. Package B (basic) is the most affordable if you plan on using < 20GB (20,000MB), however, if you consume more than 20GB (20,000MB) you are charged for each...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT