Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. package Pandora;
  2.  
  3. class Mammals {
  4.     int age;
  5.     int weight;
  6.    
  7.     Mammals(int a, int w) {
  8.         age = a;
  9.         weight = w;
  10.     }
  11. }
  12.  
  13. class feline extends Mammals {
  14.     String breed;
  15.     String country;
  16.  
  17.     feline(String c, String b, int age, int weight) {
  18.         super(age, weight);
  19.         breed = c;
  20.         country = b;
  21.     }
  22. }
  23.  
  24. class tiger extends feline {
  25.     String glass;
  26.     int health;
  27.  
  28.     tiger(String e, int l, String c, String b, int age, int weight) {
  29.         super(c, b, age, weight);
  30.         glass = e;
  31.         health = l;
  32.     }
  33. }
  34.  
  35. public class cat extends tiger {
  36.     String name;
  37.     String owner;
  38.    
  39.     cat(String n, String o, String glass, int health, String c, String b, int age, int weight, String souce) {
  40.         super(glass,health,c,b,age,weight);
  41.         name = n;
  42.         owner = o;
  43.         Shaurma BigMac = new Shaurma(age, weight, souce);
  44.     }
  45. }
  46.  
  47. class Shaurma {
  48.     int freshness;
  49.     int amount;
  50.     String coys;
  51.    
  52.     Shaurma(int age, int weight, String soucu) {
  53.         freshness = (int) Math.random() * 100 * (age / 100);
  54.         amount = weight;
  55.         coys = soucu;
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement