SlideShare a Scribd company logo
1 of 3
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!
Hi! can everyone help me solve this java problem write code tha

More Related Content

Similar to Hi! can everyone help me solve this java problem write code tha

Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
Java Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedJava Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedSvetlin Nakov
 
Anjalisoorej imca133 assignment
Anjalisoorej imca133 assignmentAnjalisoorej imca133 assignment
Anjalisoorej imca133 assignmentAnjaliSoorej
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfarchiesgallery
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaanwalia Shaan
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerAiman Hud
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...Hiraniahmad
 
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
import java.util.Scanner;Henry Cutler ID 1234  7202.docximport java.util.Scanner;Henry Cutler ID 1234  7202.docx
import java.util.Scanner;Henry Cutler ID 1234 7202.docxwilcockiris
 
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part IIIntro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part IIBlue Elephant Consulting
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfakaluza07
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfmayorothenguyenhob69
 

Similar to Hi! can everyone help me solve this java problem write code tha (18)

Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
Java Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedJava Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting Started
 
gdscpython.pdf
gdscpython.pdfgdscpython.pdf
gdscpython.pdf
 
Anjalisoorej imca133 assignment
Anjalisoorej imca133 assignmentAnjalisoorej imca133 assignment
Anjalisoorej imca133 assignment
 
Hello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdfHello. This program has to be done in Eclipse(Program used to write .pdf
Hello. This program has to be done in Eclipse(Program used to write .pdf
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
Python in details
Python in detailsPython in details
Python in details
 
Star pattern programs in java Print Star pattern in java and print triangle ...
Star pattern programs in java Print Star pattern in java and  print triangle ...Star pattern programs in java Print Star pattern in java and  print triangle ...
Star pattern programs in java Print Star pattern in java and print triangle ...
 
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
import java.util.Scanner;Henry Cutler ID 1234  7202.docximport java.util.Scanner;Henry Cutler ID 1234  7202.docx
import java.util.Scanner;Henry Cutler ID 1234 7202.docx
 
Intro To C++ - Class 3 - Sample Program
Intro To C++ - Class 3 - Sample ProgramIntro To C++ - Class 3 - Sample Program
Intro To C++ - Class 3 - Sample Program
 
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part IIIntro To C++ - Class 03 - An Introduction To C++ Programming, Part II
Intro To C++ - Class 03 - An Introduction To C++ Programming, Part II
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdf
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
 

More from simba35

Symbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docxSymbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docxsimba35
 
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docxSYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docxsimba35
 
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docxSynthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docxsimba35
 
Sustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docxSustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docxsimba35
 
Sustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docxSustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docxsimba35
 
Suppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docxSuppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docxsimba35
 
Supreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docxSupreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docxsimba35
 
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docxSuppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docxsimba35
 
Suppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docxSuppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docxsimba35
 
Suppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docxSuppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docxsimba35
 
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docxSuppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docxsimba35
 
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docxSuppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docxsimba35
 
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docxSupply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docxsimba35
 
Suppose a zoo wants a C++ program to keep track of its animals and t.docx
Suppose a zoo wants a C++ program to keep track of its animals and t.docxSuppose a zoo wants a C++ program to keep track of its animals and t.docx
Suppose a zoo wants a C++ program to keep track of its animals and t.docxsimba35
 
Support your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docxSupport your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docxsimba35
 
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docxSummer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docxsimba35
 
Supply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docxSupply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docxsimba35
 
SummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docxSummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docxsimba35
 
Supported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docxSupported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docxsimba35
 
Summarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docxSummarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docxsimba35
 

More from simba35 (20)

Symbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docxSymbols of culture are called artifacts. Artifacts are the most visi.docx
Symbols of culture are called artifacts. Artifacts are the most visi.docx
 
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docxSYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
SYLLABUS ACC423 Intermediate Financial Accounting III Copyrig.docx
 
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docxSynthesis Assignment Instructions and RubricSynthesis Essay..docx
Synthesis Assignment Instructions and RubricSynthesis Essay..docx
 
Sustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docxSustainable Development Project OutlineFor the first step in the D.docx
Sustainable Development Project OutlineFor the first step in the D.docx
 
Sustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docxSustainable Development Project Rough Draft After the outline, s.docx
Sustainable Development Project Rough Draft After the outline, s.docx
 
Suppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docxSuppose you work as a human resource (HR) executive at Total Solutio.docx
Suppose you work as a human resource (HR) executive at Total Solutio.docx
 
Supreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docxSupreme Court Responsiveness to Public Opinion    Please respond.docx
Supreme Court Responsiveness to Public Opinion    Please respond.docx
 
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docxSuppose we have an EOQ model as follows[1]  weekly demand = 100.docx
Suppose we have an EOQ model as follows[1]  weekly demand = 100.docx
 
Suppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docxSuppose that you are currently employed as an Information Security M.docx
Suppose that you are currently employed as an Information Security M.docx
 
Suppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docxSuppose the Cincinnati Reds increased the price of their tickets and.docx
Suppose the Cincinnati Reds increased the price of their tickets and.docx
 
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docxSuppose that there are two (2) candidates (i.e., Jones and Johns.docx
Suppose that there are two (2) candidates (i.e., Jones and Johns.docx
 
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docxSuppose that the reserve ratio is .25, and that a bank has actual re.docx
Suppose that the reserve ratio is .25, and that a bank has actual re.docx
 
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docxSupply side Options Quiz #4Requirements Arial 11’ 720 word .docx
Supply side Options Quiz #4Requirements Arial 11’ 720 word .docx
 
Suppose a zoo wants a C++ program to keep track of its animals and t.docx
Suppose a zoo wants a C++ program to keep track of its animals and t.docxSuppose a zoo wants a C++ program to keep track of its animals and t.docx
Suppose a zoo wants a C++ program to keep track of its animals and t.docx
 
Support your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docxSupport your statements with examples and scholarly references. Reme.docx
Support your statements with examples and scholarly references. Reme.docx
 
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docxSummer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
Summer 2014 PHIL 1171 Ethics Final Essay Questions 1 Part One Ess.docx
 
Supply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docxSupply Chain.   The term  is used rather freely these days, but wh.docx
Supply Chain.   The term  is used rather freely these days, but wh.docx
 
SummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docxSummaryIn your first paper, you will provide the pros and cons of .docx
SummaryIn your first paper, you will provide the pros and cons of .docx
 
Supported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docxSupported by the readings from Modules 10 and 11 (attached), and a.docx
Supported by the readings from Modules 10 and 11 (attached), and a.docx
 
Summarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docxSummarize your financial situation and plans. Be sure to include pla.docx
Summarize your financial situation and plans. Be sure to include pla.docx
 

Recently uploaded

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Recently uploaded (20)

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 

Hi! can everyone help me solve this java problem write code tha

  • 1. 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;
  • 2. 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!