(Java)Parampapa(inheritanse/pewarisan)


Assalammualaikum semua , kali ini saya akan memposting hasil karya saya yang bertema dengan PARAMPAPA , bila tema – tema sering main dengan game parampapa pasti selesai menjalankan tugasnya sebagai User Games, ok langsung kita mulai ke scrip nya.saya membagi beberapa scrip untuk mempermudah dalam pembacaan scrip , saya menggunakan Inheritanse(perwarisan) .

1. Create class TugasAkhir.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdydsf
 */
public class TugasAkhir extends Pertanyaan_pertama{

    
    public static void Utama(String[] args) throws IOException {
        // TODO code application logic here
        boolean mulai=true;
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       String str ="";
       
        
        System.out.println("*****      PARAMPAPA      ******\n"
                         + "*******                 ********\n\n"
                + "Aturan main :\n"
                + "- Selesaikan pertanyaan - pertanyaan yang ada  hingga selesai.\n"
                + "  pertanyaan tidak terlalu sulit dan terkadang memusingkan kepala\n\n"
                + "- Anda diberi kesempatan 2x setiap soal yang ada.\n\n"
                + "Tekan Enter untuk Melanjut :");
        str=br.readLine();
      
        Pertanyaan_pertama pt =new Pertanyaan_pertama();
        TugasAkhir.Pertama(args);
        
        
       
    }
}
<pre> 

Create class Pertanyaan_pertama

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataInput;
import java.io.IOException;
import java.io.InputStreamReader;
import sun.org.mozilla.javascript.internal.ast.WhileLoop;

/**
 *
 * @author aerdy
 */
public class Pertanyaan_pertama extends Pertanyaan_kedua{
  
    public static void Pertama(String[] args) throws IOException {
       int a=2;
        do{
            a--;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       String str ="";
       
        
        System.out.println("_______PERTANYAAN__________\n"
                + "What Is wrong,\n"
                + "What is wrong?\n"
                + "_____________________\n \n"
                + "a.me,My Self\n"
                + "b.this Level\n"
                + "c.you\n"
                + "d.false\n"
                + "\n"
                + "Jawaban anda :");
      
            str = br.readLine();
            
        if(str.equals("b")){
            Pertanyaan_pertama.Kedua(args);
        }
        
        System.out.println("Kesempatan anda tinggal ="+a+"\n");
        } while(a>0);
        TugasAkhir tg = new TugasAkhir();
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 10   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        
    }
}
<pre> 

Create class Pertanyaan_kedua

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaan_kedua extends Pertannyaan_tiga{

    public static void Kedua(String[] args) throws IOException {
        System.out.println("selamat Anda Mendapatkan Nyawa 2 \n\n");
        
        int a=2;
        do{
           
        
        a--;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String jawab="";
        System.out.println("_________PERTANYAAN_____________\n"
                + "Coba Di teliti Kalimat DI bawah Ini\n\n"
                + "''Coba di teliti dengan seksama,dan "
                + "carilah kekeliruan di kalimat ini? ''\n"
                + "\n"
                + "__________________________________\n\n"
                + "a.Coba diteliti dengan seksama,dan carilah kekeliruan di kalimat ini?\n"
                + "b.coba diteliti dengan seksama,dan carilah kekeliruan di kalimat Ini!\n"
                + "c.Coba diteliti dengan seksama,dan carilah kekeliruan di kalimat ini!\n"
                + "d.coba di teliti dengan Seksama, Dan carilah Kekeliruan di Kalimat Ini?\n\n"
                + "Jawaban Anda :");
                
        jawab=br.readLine();
        if(jawab.equals("c")){
            Pertanyaan_kedua.tiga(args);
            
        }
            System.out.println("Kesempatan  anda tingaal ="+a+"\n\n\n\n\n\n\n\n\n");
        }while(a>0);
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 20   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    }
    
}
<pre> 

Create Class Pertanyaan_ketigas

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertannyaan_tiga extends Pertanyaa_keembat{
    public static void tiga(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDATAPKAN NYAWA 2\n\n");
        int a=2;
        do{
        a--;    
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String jawab="";
        
        System.out.println("________PERTANYAAN__________\n"
                + "M-V-B-M-J-S-U-N\n"
                + "_________________________\n\n"
                + "a.X\n"
                + "b.P\n"
                + "c.R\n"
                + "d.T\n\n"
                + "Jawaba Anda:");
        jawab = br.readLine();
        
        if(jawab.equals("b")){
            Pertannyaan_tiga.empat(args);
        }
            System.out.println("KESEMPATAN ANDA TINGGAL "+a);
        }while(a>0);
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 30   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    }
    
}
<pre> 

Create Class Pertanyaan_keempat

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaa_keembat extends Pertanyaan5{
    
    public static void empat(String[] args) throws IOException {
        
        System.out.println("SeLAMAt ANDA MENDAPAKAN NYAWA 2\n\n");
        int a=2;
        do{
            
        a--;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String jawab="";
        System.out.println("________PERTANYAAN________\n"
                + "What's Capital of Indonesia\n"
                + "__________________________\n\n"
                + "a.Jakarta\n"
                + "b.Java\n"
                + "c.Batavia\n"
                + "d.Betawi\n\n"
                + "Jawaban Anda :");
        jawab = br.readLine();
        if(jawab.equals("i") || jawab.equals("I")){
            Pertanyaa_keembat.lima(args);
        }
            System.out.println("Kesempatan Anda Tinggal = "+a);
        }while(a>0);
        
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 30   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
}
}
<pre> 

