Jumat, 31 Mei 2013

Tugas PBO

import java.util.Scanner;
public class test
{
    Scanner input = new Scanner (System.in);
            int pil;
            public void menu()
                        {
                                    System.out.println("\n********** MENU **********\n");
                                    System.out.println("1. Luas Segitiga ");
                                    System.out.println("2. Analisis Bilangan Ganjil/Genap");
                                    System.out.println("3. Tabel perkalian ");
                                    System.out.println("4. EXIT");
                                    System.out.print("Masukkan pilihan : ");
                                    pil = input.nextInt();
                                    switch (pil)
                                    {
                                                case 1 :
                                                            sgtg();
                                                            identitas();
                                                            menu();
                                                            break;
                                                case 2 :
                                                            nama();
                                                            identitas();
                                                            menu();
                                                            break;
                                                case 3 :
                                                            tbl();
                                                            identitas();
                                                            menu();
                                                            break;
                                                case 4 :
                                                            identitas();
                                                            System.exit(1);
                                                default :
                                                            System.out.println("TIDAK ADA DALAM PILIHAN");
                                                            menu();
                                                            break;
                                    }
                        }
                       
                        public void identitas() {
                        System.out.println(" " );
                        System.out.println(" Copyright by Widya Dewi Surya Sugiyono ");
                        }
                       
                        public void sgtg()
                        {
                                    System.out.println(" ");
                                    int luas, alas, tinggi;

Output Luas Segitiga :


Output Analisis Bilangan Ganjil/Genap :


Output Tabel Perkalian :