package Praktikum;

import java.util.Scanner;
public class PhoneBook {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String k1;
String k2;
String nama[] = new String[999];
String nomor[] = new String[999];
int j = 0;
String a;
String b;
System.out.println("==||||||||||||||||||||||||||||||||||||||||||||||||||
||==");
System.out.println("---

Selamat datang di PROGRAM PHONE BOOK

---

");
System.out.println("==||||||||||||||||||||||||||||||||||||||||||||||||||
||==");
System.out.println("");
do {
System.out.println("pilih menu berikut :");
System.out.println("a) Menyimpan Contact");
System.out.println("b) Lihat Contact");
System.out.println("c) Keluar");
System.out.println("");
System.out.print("Masukkan kode a/b/c = ");
k1 = input.nextLine();
System.out.println("________________________________________________
____");
System.out.println("");
if (k1.equalsIgnoreCase("a")) {
do {
System.out.print("masukkan nama = ");
a = input.nextLine();
nama[j] = a;
System.out.print("masukkan nomor = ");
b = input.nextLine();
nomor[j] = b;
j++;
System.out.println("");
System.out.print("Mau menyimpan contact lagi? (y/n) = ");
k2 = input.nextLine();
System.out.println("________________________________________
____________");
System.out.println("");
} while (!k2.equalsIgnoreCase("n"));
} else if (k1.equalsIgnoreCase("b")) {
System.out.println("Yang diinputkan = ");

println("Terima Kasih telah menggunakan layanan kami.out. i < j. } } ."). System.println("").println("Memory akan terhapus semua.out.println("Sampai Berjumpa Lagi").println("==================================================== ").equalsIgnoreCase("c")). System. System. } } while (!k1. System.out. } System.out.for (int i = 0. System.println("").out. System.out. i++) { System.out.println(nama[i]). System.out.println("____________________________________________ ________").").out.println(nomor[i]).

Sign up to vote on this title
UsefulNot useful