SlideShare una empresa de Scribd logo
1 de 3
Descargar para leer sin conexión
import java.util.*;
public class ReverseNames {
public static void main(String[] args) {
int count = 0;
int index = 0;
Scanner scan = new Scanner (System.in);
String prompt = ("Enter next name: ");
System.out.print("This program will ask you to enter some names. How many do you" +
" have?");
int amount = scan.nextInt();
String[] name = new String[amount];
String[] reverse = new String[amount];
System.out.print("You entered " +amount+ " as the size of your name list.");
System.out.println(" ");
for (index = 0; index < amount; index++)
{
System.out.print("Enter next name: ");
name[index] = scan.next();
}
System.out.println(" ");
System.out.println("The names in reverse and original order: ");
System.out.println(" ");
for (index = name.length - 1; index >= 0; index--)
{
System.out.println(name[index]+" ");
}
System.out.println(" ");
for (String names1 : name)
{
System.out.println(names1+" ");
}
}
}
This program will ask you to enter some names. How many do you have?3 You entered 3 as the
size of your name list. Enter next name: zoey Enter next name: zeb Enter next name: zena
The names in reverse and original order:
zena
zeb
zoey
zoey
zeb
zena
Solution
import java.util.*;
public class ReverseNames {
public static void main(String[] args) {
int count = 0;
int index = 0;
Scanner scan = new Scanner (System.in);
String prompt = ("Enter next name: ");
System.out.print("This program will ask you to enter some names. How many do you" +
" have?");
int amount = scan.nextInt();
String[] name = new String[amount];
String[] reverse = new String[amount];
System.out.print("You entered " +amount+ " as the size of your name list.");
System.out.println(" ");
for (index = 0; index < amount; index++)
{
System.out.print("Enter next name: ");
name[index] = scan.next();
}
System.out.println(" ");
System.out.println("The names in reverse and original order: ");
System.out.println(" ");
for (index = name.length - 1; index >= 0; index--)
{
System.out.println(name[index]+" ");
}
System.out.println(" ");
for (String names1 : name)
{
System.out.println(names1+" ");
}
}
}
This program will ask you to enter some names. How many do you have?3 You entered 3 as the
size of your name list. Enter next name: zoey Enter next name: zeb Enter next name: zena
The names in reverse and original order:
zena
zeb
zoey
zoey
zeb
zena

Más contenido relacionado