Create Class Pertanyaan5

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaan5 extends pertanyaan6{

    public static void lima(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n");
        int a=3;
        do{
            
        
            a--;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String jawab ="";
        System.out.println("_________PErtANYAAN_________\n"
                + "Jika A=B dan C=D maka G = ???\n"
                + "____________________\n"
                + "a.A\n"
                + "b.H\n"
                + "c.I\n"
                + "d.C\n\n"
                + "Jawaban Anda");
        jawab= br.readLine();
        if(jawab.equals("a")){
            pertanyaan6.enam(args);
        }
            System.out.println("Kesempatan Anda TIngaal "+a);
        }while(a>0);
        
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 50   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    }
}
<pre> 

Create class Pertanyaan6

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class pertanyaan6 extends Pertanyaan7{
    public static void enam(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n");            
    
int a=2;
do{
    
a--;
     BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
     String jawab="";
     System.out.println("________PERTANYAAN________\n"
             + "HakApa \n"
             + "ADNA ASIB\n"
             + "ACAB\n"
             + "________________\n\n"
             + "a.EAAATT!!\n"
             + "b.AY!!!!\n"
             + "c.HAHH???\n"
             + "d.AGK Paham!!!\n\n"
             + "JAWABAN ANDA =");
     jawab=br.readLine();
     if(jawab.equals("b")){
         pertanyaan6.tujuh(args);
     }
         System.out.println("KESEMPATAN ANDA TINGGAL "+a);
     }while(a>0);

        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 60   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
}
}
<pre> 

Create Class Pertanyaan7

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaan7 extends pertanyaan8{
    
    
    public static void tujuh(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n");
        int a=2;
        do{
            
        a--;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         String jawab="";
         System.out.println("________PERTANYAAN________\n"
                 + "Apakah Huruf Kelima Dari ALFABET\n"
                 + "____________________\n"
                 + "a.E\n"
                 + "b.B\n"
                 + "c.C\n"
                 + "d.D\n\n"
                 + "JAWABAN ANDA : \n");
         jawab=br.readLine();
         if(jawab.equals("b")){
             Pertanyaan7.delapan(args);
         }
            System.out.println("KESEMPATAN ANDA TINGAL " +a);
        }while(a>0);
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 70   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }else{
            System.exit(a);
        }
    }
  
}
<pre> 

Create class Pertanyaan8

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class pertanyaan8 extends Pertanyaan9{
    public static void delapan(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n\n");
        int a=2;
        do{
            
        a--;
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         String jawab="";
         System.out.println("________PERTANYAAN_______\n"
                 + "Yang Bukan Nama Lokasi ?\n"
                 + "_____________________\n\n"
                 + "a.Bali\n"
                 + "b.Cali\n"
                 + "c.Jali\n"
                 + "d.Mali\n\n"
                 + "JAWABAN ANDA : \n");
         jawab = br.readLine();
         if(jawab.equals("c")){
             pertanyaan8.sembilan(args);
         }
            System.out.println("KESEMPATAN ANDA TINGAAL "+a);
        }while(a>0);
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 80   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    }
    
}
<pre> 

Create Class Pertanyaan9

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaan9 extends Pertanyaan10{
    public static void sembilan(String[] args) throws IOException {
        
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n\n");
        int a=2;
        do{
            
       a--;
     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
     String jawab="";
     System.out.println ("____PErtANYAAN_______\n"
             + "12-(3+5-5)=\n"
             + "________________\n"
             + "a.10\n"
             + "b.11\n"
             + "c.12\n"
             + "d.Sembilan\n\n"
             + "JAWABAN ANDA :");
    jawab=br.readLine();
     if(jawab.equals("9")){
         Pertanyaan9.sepuluh(args);
     }
            System.out.println("KESEMPATAN ANDA TINGAAL "+a+"\n");
        }while(a>0);
        
        
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 90   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    
}
}
<pre> 

Create class Pertanyaan10

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author aerdy
 */
public class Pertanyaan10 {
    public static void sepuluh(String[] args) throws IOException {
        System.out.println("SELAMAT ANDA MENDAPATKAN NYAWA 2\n\n");
        
        int a=2;
        do{
            
        a--;
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
         String jawab="";
         System.out.println("______PErtANYAAN_______\n"
                 + "DEATH\n"
                 + "______________\n"
                 + "a.Sejarah\n"
                 + "b.MateMatIka\n"
                 + "c.Fisika\n"
                 + "d.Komputer\n\n"
                 + "JAWABAN ANDA :");
         jawab=br.readLine();
         
         if(jawab.equals("b")){
             System.out.println("TAMAT DAN SELESAI \n"
                     + "TerIMA KASIH\n\n"
                     + "****       *******\n"
                     + "****  100  *******\n"
                     + "****       *******\n");
             System.exit(a);
         }
            System.out.println("KESEMPATAN ANDA TINGGAL " +a+"\n");
        }while(a>0);
         
        String balik="";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        System.out.println("Kesempatan anda telah habis :\n"
                         + "--------      Point anda 100   ----------\n\n"
                         + "1. Menu Utama\n"
                         + "2. Keluar");
        balik = br.readLine();
        if(balik.equals("1")){
            TugasAkhir.Utama(args);
        }
        else{
            System.exit(a);
        }
    }
    
}
<pre> 

Create Class Main

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas.akhir;

import java.io.IOException;
/**
 *
 * 
 * 
 * @author aerdy
 */
public class Main extends TugasAkhir{
    public static void main(String[] args) throws IOException {
        Main.Utama(args);
    }
    
}
<pre> 

Download file Projectnya di
http://www.ziddu.com/download/18219173/TugasAkhir.rar.html

Advertisements

Published by

jarcode

hello I am jarcode

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s