SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
I need an UML diagram
package hw2;
import java.util.ArrayList;
import java.util.Scanner;
public class BabyRanking {
/** Main method */
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// Prompt the user to enter the year, gender and name
System.out.print("Enter the year: ");
String year = input.nextLine();
System.out.print("Enter the gender: ");
String gender = input.nextLine();
System.out.print("Enter the name: ");
String name = input.nextLine();
// Create an ArrayList
ArrayList<String> list = new ArrayList<>();
// Read text from url
try {
java.net.URL url = new java.net.URL(
"http://www.cs.armstrong.edu/liang/data/babynamesranking" +
year + ".txt");
// Create input file from url
input = new Scanner(url.openStream());
while (input.hasNext()) {
for (int i = 0; i < 5; i++) {
list.add(i, input.next());
}
// Display ranking for the name for the year
if (list.get(gender(gender)).equals(name)) {
System.out.println(
name + " is ranked #" + list.get(0) + " in year " + year);
System.exit(0);
}
list.clear();
}
}
catch (java.net.MalformedURLException ex) {
System.out.println("Invalid URL");
}
catch (java.io.IOException ex) {
System.out.println("I/O Errors: no such file");
}
System.out.println("The name " + name + " is not ranked in year " + year);
}
/** Returns the index for the corresponding gender */
public static int gender(String gender) {
if (gender.equals("M"))
return 1;
else
return 3;
}
}

Weitere ähnliche Inhalte

Ähnlich wie I need an UML diagram package hw2- import java-util-ArrayList- im (1).pdf

KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerAiman Hud
 
Create a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfCreate a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfarrowvisionoptics
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdf
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdfTeacher.javaimport java.util.Arrays; import java.util.Scanner;.pdf
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdfkareemangels
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming AssignmentCoding Assignment Help
 
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
 
Can someone help me with this code When I run it, it stops after th.pdf
Can someone help me with this code When I run it, it stops after th.pdfCan someone help me with this code When I run it, it stops after th.pdf
Can someone help me with this code When I run it, it stops after th.pdfAmansupan
 
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
 
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
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docxajoy21
 

Ähnlich wie I need an UML diagram package hw2- import java-util-ArrayList- im (1).pdf (18)

JavaExamples
JavaExamplesJavaExamples
JavaExamples
 
Taking User Input in Java
Taking User Input in JavaTaking User Input in Java
Taking User Input in Java
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Test program
Test programTest program
Test program
 
Create a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfCreate a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdf
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Computer programming 2 chapter 1-lesson 2
Computer programming 2  chapter 1-lesson 2Computer programming 2  chapter 1-lesson 2
Computer programming 2 chapter 1-lesson 2
 
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdf
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdfTeacher.javaimport java.util.Arrays; import java.util.Scanner;.pdf
Teacher.javaimport java.util.Arrays; import java.util.Scanner;.pdf
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming Assignment
 
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 ...
 
Can someone help me with this code When I run it, it stops after th.pdf
Can someone help me with this code When I run it, it stops after th.pdfCan someone help me with this code When I run it, it stops after th.pdf
Can someone help me with this code When I run it, it stops after th.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.pdf
 
JAVA.pdf
JAVA.pdfJAVA.pdf
JAVA.pdf
 
Vo.pdf
   Vo.pdf   Vo.pdf
Vo.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
 
Lab4
Lab4Lab4
Lab4
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docx
 

Mehr von MattU5mLambertq

I want you to add the output of the F1 score- Precision- ROC AUC- and.pdf
I want you to add the output of the F1 score- Precision- ROC AUC- and.pdfI want you to add the output of the F1 score- Precision- ROC AUC- and.pdf
I want you to add the output of the F1 score- Precision- ROC AUC- and.pdfMattU5mLambertq
 
