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

In a one-page paper, analyze legal issues related to healthcare

In a one-page paper, analyze legal issues related to healthcare financing, including private and public insurance programs, health maintenance organizations (HMO), and the Employee Retirement Income Security Act (ERISA) by:a. Describing the offices that regulate health insurance.b. Describing regulations unique to managed health care organizations and the history behind those

In six slides explain the relationship between the N&T KM

 In six slides explain the relationship between the N&T KM model and how it works with the KM cycle tasks to create shared information. Use Dawn as your example. Ensure you weave Dawn’s example across all 4 quadrants to show how her knowledge would flow from quadrant to quadrant and

Find one piece of local (to North Carolina) research that

Find one piece of local (to North Carolina) research that you plan on using in your final Argument paper. Where did you find this source? Why is it credible? How do you plan to use it in your argument?  Please post your response of 200 words to the discussion board and respond to another student’s post (200 words).

Explore the impact of externalities on sustainability factors using a

Complete this assignment after reviewing the readings below. A brief history of the gas tax in the United States http://time.com/4803516/gas-tax-history/ It’s been 25 years since the federal gas tax went up https://www.npr.org/2018/10/05/654670146/its-been-25-years-since-the-federal-gas-tax-went-up Should we tax people for being annoying? http://www.nytimes.com/2013/01/13/magazine/should-we-tax-people-for-being-annoying.html?_r=0 Harvard economic professor Greg Mankiw’s recommendation for a gas tax

Delegation in Practice What does the New York State Board

Delegation in Practice What does the New York State Board of Nursing say about Unlicensed Assistive Personnel and their role, and the role of the Registered Nurse? Describe the responsibilities of the Registered Nurse when delegating patient care tasks. How does the ICU environment differ from a general medical-surgical unit

Do you agree that a business proposal is created for

   Do you agree that a business proposal is created for a specific request or opportunity? If you agree, please explain why?  Do you agree that a proposal is not a business plan? If you agree, please explain why?  Do you agree a proposal is not prepared as a cold

Initial Post In your initial post, please identify the current

  Initial Post In your initial post, please identify the current trends of opioid addiction in your state and region (Massachusetts). Provide demographic data for incidence and occurrence and list what community resources are available to you. Reply Posts Reply to one of your classmates, identifying strategies that they, as

Identify a task that you would need to perform in

Identify a task that you would need to perform in your current career or future career and explain how you would apply the knowledge you have learned in this course to succeed at performing the task in a real-world scenario. REPLY TO MY CLASSMATE’S DISCUSSION TO THE ABOVE QUESTION AND

400 words In the Ancient Greek world (the world of

 400 words  In the Ancient Greek world (the world of Socrates, Plato, and Aristotle, often regarded as the birthplace of philosophy) a “symposium” was a banquet held after a meal, an “after party” of sorts that usually included drinking, dancing, recitals, and engaging conversations on the topics of the day.

Critical Response paper

What is Social Darwinism (explain in your own words, without using outside sources) and what role does Social Darwinism play in Charles Dickens’s A Christmas Carol? Granted, Charles Darwin published his Origin of Species in 1859, a few years after Charles Dickens published A Christmas Carol in 1843, but to

Write a short (50-100-word) response for each question posed below.

Write a short (50-100-word) response for each question posed below. Submit this as a Microsoft Word document. Define CAM. Describe the patient who uses CAM the most. List some common misconceptions about CAM. Identify methods of including the use of CAM in patient education. Discuss the safe use of CAM.

Being aware of how attackers use pretexting to gather information,

  Being aware of how attackers use pretexting to gather information, you need to write a policy describing the procedures our fictitious company will use to verify the identity of those requesting information.  Part A: Using ONLY your readings for this week as well as the videos and supplemental reading

 1- The professor ask me also this question.Are you developing a survey or using one that is available? What would be some of the problems with using your own survey related to measurement? 2-Please Nursing Assignment Help

 1- The professor ask me also this question.Are you developing a survey or using one that is available? What would be some of the problems with using your own survey related to measurement?  2-Please make me a response to this peer post. Has to be no less than 150 words. 

Consider the following hypothetical: Ed contracted with Becky to build

Consider the following hypothetical: Ed contracted with Becky to build a house. Immediately prior to that meeting, Becky was so nervous that she drank an entire bottle of champagne and she does not remember all of the details of the meeting. Shortly before the closing, Ed met with Becky, accused

Describe Kübler-Ross’s theory of dying. Evaluate the usefulness of her

Describe Kübler-Ross’s theory of dying. Evaluate the usefulness of her theory.  Kübler-Ross’s theory of dying consists of five steps: Denial, anger, bargaining, depression, and acceptance when patients learn they are terminally ill. Denial is when the patient is in rejection about the diagnosis, the patient is in disbelief they are

Parts 1, 2, 3 and 4 have the same questions.

  Parts 1, 2, 3 and 4  have the same questions. However, you must answer with references and different writing, always addressing them objectively, as if you were different students. Similar responses in wording or references will not be accepted. APA format 1) Minimum 9 pages  (No word count per page)- Follow

Unit 5 DB: Understanding What-If Analysis (CIS250 Advanced Excel) Make

   Unit 5 DB: Understanding What-If Analysis (CIS250 Advanced Excel) Make sure to review Chapter 6 before posting your discussion. The two worksheets, DeliScenario.xlsx or OutageCosts.xlsx, are using one of the What-If Analysis tools: Deli worksheet is using the Scenario Manager. The Outage worksheet is using a One Variable Data