Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

pooo

import java.io.PrintStream;
import java.util.Scanner;
public class Torrey_Izabella_Phonebook {
    public static void main(String[] args) {
        Scanner reader = new Scanner (System.in);
        String userinput = "";
        char usercommand = ' ';
        while (usercommand != 'q' && usercommand != 'Q') {
            System.out.println("Command: ");
            userinput = reader.nextLine();
            usercommand = userinput.trim().charAt(0);
            int num_entries = 0;
            switch (usercommand) {
                case 'l':
                    System.out.println();
                case 'f':
                case 'e': num_entries++;
            }
            userinput.substring(1, userinput.length() - 1);
        }
    }
    public static void readPhonebook(String filename) throws Exception{

    }

    public static void storePhonebook(String filename, int num_entries) throws Exception{

        PrintStream P = new PrintStream(filename);
        for (int i = 0; i < num_entries; i++) {
            P.println(EntryList[i].name + "\t" +
                    EntryList[i].number + "\t" +
                    EntryList[i].notes + "\t");
        }
        P.close();
        System.out.println("Phonebook stored.");
    }
    public static void ListAllEntries() {
        System.out.println();
    }
}
class Entry {
    String name;
    String number;
    String notes;
}

class EntryList {
    public Entry[] entries;
    public String filename;

    public EntryList{
        this.entries = new Entry[200];
        this.filename = filename;
        Torrey_Izabella_Phonebook.readPhonebook(this.filename);
    }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.