I would appreciate it if you can explain how you got the answers- Than (3).pdf
I would appreciate it if you can explain how you got the answers- Than (3).pdfI would appreciate it if you can explain how you got the answers- Than (3).pdf
I would appreciate it if you can explain how you got the answers- Than (3).pdfMattU5mLambertq
 
I use the below scapy code to sniff and then spoof on the IP addresses.pdf
I use the below scapy code to sniff and then spoof on the IP addresses.pdfI use the below scapy code to sniff and then spoof on the IP addresses.pdf
I use the below scapy code to sniff and then spoof on the IP addresses.pdfMattU5mLambertq
 
I try to change the port number ut this error appears(MongoServerError.pdf
I try to change the port number ut this error appears(MongoServerError.pdfI try to change the port number ut this error appears(MongoServerError.pdf
I try to change the port number ut this error appears(MongoServerError.pdfMattU5mLambertq
 
I tried graphing each function on Desmos but I'm still confused as to.pdf
I tried graphing each function on Desmos but I'm still confused as to.pdfI tried graphing each function on Desmos but I'm still confused as to.pdf
I tried graphing each function on Desmos but I'm still confused as to.pdfMattU5mLambertq
 
I need some help with part A and B- Thank you! 4) Use truth tables to.pdf
I need some help with part A and B- Thank you! 4) Use truth tables to.pdfI need some help with part A and B- Thank you! 4) Use truth tables to.pdf
I need some help with part A and B- Thank you! 4) Use truth tables to.pdfMattU5mLambertq
 
I need help with the moveStudentsFromChairToLine() method- This method.pdf
I need help with the moveStudentsFromChairToLine() method- This method.pdfI need help with the moveStudentsFromChairToLine() method- This method.pdf
I need help with the moveStudentsFromChairToLine() method- This method.pdfMattU5mLambertq
 
If fur color in mice is determined polygenicly by the alleles A and B-.pdf
If fur color in mice is determined polygenicly by the alleles A and B-.pdfIf fur color in mice is determined polygenicly by the alleles A and B-.pdf
If fur color in mice is determined polygenicly by the alleles A and B-.pdfMattU5mLambertq
 
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdf
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdfIf MX(t)---70-(1-3et)-5 what is the distribution of X -.pdf
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdfMattU5mLambertq
 
if I had a merge sort function in python and I wish to count each time.pdf
if I had a merge sort function in python and I wish to count each time.pdfif I had a merge sort function in python and I wish to count each time.pdf
if I had a merge sort function in python and I wish to count each time.pdfMattU5mLambertq
 
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdf
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdfIf Clare has no T-helper cells- she would have Impaired cell-mediated.pdf
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdfMattU5mLambertq
 
if arbitrageurs notice a price discrepancy between the dollar and the.pdf
if arbitrageurs notice a price discrepancy between the dollar and the.pdfif arbitrageurs notice a price discrepancy between the dollar and the.pdf
if arbitrageurs notice a price discrepancy between the dollar and the.pdfMattU5mLambertq
 
If Bowen Co- has a return on assets of 11 percent and also a return on.pdf
If Bowen Co- has a return on assets of 11 percent and also a return on.pdfIf Bowen Co- has a return on assets of 11 percent and also a return on.pdf
If Bowen Co- has a return on assets of 11 percent and also a return on.pdfMattU5mLambertq
 
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdf
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdfIf a fly landed on animal feces- picked up Salmonella on its feet- and.pdf
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdfMattU5mLambertq
 
If a patient is found to have Lynch syndrome- what are the chances tha.pdf
If a patient is found to have Lynch syndrome- what are the chances tha.pdfIf a patient is found to have Lynch syndrome- what are the chances tha.pdf
If a patient is found to have Lynch syndrome- what are the chances tha.pdfMattU5mLambertq
 
Identification and Documentation of a Business Process 1- Identify a b.pdf
Identification and Documentation of a Business Process 1- Identify a b.pdfIdentification and Documentation of a Business Process 1- Identify a b.pdf
Identification and Documentation of a Business Process 1- Identify a b.pdfMattU5mLambertq
 
