JAVA PROGRAM    Modify this program with further modifications as follows: The test case must pass when uploaded to Hypergrade. THE TEXT FILES ARE LOCATED IN HYPERGRADE and I provided them deom below. Thank you.   BOYNAMES.TXT Jacob Michael Joshua Matthew Daniel Christopher Andrew Ethan Joseph William Anthony David Alexander Nicholas Ryan Tyler James John Jonathan Noah Brandon Christian Dylan Samuel Benjamin Zachary Nathan Logan Justin Gabriel Jose Austin Kevin Elijah Caleb Robert Thomas Jordan Cameron Jack Hunter Jackson Angel Isaiah Evan Isaac Mason Luke Jason Gavin Jayden Aaron Connor Aiden Aidan Kyle Juan Charles Luis Adam Lucas Brian Eric Adrian Nathaniel Sean Alex Carlos Bryan Ian Owen Jesus Landon Julian Chase Cole Diego Jeremiah Steven Sebastian Xavier Timothy Carter Wyatt Brayden Blake Hayden Devin Cody Richard Seth Dominic Jaden Antonio Miguel Liam Patrick Carson Jesse Tristan Alejandro Henry Victor Trevor Bryce Jake Riley Colin Jared Jeremy Mark Caden Garrett Parker Marcus Vincent Kaleb Kaden Brady Colton Kenneth Joel Oscar Josiah Jorge Cooper Ashton Tanner Eduardo Paul Edward Ivan Preston Maxwell Alan Levi Stephen Grant Nicolas Omar Dakota Alexis George Collin Eli Spencer Gage Max Cristian Ricardo Derek Micah Brody Francisco Nolan Ayden Dalton Shane Peter Damian Jeffrey Brendan Travis Fernando Peyton Conner Andres Javier Giovanni Shawn Braden Cesar Bradley Emmanuel Manuel Edgar Erik Mario Edwin Johnathan Devon Erick Wesley Oliver Trenton Hector Malachi Jalen Raymond Gregory Abraham Elias Leonardo Sergio Donovan Colby Marco Bryson Martin   GirlNames.txt Emily Madison Emma Olivia Hannah Abigail Isabella Samantha Elizabeth Ashley Alexis Sarah Sophia Alyssa Grace Ava Taylor Brianna Lauren Chloe Natalie Kayla Jessica Anna Victoria Mia Hailey Sydney Jasmine Julia Morgan Destiny Rachel Ella Kaitlyn Megan Katherine Savannah Jennifer Alexandra Allison Haley Maria Kaylee Lily Makayla Brooke Mackenzie Nicole Addison Stephanie Lillian Andrea Zoe Faith Kimberly Madeline Alexa Katelyn Gabriella Gabrielle Trinity Amanda Kylie Mary Paige Riley Jenna Leah Sara Rebecca Michelle Sofia Vanessa Jordan Angelina Caroline Avery Audrey Evelyn Maya Claire Autumn Jocelyn Ariana Nevaeh Arianna Jada Bailey Brooklyn Aaliyah Amber Isabel Danielle Mariah Melanie Sierra Erin Molly Amelia Isabelle Madelyn Melissa Jacqueline Marissa Shelby Angela Leslie Katie Jade Catherine Diana Aubrey Mya Amy Briana Sophie Gabriela Breanna Gianna Kennedy Gracie Peyton Adriana Christina Courtney Daniela Kathryn Lydia Valeria Layla Alexandria Natalia Angel Laura Charlotte Margaret Cheyenne Mikayla Miranda Naomi Kelsey Payton Ana Alicia Jillian Daisy Mckenzie Ashlyn Caitlin Sabrina Summer Ruby Rylee Valerie Skylar Lindsey Kelly Genesis Zoey Eva Sadie Alexia Cassidy Kylee Kendall Jordyn Kate Jayla Karen Tiffany Cassandra Juliana Reagan Caitlyn Giselle Serenity Alondra Lucy Kiara Bianca Crystal Erica Angelica Hope Chelsea Alana Liliana Brittany Camila Makenzie Veronica Lilly Abby Jazmin Adrianna Karina Delaney Ellie Jasmin   Test Case 1     Enter a name to search or type QUIT to exit:\n AnnabelleENTER The name 'Annabelle' was not found in either list.\n Enter a name to search or type QUIT to exit:\n xavierENTER The name 'Xavier' was found in popular boy names list (line 81).\n Enter a name to search or type QUIT to exit:\n AMANDAENTER The name 'Amanda' was found in popular girl names list (line 63).\n Enter a name to search or type QUIT to exit:\n jOrdAnENTER The name 'Jordan' was found in both lists: boy names (line 38) and girl names (line 75).\n Enter a name to search or type QUIT to exit:\n quitENTER

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
JAVA PROGRAM
 
 Modify this program with further modifications as follows: The test case must pass when uploaded to Hypergrade. THE TEXT FILES ARE LOCATED IN HYPERGRADE and I provided them deom below. Thank you.
 