Similar a import java.util.; public class ReverseNames { public static vo.pdf

import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdfangelsfashion1
 
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdfArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdfdeepua8
 
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfCountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfaparnatiwari291
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdfAnkitchhabra28
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
import java.io.BufferedReader;import java.io.File;import java.io.pdf
import java.io.BufferedReader;import java.io.File;import java.io.pdfimport java.io.BufferedReader;import java.io.File;import java.io.pdf
import java.io.BufferedReader;import java.io.File;import java.io.pdfmanojmozy
 
Below is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdfBelow is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdfalankarshoe84
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfarihantmum
 
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdfimport java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdfshettysachin2005
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Svetlin Nakov
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfpremsrivastva8
 
WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...One97 Communications Limited
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfanurag1231
 
JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfRohitkumarYadav80
 
Please help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdfPlease help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdfaioils
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfrajeshjangid1865
 

Similar a import java.util.; public class ReverseNames { public static vo.pdf (16)

import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdf
 
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdfArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
ArrayTest.java import java.util.Arrays; import java.util.Scann.pdf
 
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdfCountPositiveNumbersInArray.javapackage org.students;import java.pdf
CountPositiveNumbersInArray.javapackage org.students;import java.pdf
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
import java.io.BufferedReader;import java.io.File;import java.io.pdf
import java.io.BufferedReader;import java.io.File;import java.io.pdfimport java.io.BufferedReader;import java.io.File;import java.io.pdf
import java.io.BufferedReader;import java.io.File;import java.io.pdf
 
Below is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdfBelow is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdf
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
 
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdfimport java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
 
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdfCountStringCharacters.javaimport java.util.Scanner; public cla.pdf
CountStringCharacters.javaimport java.util.Scanner; public cla.pdf
 
WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...WAP to store 10 numbers in an array and find out the largest and the smallest...
WAP to store 10 numbers in an array and find out the largest and the smallest...
 
CODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdfCODEimport java.util.; public class test { public static voi.pdf
CODEimport java.util.; public class test { public static voi.pdf
 
JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdf
 
Please help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdfPlease help me with a UML class diagram for the following code im.pdf
Please help me with a UML class diagram for the following code im.pdf
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
 

Más de deepakangel

True Reason In more concentrated solution, hyd.pdf
                     True  Reason  In more concentrated solution, hyd.pdf                     True  Reason  In more concentrated solution, hyd.pdf
True Reason In more concentrated solution, hyd.pdfdeepakangel
 
Since the electrons from Zn gets transferred to F.pdf
                     Since the electrons from Zn gets transferred to F.pdf                     Since the electrons from Zn gets transferred to F.pdf
Since the electrons from Zn gets transferred to F.pdfdeepakangel
 
Lewis Acid Base Theory .pdf
                     Lewis Acid Base Theory                           .pdf                     Lewis Acid Base Theory                           .pdf
Lewis Acid Base Theory .pdfdeepakangel
 
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdf
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdfYes its is correctly solved. P1 (Frequency of population) is done wi.pdf
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdfdeepakangel
 
You are not setting any values for those variables(name, ID, interes.pdf
You are not setting any values for those variables(name, ID, interes.pdfYou are not setting any values for those variables(name, ID, interes.pdf
You are not setting any values for those variables(name, ID, interes.pdfdeepakangel
 
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdf
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdfTotal H+ ion concentration in the solution = H+ of HCl + H+ of water.pdf
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdfdeepakangel
 
The genomic library includes introns and promotors. However, in cDNA.pdf
The genomic library includes introns and promotors. However, in cDNA.pdfThe genomic library includes introns and promotors. However, in cDNA.pdf
The genomic library includes introns and promotors. However, in cDNA.pdfdeepakangel
 
Halfway titration Half of the base is neutralise.pdf
                     Halfway titration Half of the base is neutralise.pdf                     Halfway titration Half of the base is neutralise.pdf
Halfway titration Half of the base is neutralise.pdfdeepakangel
 
The HTML canvas element is used to draw graphics on a web page.T.pdf
The HTML canvas element is used to draw graphics on a web page.T.pdfThe HTML canvas element is used to draw graphics on a web page.T.pdf
The HTML canvas element is used to draw graphics on a web page.T.pdfdeepakangel
 
Fluorescein has a OH group and a COOH group. If a.pdf
                     Fluorescein has a OH group and a COOH group. If a.pdf                     Fluorescein has a OH group and a COOH group. If a.pdf
Fluorescein has a OH group and a COOH group. If a.pdfdeepakangel
 
Solution 3Capital = Total Assets – Current Liabilities          .pdf
Solution 3Capital = Total Assets – Current Liabilities          .pdfSolution 3Capital = Total Assets – Current Liabilities          .pdf
Solution 3Capital = Total Assets – Current Liabilities          .pdfdeepakangel
 
Q1ROMThe boot loader basically put Hex code into already there .pdf
Q1ROMThe boot loader basically put Hex code into already there .pdfQ1ROMThe boot loader basically put Hex code into already there .pdf
Q1ROMThe boot loader basically put Hex code into already there .pdfdeepakangel
 
Raising the temperature changes the solubility of a substance in wat.pdf
Raising the temperature changes the solubility of a substance in wat.pdfRaising the temperature changes the solubility of a substance in wat.pdf
Raising the temperature changes the solubility of a substance in wat.pdfdeepakangel
 
MAN pages.These pages describes commands functions and there prope.pdf
MAN pages.These pages describes commands functions and there prope.pdfMAN pages.These pages describes commands functions and there prope.pdf
MAN pages.These pages describes commands functions and there prope.pdfdeepakangel
 
If a person has inability to present antigens to Tc cells (cytotoxic.pdf
If a person has inability to present antigens to Tc cells (cytotoxic.pdfIf a person has inability to present antigens to Tc cells (cytotoxic.pdf
If a person has inability to present antigens to Tc cells (cytotoxic.pdfdeepakangel
 
i didnt get your question its unclear do you mean conjunctive .pdf
i didnt get your question its unclear do you mean conjunctive .pdfi didnt get your question its unclear do you mean conjunctive .pdf
i didnt get your question its unclear do you mean conjunctive .pdfdeepakangel
 
Here is the code with comments for the question. Sample output is al.pdf
Here is the code with comments for the question. Sample output is al.pdfHere is the code with comments for the question. Sample output is al.pdf
Here is the code with comments for the question. Sample output is al.pdfdeepakangel
 
Embedded systemIt is a computer system with a dedicated function .pdf
Embedded systemIt is a computer system with a dedicated function .pdfEmbedded systemIt is a computer system with a dedicated function .pdf
Embedded systemIt is a computer system with a dedicated function .pdfdeepakangel
 
Factors.javaimport java.io.; import java.util.Scanner; class .pdf
Factors.javaimport java.io.; import java.util.Scanner; class .pdfFactors.javaimport java.io.; import java.util.Scanner; class .pdf
Factors.javaimport java.io.; import java.util.Scanner; class .pdfdeepakangel
 

Más de deepakangel (20)

True Reason In more concentrated solution, hyd.pdf
                     True  Reason  In more concentrated solution, hyd.pdf                     True  Reason  In more concentrated solution, hyd.pdf
True Reason In more concentrated solution, hyd.pdf
 
Since the electrons from Zn gets transferred to F.pdf
                     Since the electrons from Zn gets transferred to F.pdf                     Since the electrons from Zn gets transferred to F.pdf
Since the electrons from Zn gets transferred to F.pdf
 
Lewis Acid Base Theory .pdf
                     Lewis Acid Base Theory                           .pdf                     Lewis Acid Base Theory                           .pdf
Lewis Acid Base Theory .pdf
 
I3+ Solu.pdf
                     I3+                                      Solu.pdf                     I3+                                      Solu.pdf
I3+ Solu.pdf
 
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdf
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdfYes its is correctly solved. P1 (Frequency of population) is done wi.pdf
Yes its is correctly solved. P1 (Frequency of population) is done wi.pdf
 
You are not setting any values for those variables(name, ID, interes.pdf
You are not setting any values for those variables(name, ID, interes.pdfYou are not setting any values for those variables(name, ID, interes.pdf
You are not setting any values for those variables(name, ID, interes.pdf
 
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdf
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdfTotal H+ ion concentration in the solution = H+ of HCl + H+ of water.pdf
Total H+ ion concentration in the solution = H+ of HCl + H+ of water.pdf
 
The genomic library includes introns and promotors. However, in cDNA.pdf
The genomic library includes introns and promotors. However, in cDNA.pdfThe genomic library includes introns and promotors. However, in cDNA.pdf
The genomic library includes introns and promotors. However, in cDNA.pdf
 
Halfway titration Half of the base is neutralise.pdf
                     Halfway titration Half of the base is neutralise.pdf                     Halfway titration Half of the base is neutralise.pdf
Halfway titration Half of the base is neutralise.pdf
 
The HTML canvas element is used to draw graphics on a web page.T.pdf
The HTML canvas element is used to draw graphics on a web page.T.pdfThe HTML canvas element is used to draw graphics on a web page.T.pdf
The HTML canvas element is used to draw graphics on a web page.T.pdf
 
Fluorescein has a OH group and a COOH group. If a.pdf
                     Fluorescein has a OH group and a COOH group. If a.pdf                     Fluorescein has a OH group and a COOH group. If a.pdf
Fluorescein has a OH group and a COOH group. If a.pdf
 
Solution 3Capital = Total Assets – Current Liabilities          .pdf
Solution 3Capital = Total Assets – Current Liabilities          .pdfSolution 3Capital = Total Assets – Current Liabilities          .pdf
Solution 3Capital = Total Assets – Current Liabilities          .pdf
 
Q1ROMThe boot loader basically put Hex code into already there .pdf
Q1ROMThe boot loader basically put Hex code into already there .pdfQ1ROMThe boot loader basically put Hex code into already there .pdf
Q1ROMThe boot loader basically put Hex code into already there .pdf
 
Raising the temperature changes the solubility of a substance in wat.pdf
Raising the temperature changes the solubility of a substance in wat.pdfRaising the temperature changes the solubility of a substance in wat.pdf
Raising the temperature changes the solubility of a substance in wat.pdf
 
MAN pages.These pages describes commands functions and there prope.pdf
MAN pages.These pages describes commands functions and there prope.pdfMAN pages.These pages describes commands functions and there prope.pdf
MAN pages.These pages describes commands functions and there prope.pdf
 
If a person has inability to present antigens to Tc cells (cytotoxic.pdf
If a person has inability to present antigens to Tc cells (cytotoxic.pdfIf a person has inability to present antigens to Tc cells (cytotoxic.pdf
If a person has inability to present antigens to Tc cells (cytotoxic.pdf
 
i didnt get your question its unclear do you mean conjunctive .pdf
i didnt get your question its unclear do you mean conjunctive .pdfi didnt get your question its unclear do you mean conjunctive .pdf
i didnt get your question its unclear do you mean conjunctive .pdf
 
Here is the code with comments for the question. Sample output is al.pdf
Here is the code with comments for the question. Sample output is al.pdfHere is the code with comments for the question. Sample output is al.pdf
Here is the code with comments for the question. Sample output is al.pdf
 
Embedded systemIt is a computer system with a dedicated function .pdf
Embedded systemIt is a computer system with a dedicated function .pdfEmbedded systemIt is a computer system with a dedicated function .pdf
Embedded systemIt is a computer system with a dedicated function .pdf
 
Factors.javaimport java.io.; import java.util.Scanner; class .pdf
Factors.javaimport java.io.; import java.util.Scanner; class .pdfFactors.javaimport java.io.; import java.util.Scanner; class .pdf
Factors.javaimport java.io.; import java.util.Scanner; class .pdf
 

Último

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
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
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
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
 
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
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 

Último (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.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
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
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
 
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
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 

import java.util.; public class ReverseNames { public static vo.pdf

  • 1. import java.util.*; public class ReverseNames { public static void main(String[] args) { int count = 0; int index = 0; Scanner scan = new Scanner (System.in); String prompt = ("Enter next name: "); System.out.print("This program will ask you to enter some names. How many do you" + " have?"); int amount = scan.nextInt(); String[] name = new String[amount]; String[] reverse = new String[amount]; System.out.print("You entered " +amount+ " as the size of your name list."); System.out.println(" "); for (index = 0; index < amount; index++) { System.out.print("Enter next name: "); name[index] = scan.next(); } System.out.println(" "); System.out.println("The names in reverse and original order: "); System.out.println(" "); for (index = name.length - 1; index >= 0; index--) { System.out.println(name[index]+" "); } System.out.println(" "); for (String names1 : name) { System.out.println(names1+" "); } }
  • 2. } This program will ask you to enter some names. How many do you have?3 You entered 3 as the size of your name list. Enter next name: zoey Enter next name: zeb Enter next name: zena The names in reverse and original order: zena zeb zoey zoey zeb zena Solution import java.util.*; public class ReverseNames { public static void main(String[] args) { int count = 0; int index = 0; Scanner scan = new Scanner (System.in); String prompt = ("Enter next name: "); System.out.print("This program will ask you to enter some names. How many do you" + " have?"); int amount = scan.nextInt(); String[] name = new String[amount]; String[] reverse = new String[amount]; System.out.print("You entered " +amount+ " as the size of your name list."); System.out.println(" "); for (index = 0; index < amount; index++) { System.out.print("Enter next name: "); name[index] = scan.next();
  • 3. } System.out.println(" "); System.out.println("The names in reverse and original order: "); System.out.println(" "); for (index = name.length - 1; index >= 0; index--) { System.out.println(name[index]+" "); } System.out.println(" "); for (String names1 : name) { System.out.println(names1+" "); } } } This program will ask you to enter some names. How many do you have?3 You entered 3 as the size of your name list. Enter next name: zoey Enter next name: zeb Enter next name: zena The names in reverse and original order: zena zeb zoey zoey zeb zena