Hi! Can everyone help me solve this java problem? Write

 Hi! Can everyone help me solve this java problem? 

Write code that prints: Ready! firstNumber … 2 1 Blastoff!
Your code should contain a for loop. Print a newline after each number and after each line of text.   

Ex: If the input is:  

3  

The output is:  

Ready! 

3

2

1

Blastoff!

This is my code: 

import java.util.Scanner;

public class ForLoops {

   public static void main (String [] args) {

      int firstNumber;

      int i;

      Scanner input = new Scanner(System.in);

      firstNumber = input.nextInt();

      System.out.println("Ready!n"+firstNumber);

      for (i=firstNumber;i>1; i--){

           firstNumber--;

           System.out.println(""+firstNumber);

       }

       System.out.println("Blastoff!");

   }

}

When running the program, my output only matches the two outputs as shown in the attached picture. The rest do not match. How can my code be the same as the expected output as in the attached image?

Thanks, everyone!

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

TALLAHASSEE, FLORIDA Help with this. Scenario Effective population health management

 TALLAHASSEE, FLORIDA Help with this. Scenario Effective population health management programs require healthcare providers to rely heavily on big data derived from both their own health IT systems, from their business partners, and from state and federal database sets that are available for providers. Providers, payers, and other stakeholders must

Chapter 8 Exercises [WLOs: 1, 2, 3, 4] [CLOs: 1,

  Chapter 8 Exercises [WLOs: 1, 2, 3, 4] [CLOs: 1, 2] Prior to beginning work on this assignment, review Chapter 8 in the textbook. You will complete this assignment in McGraw-Hill Connect. Click on the Load Week 4 – Assignment 2 in a new window button below when you

Social Work: Groups for Children and Adolescents

Imagine you are the leader of a therapeutic group for children and/or adolescents. Answer the following questions about your group. 1. Introduction 2.How would you approach facilitating a group for children or adolescents? How do the stages of human development impact your approach? Why? 3. Identify a theme or a

Research an article that features an identity model that aligns

  Research an article that features an identity model that aligns with your own identity. Using the article, do the following: Summarize the identity model you selected. Evaluate how you relate to the identity model based on your own experiences. Explain how your own identity might come into play when

Scenario: A 42-year-old man comes to the clinic with a

Scenario: A 42-year-old man comes to the clinic with a chief complaint of pain, redness, and swelling of his right calf. He states that he had been working in his yard using a string trimmer when the trimmer slipped and cut his leg. He cleaned the wound with water from

. Provide an example of the upside of risk and

  . Provide an example of the upside of risk and explain the concept. 2. Explain how Enterprise Risk Management varies from traditional risk management? 3. What are five examples of internal and external drivers of an organization’s risk culture? 4. Provide an example company, give a description of the

Pew Research Center conducted a survey (Links to an external

  Pew Research Center conducted a survey (Links to an external site.) a few years ago to test the average American’s basic political knowledge.  It asked questions concerning who serves as Speaker of the House, Secretary of State, and other political figures.  Only 47% of millennials could identify the party makeup

you interviewed the CEO and evaluated the organization to gain

you interviewed the CEO and evaluated the organization to gain insight into the CEO’s perspective of the organization. With this information, you will be able to assist the CEO and leaders in developing a strategic plan to encourage future success of the organization. Create a summary that you will present

Dubai’s/UAE traffic and road safety.

-summarize two journal articles. 1- https://www.tandfonline.com/doi/full/10.1080/17457300.2012.745575?scroll=top&needAccess=true 2-http://www.scielo.br/scielo.php?pid=S2238-10312013000200021&script=sci_arttext please make sure you view the full journal article Both summaries must INCLUDE 2 citations at least. INCLUDE in both summaries -Objective or topic of the article • A methodology of how they tested the objective • Results • Conclusion Critique #DubaisUAE #traffic

Review primary, secondary and tertiary prevention using Healthy People 2030

  Review primary, secondary and tertiary prevention using Healthy People 2030 as a guide for current initiatives related to the health of women and infants. Relate the three levels of prevention to the health of infants and at-risk women in your community. Describe how a prevention program could positively impact

Assignment Instructions Write a paper in which you discuss the

  Assignment Instructions Write a paper in which you discuss the various methods that you can use to convert numbers between number bases. Be sure to include a discussion of at least three different conversion methods and provide a conversion example for each method that you explain. You should discuss

Title Page: Research Assignment (use APA Format) Page 1 Write

  Title Page:  Research Assignment  (use APA Format) Page 1 Write an introductory paragraph to explain that you will be responding to the specific question above.  (one paragraph about 4 sentences) Two Reasons We Should Trust Government  (create this heading) #1  Offer two important reasons why we should trust government.