BOYNAMES.TXT
Jacob Michael Joshua Matthew Daniel Christopher Andrew Ethan Joseph William Anthony David Alexander Nicholas Ryan Tyler James John Jonathan Noah Brandon Christian Dylan Samuel Benjamin Zachary Nathan Logan Justin Gabriel Jose Austin Kevin Elijah Caleb Robert Thomas Jordan Cameron Jack Hunter Jackson Angel Isaiah Evan Isaac Mason Luke Jason Gavin Jayden Aaron Connor Aiden Aidan Kyle Juan Charles Luis Adam Lucas Brian Eric Adrian Nathaniel Sean Alex Carlos Bryan Ian Owen Jesus Landon Julian Chase Cole Diego Jeremiah Steven Sebastian Xavier Timothy Carter Wyatt Brayden Blake Hayden Devin Cody Richard Seth Dominic Jaden Antonio Miguel Liam Patrick Carson Jesse Tristan Alejandro Henry Victor Trevor Bryce Jake Riley Colin Jared Jeremy Mark Caden Garrett Parker Marcus Vincent Kaleb Kaden Brady Colton Kenneth Joel Oscar Josiah Jorge Cooper Ashton Tanner Eduardo Paul Edward Ivan Preston Maxwell Alan Levi Stephen Grant Nicolas Omar Dakota Alexis George Collin Eli Spencer Gage Max Cristian Ricardo Derek Micah Brody Francisco Nolan Ayden Dalton Shane Peter Damian Jeffrey Brendan Travis Fernando Peyton Conner Andres Javier Giovanni Shawn Braden Cesar Bradley Emmanuel Manuel Edgar Erik Mario Edwin Johnathan Devon Erick Wesley Oliver Trenton Hector Malachi Jalen Raymond Gregory Abraham Elias Leonardo Sergio Donovan Colby Marco Bryson Martin
 
GirlNames.txt
Emily Madison Emma Olivia Hannah Abigail Isabella Samantha Elizabeth Ashley Alexis Sarah Sophia Alyssa Grace Ava Taylor Brianna Lauren Chloe Natalie Kayla Jessica Anna Victoria Mia Hailey Sydney Jasmine Julia Morgan Destiny Rachel Ella Kaitlyn Megan Katherine Savannah Jennifer Alexandra Allison Haley Maria Kaylee Lily Makayla Brooke Mackenzie Nicole Addison Stephanie Lillian Andrea Zoe Faith Kimberly Madeline Alexa Katelyn Gabriella Gabrielle Trinity Amanda Kylie Mary Paige Riley Jenna Leah Sara Rebecca Michelle Sofia Vanessa Jordan Angelina Caroline Avery Audrey Evelyn Maya Claire Autumn Jocelyn Ariana Nevaeh Arianna Jada Bailey Brooklyn Aaliyah Amber Isabel Danielle Mariah Melanie Sierra Erin Molly Amelia Isabelle Madelyn Melissa Jacqueline Marissa Shelby Angela Leslie Katie Jade Catherine Diana Aubrey Mya Amy Briana Sophie Gabriela Breanna Gianna Kennedy Gracie Peyton Adriana Christina Courtney Daniela Kathryn Lydia Valeria Layla Alexandria Natalia Angel Laura Charlotte Margaret Cheyenne Mikayla Miranda Naomi Kelsey Payton Ana Alicia Jillian Daisy Mckenzie Ashlyn Caitlin Sabrina Summer Ruby Rylee Valerie Skylar Lindsey Kelly Genesis Zoey Eva Sadie Alexia Cassidy Kylee Kendall Jordyn Kate Jayla Karen Tiffany Cassandra Juliana Reagan Caitlyn Giselle Serenity Alondra Lucy Kiara Bianca Crystal Erica Angelica Hope Chelsea Alana Liliana Brittany Camila Makenzie Veronica Lilly Abby Jazmin Adrianna Karina Delaney Ellie Jasmin
 

