Join Peggy Fisher for an in-depth discussion in this video Solution: Name finder, part of Java Essential Training for Students.
- So how did you make out with the challenge?…How is your name game working?…Let's take a look at my solution, and as always, remember…that your solution might be very different.…As you can see in the "main" method,…I have the two dimensional array of names,…and then I added some additional code.…I wanted to allow the user…to execute the program more than once,…so I declared a string variable, "response",…and set it equal to "y" the first time.…I also declare a string variable, "name",…that's gonna hold the name…the user would like to search for.…
My "while" loop says, while "response" is equal to a "y",…ask the user to enter the name to search for.…Then we'll read the name in, using the "name=in.nextline",…on line 32, then I call my "searchName" method,…and I give it the two dimensional array called "names"…as well as the name that I'm trying to search for.…If the value that comes back from the method is true,…I print out the message saying "The name was found";…otherwise, I print out "The name was not found".…
Author
Released
6/29/2015- Getting started with parsing
- Reviewing data types
- Using decisions
- Creating user-defined methods
- Command-line debugging
- Exploring the Java API
- Creating and instantiating classes
- Working with interfaces
- Storing items with arrays
Skill Level Intermediate
Duration
Views
Q: How can I make my debugger function like the author’s?
Related Courses
-
Learning Java 8
with Peggy Fisher3h 9m Beginner -
Java 8 Essential Training
with David Gassner6h 4m Beginner -
HTML Essential Training
with James Williamson5h 54m Beginner
-
Introduction
-
Welcome58s
-
-
1. Command Level Programming
-
Challenge: Hello world1m 8s
-
Solution: Hello world2m 22s
-
2. Basics Review
-
Reviewing data types4m 32s
-
Using decisions2m 37s
-
Managing loops4m 36s
-
Challenge: College cost app1m 12s
-
Solution: College cost app4m 23s
-
-
3. Debugging
-
Setting breakpoints1m 42s
-
Stepping through the code4m 37s
-
Command line debugging3m 50s
-
Solution: Debugging5m 25s
-
4. Java API
-
Exploring the Java API3m 2s
-
Challenge: API51s
-
Solution: API2m 16s
-
-
5. Simulations and Algorithm Analysis
-
Using simulations3m 24s
-
Random number generator3m 5s
-
Analyzing algorithms4m 49s
-
Leveraging recursion1m 59s
-
Challenge: Monte Carlo2m 1s
-
Solution: Monte Carlo3m 2s
-
-
6. Classes and Objects
-
Diagramming with UML1m 42s
-
Creating classes7m 4s
-
Using encapsulation1m 28s
-
Instantiating classes7m 16s
-
Avoiding null references4m 27s
-
Challenge: Kathie's Catering2m 53s
-
Solution: Kathie's Catering4m 41s
-
7. More on Classes
-
Introducing inheritance6m 35s
-
Working with interfaces4m 30s
-
Using polymorphism2m 14s
-
Solution: Pizza ordering app3m 51s
-
-
8. Data Structures
-
Storing items with arrays4m 15s
-
Utilizing 2D arrays3m 3s
-
Managing ArrayLists5m 33s
-
Enhanced for Loop5m 9s
-
Challenge: Name finder1m 8s
-
Solution: Name finder3m 42s
-
-
Conclusion
-
Next steps34s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Solution: Name finder