Identify each image- Header Footer Page Layout View Normal View.pdf
Identify each image- Header Footer Page Layout View Normal View.pdfIdentify each image- Header Footer Page Layout View Normal View.pdf
Identify each image- Header Footer Page Layout View Normal View.pdfMattU5mLambertq
 
identify rocks Metamorphic Grade- Foliated Only Classification I- Met.pdf
identify rocks  Metamorphic Grade- Foliated Only Classification I- Met.pdfidentify rocks  Metamorphic Grade- Foliated Only Classification I- Met.pdf
identify rocks Metamorphic Grade- Foliated Only Classification I- Met.pdfMattU5mLambertq
 
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdf
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdfIdentify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdf
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdfMattU5mLambertq
 
identify which bone is displayed below-.pdf
identify which bone is displayed below-.pdfidentify which bone is displayed below-.pdf
identify which bone is displayed below-.pdfMattU5mLambertq
 

Mehr von MattU5mLambertq (20)

I want you to add the output of the F1 score- Precision- ROC AUC- and.pdf
I want you to add the output of the F1 score- Precision- ROC AUC- and.pdfI want you to add the output of the F1 score- Precision- ROC AUC- and.pdf
I want you to add the output of the F1 score- Precision- ROC AUC- and.pdf
 
I would appreciate it if you can explain how you got the answers- Than (3).pdf
I would appreciate it if you can explain how you got the answers- Than (3).pdfI would appreciate it if you can explain how you got the answers- Than (3).pdf
I would appreciate it if you can explain how you got the answers- Than (3).pdf
 
I use the below scapy code to sniff and then spoof on the IP addresses.pdf
I use the below scapy code to sniff and then spoof on the IP addresses.pdfI use the below scapy code to sniff and then spoof on the IP addresses.pdf
I use the below scapy code to sniff and then spoof on the IP addresses.pdf
 
I try to change the port number ut this error appears(MongoServerError.pdf
I try to change the port number ut this error appears(MongoServerError.pdfI try to change the port number ut this error appears(MongoServerError.pdf
I try to change the port number ut this error appears(MongoServerError.pdf
 
I tried graphing each function on Desmos but I'm still confused as to.pdf
I tried graphing each function on Desmos but I'm still confused as to.pdfI tried graphing each function on Desmos but I'm still confused as to.pdf
I tried graphing each function on Desmos but I'm still confused as to.pdf
 
I need some help with part A and B- Thank you! 4) Use truth tables to.pdf
I need some help with part A and B- Thank you! 4) Use truth tables to.pdfI need some help with part A and B- Thank you! 4) Use truth tables to.pdf
I need some help with part A and B- Thank you! 4) Use truth tables to.pdf
 
I need help with the moveStudentsFromChairToLine() method- This method.pdf
I need help with the moveStudentsFromChairToLine() method- This method.pdfI need help with the moveStudentsFromChairToLine() method- This method.pdf
I need help with the moveStudentsFromChairToLine() method- This method.pdf
 
If fur color in mice is determined polygenicly by the alleles A and B-.pdf
If fur color in mice is determined polygenicly by the alleles A and B-.pdfIf fur color in mice is determined polygenicly by the alleles A and B-.pdf
If fur color in mice is determined polygenicly by the alleles A and B-.pdf
 
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdf
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdfIf MX(t)---70-(1-3et)-5 what is the distribution of X -.pdf
If MX(t)---70-(1-3et)-5 what is the distribution of X -.pdf
 
if I had a merge sort function in python and I wish to count each time.pdf
if I had a merge sort function in python and I wish to count each time.pdfif I had a merge sort function in python and I wish to count each time.pdf
if I had a merge sort function in python and I wish to count each time.pdf
 
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdf
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdfIf Clare has no T-helper cells- she would have Impaired cell-mediated.pdf
If Clare has no T-helper cells- she would have Impaired cell-mediated.pdf
 
