Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Scanner;
- public class Genesis {
- // Genesis chapter 1
- //###### Variables ######//
- private int day;
- private String creation;
- private boolean good;
- //###### Main method ######//
- public Genesis(int day, String creation, boolean good) {
- this.day = day;
- this.creation = creation;
- this.good = good;
- }
- public Genesis(int day) {
- this.day = day;
- }
- //###### Get functions ######//
- public String getCreation(){
- return this.creation;
- }
- public int getDay(){
- return this.day;
- }
- public boolean getGood(){
- return this.good;
- }
- //###### Set functions ######//
- public void setDay(int newDay){
- this.day = newDay;
- }
- public void setGood(int newGood){
- this.day = newGood;
- }
- public void setCreation(int newCreation){
- this.day = newCreation;
- }
- //###### Main function ######//
- public static void main(String[] args) {
- Scanner Input = new Scanner(System.in); // <-- Creating input reader
- // Story code start's here //
- System.out.println("Genesis Chapter One");
- System.out.println("-------------------");
- Genesis day = new Genesis(1);
- // All the days
- Genesis d1 = new Genesis (1, "The light", true);
- Genesis d2 = new Genesis (2, "Sky", false);
- Genesis d3 = new Genesis (3, "Ground and Plants", true);
- Genesis d4 = new Genesis (4, "Sun, moon and stars", true);
- Genesis d5 = new Genesis (5, "Flying Animals and Fish", true);
- Genesis d6 = new Genesis (6, "Ground Animals", true);
- Genesis d7 = new Genesis (7, "Rest", true);
- // Printing all the variables
- System.out.println("Day " + d1.getDay() + ". Creation: " + d1.getCreation() + ". is good? - " + d1.getGood());
- System.out.println("Day " + d2.getDay() + ". Creation: " + d2.getCreation() + ". is good? - " + d2.getGood());
- System.out.println("Day " + d3.getDay() + ". Creation: " + d3.getCreation() + ". is good? - " + d3.getGood());
- System.out.println("Day " + d4.getDay() + ". Creation: " + d4.getCreation() + ". is good? - " + d4.getGood());
- System.out.println("Day " + d5.getDay() + ". Creation: " + d5.getCreation() + ". is good? - " + d5.getGood());
- System.out.println("Day " + d6.getDay() + ". Creation: " + d6.getCreation() + ". is good? - " + d6.getGood());
- System.out.println("Day " + d7.getDay() + ". Creation: " + d7.getCreation() + ". is good? - " + d7.getGood());
- /* for (int i=1; i<7; i++) {
- System.out.print("Please enter Creation for day " + day.getDay() + ":");
- day.setCreation() = Input.next();
- day = new Genesis (i+1);
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement