Subject Computer Science Java Programming

Question

Consider the application for booking meeting rooms. Create a program to keep track of contacts. For each person to save a name and phone number. The program will have graphic user interface, and store information on file. Program code is provided on a single text file (. Txt). Separate classes clearly.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

mport java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class MeetingRoom {

public Map<String, String> names;

public MeetingRoom()
{
names = new HashMap<String, String>();
try(BufferedReader out = new BufferedReader(new FileReader("contacts.txt")))
{
String line;
while((line = out.readLine()) != null)
{
String[] split = line.split("\\s+");
names.put(split[0], split[1]);
}
} catch (IOException e) {
return;
}
}

public boolean addEntry(String name, String phoneNumber)
{
if(!names.containsKey(name))
{
names.put(name, phoneNumber);
return true;...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$40.00

or $1 if you
register a new account!

Related Homework Solutions

Get help from a qualified tutor
Live Chats