Test Case 1

 
 
Enter a name to search or type QUIT to exit:\n
AnnabelleENTER
The name 'Annabelle' was not found in either list.\n
Enter a name to search or type QUIT to exit:\n
xavierENTER
The name 'Xavier' was found in popular boy names list (line 81).\n
Enter a name to search or type QUIT to exit:\n
AMANDAENTER
The name 'Amanda' was found in popular girl names list (line 63).\n
Enter a name to search or type QUIT to exit:\n
jOrdAnENTER
The name 'Jordan' was found in both lists: boy names (line 38) and girl names (line 75).\n
Enter a name to search or type QUIT to exit:\n
quitENTER
Test Case 1 Failed
Show what's missing
Enter a name to search or type QUIT to exit: n
Annabelle ENTER
The name 'Annabelle' was not found in either list.\n
Enter a name to search or type QUIT to exit: \n
xavier ENTER
The name 'Xavier' was found in popular boy names list (line 81).\n
Enter a name to search or type
QUIT to exit: n
AMANDA ENTER
The name 'Amanda' was found in popular girl names list (line 63). \n
Enter a name to search or type QUIT to exit: n
jordAn ENTER
The name 'Jordan' was found in both lists: boy names (line 38) and girl names (line 75). \n
Enter a name to search or type QUIT to exit: \n
quit ENTER
Test Case 1 Failed Show what's missing
Screen Shot 2023-10-03 at 5.17.58 PM
Enter a name to search or type QUIT to exit: \n
Annabelle ENTER
The name 'Annabelle' was not found in either list.\n
Enter a name to search or type QUIT to exit: \n
xavier ENTER
The name 'Xavier' was found in popular boy names list (line 81).\n
QUIT to exit: \n
Enter a name to search or type
AMANDA ENTER
The name 'Amanda' was found in
Enter a name to search or type
jordAn ENTER
popular girl names list (line 63).\n
QUIT to exit: \n
The name 'Jordan' was found in
Enter a name to search or type QUIT to exit: \n
quit ENTER
10
Search
both lists: boy names (line 38) and girl names (line 75).\n
Transcribed Image Text:Test Case 1 Failed Show what's missing Enter a name to search or type QUIT to exit: n Annabelle ENTER The name 'Annabelle' was not found in either list.\n Enter a name to search or type QUIT to exit: \n xavier ENTER The name 'Xavier' was found in popular boy names list (line 81).\n Enter a name to search or type QUIT to exit: n AMANDA ENTER The name 'Amanda' was found in popular girl names list (line 63). \n Enter a name to search or type QUIT to exit: n jordAn ENTER The name 'Jordan' was found in both lists: boy names (line 38) and girl names (line 75). \n Enter a name to search or type QUIT to exit: \n quit ENTER Test Case 1 Failed Show what's missing Screen Shot 2023-10-03 at 5.17.58 PM Enter a name to search or type QUIT to exit: \n Annabelle ENTER The name 'Annabelle' was not found in either list.\n Enter a name to search or type QUIT to exit: \n xavier ENTER The name 'Xavier' was found in popular boy names list (line 81).\n QUIT to exit: \n Enter a name to search or type AMANDA ENTER The name 'Amanda' was found in Enter a name to search or type jordAn ENTER popular girl names list (line 63).\n QUIT to exit: \n The name 'Jordan' was found in Enter a name to search or type QUIT to exit: \n quit ENTER 10 Search both lists: boy names (line 38) and girl names (line 75).\n
import java.io.*;
import java.util.*;
public class Name Searcher {
private static List<String> loadFileToList (String filename) throws FileNotFoundException
List<String> namesList = new ArrayList<>();
File file = new File (filename);
}
if (!file.exists()) {
throw new FileNotFoundException (filename);
}
try (Scanner scanner = new Scanner (file)) {
while (scanner.hasNextLine()) {
}
String line = scanner.nextLine().trim();
String[] names = line.split("\\s+");
for (String name : names) {
}
namesList.add(name.toLowerCase());
}
}
return namesList;
private static Integer searchNameInList (String name, List<String> namesList) {
int index = namesList.indexOf(name.toLowerCase());
return index == -1 ? null: index + 1;
public static void main(String [] args) {
List<String> boyNames = new ArrayList<>(); // Initialize with an empty list
List<String> girlNames = new ArrayList<>(); // Initialize with an empty list
try {
boyNames
} catch (FileNotFoundException e) {}
=
loadFileToList("BoyNames.txt");
try {
} catch (EileNotFoundExcentian, e) {}
Scanner Scanner = new Scanner (System.in);
QUIT to exit: ");
girlNames =
boxNames);
girlNames);
while (true) {
System.out.println("Enter a name to search or type
11
String input =
}
LoadFileToList("GirlNames.txt");
break;
String capitalizedInput input substring(0,
1).toupperCase() + input.substring(1). takowerCase();
Integer boxIndex = searchNameInList (input,
Integer gilindex
if (jarutegualstonorecase ( "QUIT")) {
}
capitalizedingut +
scanner nextLine().trim();
=
=
if (baxindex == null && girlIndex == null) {
System outrcintln(" "The name
+
was not found in either list.");
searchNameInList(input,
} else if (baxindex != null && girlindex null) {
System.out.println( "The name
+
capitalizedinput + was found in popular boy names list (line
+ boxIndex + ").");
}
scanner clase();
==
} else if (baxindex == null && girlindex != null) {
Skaten out Reintln( "The name " +
caritalizedīneut + was found in popular girl names list (line
" + girltodex + ").");
} else {
System.out.println("The name
+
capitalizedīnput + was found in both lists: boy names
(line "
+ boxindex + ") and girl names (line + girlindex + ").");
Transcribed Image Text:import java.io.*; import java.util.*; public class Name Searcher { private static List<String> loadFileToList (String filename) throws FileNotFoundException List<String> namesList = new ArrayList<>(); File file = new File (filename); } if (!file.exists()) { throw new FileNotFoundException (filename); } try (Scanner scanner = new Scanner (file)) { while (scanner.hasNextLine()) { } String line = scanner.nextLine().trim(); String[] names = line.split("\\s+"); for (String name : names) { } namesList.add(name.toLowerCase()); } } return namesList; private static Integer searchNameInList (String name, List<String> namesList) { int index = namesList.indexOf(name.toLowerCase()); return index == -1 ? null: index + 1; public static void main(String [] args) { List<String> boyNames = new ArrayList<>(); // Initialize with an empty list List<String> girlNames = new ArrayList<>(); // Initialize with an empty list try { boyNames } catch (FileNotFoundException e) {} = loadFileToList("BoyNames.txt"); try { } catch (EileNotFoundExcentian, e) {} Scanner Scanner = new Scanner (System.in); QUIT to exit: "); girlNames = boxNames); girlNames); while (true) { System.out.println("Enter a name to search or type 11 String input = } LoadFileToList("GirlNames.txt"); break; String capitalizedInput input substring(0, 1).toupperCase() + input.substring(1). takowerCase(); Integer boxIndex = searchNameInList (input, Integer gilindex if (jarutegualstonorecase ( "QUIT")) { } capitalizedingut + scanner nextLine().trim(); = = if (baxindex == null && girlIndex == null) { System outrcintln(" "The name + was not found in either list."); searchNameInList(input, } else if (baxindex != null && girlindex null) { System.out.println( "The name + capitalizedinput + was found in popular boy names list (line + boxIndex + ")."); } scanner clase(); == } else if (baxindex == null && girlindex != null) { Skaten out Reintln( "The name " + caritalizedīneut + was found in popular girl names list (line " + girltodex + ")."); } else { System.out.println("The name + capitalizedīnput + was found in both lists: boy names (line " + boxindex + ") and girl names (line + girlindex + ").");
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY