Question
I need help writing the following java Java Method below. I just need a method to take a user inputted First or Last Name and
I need help writing the following java Java Method below. I just need a method to take a user inputted First or Last Name and return the associated phone number, thank you!
import java.util.*; import java.io.*;
class PhoneList {
public static void main(String[] args) throws Exception { boolean loop = true; File file = new File("PhoneList_Data.txt"); FileWriter fw = new FileWriter(file, true); fw.write("PhoneList Data"); fw.write(" " + "Last, First: 6041337567, 2181731566"); // do { } (loop) fw.close(); }
// Method left needing to be written void display(String name) {}; // Display: Given a First or Last Name, display every PhoneNumber associated with that Name
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started