if arbitrageurs notice a price discrepancy between the dollar and the.pdf
if arbitrageurs notice a price discrepancy between the dollar and the.pdfif arbitrageurs notice a price discrepancy between the dollar and the.pdf
if arbitrageurs notice a price discrepancy between the dollar and the.pdf
 
If Bowen Co- has a return on assets of 11 percent and also a return on.pdf
If Bowen Co- has a return on assets of 11 percent and also a return on.pdfIf Bowen Co- has a return on assets of 11 percent and also a return on.pdf
If Bowen Co- has a return on assets of 11 percent and also a return on.pdf
 
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdf
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdfIf a fly landed on animal feces- picked up Salmonella on its feet- and.pdf
If a fly landed on animal feces- picked up Salmonella on its feet- and.pdf
 
If a patient is found to have Lynch syndrome- what are the chances tha.pdf
If a patient is found to have Lynch syndrome- what are the chances tha.pdfIf a patient is found to have Lynch syndrome- what are the chances tha.pdf
If a patient is found to have Lynch syndrome- what are the chances tha.pdf
 
Identification and Documentation of a Business Process 1- Identify a b.pdf
Identification and Documentation of a Business Process 1- Identify a b.pdfIdentification and Documentation of a Business Process 1- Identify a b.pdf
Identification and Documentation of a Business Process 1- Identify a b.pdf
 
Identify each image- Header Footer Page Layout View Normal View.pdf
Identify each image- Header Footer Page Layout View Normal View.pdfIdentify each image- Header Footer Page Layout View Normal View.pdf
Identify each image- Header Footer Page Layout View Normal View.pdf
 
identify rocks Metamorphic Grade- Foliated Only Classification I- Met.pdf
identify rocks  Metamorphic Grade- Foliated Only Classification I- Met.pdfidentify rocks  Metamorphic Grade- Foliated Only Classification I- Met.pdf
identify rocks Metamorphic Grade- Foliated Only Classification I- Met.pdf
 
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdf
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdfIdentify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdf
Identify the inference rule- U+ABUU(A)+BIdentify the inference rule-.pdf
 
identify which bone is displayed below-.pdf
identify which bone is displayed below-.pdfidentify which bone is displayed below-.pdf
identify which bone is displayed below-.pdf
 

Kürzlich hochgeladen

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

I need an UML diagram package hw2- import java-util-ArrayList- im (1).pdf

  • 1. I need an UML diagram package hw2; import java.util.ArrayList; import java.util.Scanner; public class BabyRanking { /** Main method */ public static void main(String[] args) { Scanner input = new Scanner(System.in); // Prompt the user to enter the year, gender and name System.out.print("Enter the year: "); String year = input.nextLine(); System.out.print("Enter the gender: "); String gender = input.nextLine(); System.out.print("Enter the name: "); String name = input.nextLine(); // Create an ArrayList ArrayList<String> list = new ArrayList<>(); // Read text from url try { java.net.URL url = new java.net.URL( "http://www.cs.armstrong.edu/liang/data/babynamesranking" + year + ".txt"); // Create input file from url input = new Scanner(url.openStream()); while (input.hasNext()) { for (int i = 0; i < 5; i++) { list.add(i, input.next()); } // Display ranking for the name for the year if (list.get(gender(gender)).equals(name)) { System.out.println( name + " is ranked #" + list.get(0) + " in year " + year); System.exit(0); }
  • 2. list.clear(); } } catch (java.net.MalformedURLException ex) { System.out.println("Invalid URL"); } catch (java.io.IOException ex) { System.out.println("I/O Errors: no such file"); } System.out.println("The name " + name + " is not ranked in year " + year); } /** Returns the index for the corresponding gender */ public static int gender(String gender) { if (gender.equals("M")) return 1; else return 3; } }