Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Scanner;
  3.  
  4. public class Genesis {
  5. // Genesis chapter 1
  6. //###### Variables ######//
  7. private int day;
  8. private String creation;
  9. private boolean good;
  10.  
  11. //###### Main method ######//
  12. public Genesis(int day, String creation, boolean good) {
  13. this.day = day;
  14. this.creation = creation;
  15. this.good = good;
  16. }
  17.  
  18. public Genesis(int day) {
  19. this.day = day;
  20. }
  21.  
  22.  
  23. //###### Get functions ######//
  24. public String getCreation(){
  25. return this.creation;
  26. }
  27.  
  28. public int getDay(){
  29. return this.day;
  30. }
  31.  
  32. public boolean getGood(){
  33. return this.good;
  34. }
  35.  
  36. //###### Set functions ######//
  37. public void setDay(int newDay){
  38. this.day = newDay;
  39. }
  40.  
  41. public void setGood(int newGood){
  42. this.day = newGood;
  43. }
  44.  
  45. public void setCreation(int newCreation){
  46. this.day = newCreation;
  47. }
  48.  
  49. //###### Main function ######//
  50. public static void main(String[] args) {
  51. Scanner Input = new Scanner(System.in); // <-- Creating input reader
  52.  
  53. // Story code start's here //
  54. System.out.println("Genesis Chapter One");
  55. System.out.println("-------------------");
  56.  
  57. Genesis day = new Genesis(1);
  58.  
  59. // All the days
  60. Genesis d1 = new Genesis (1, "The light", true);
  61. Genesis d2 = new Genesis (2, "Sky", false);
  62. Genesis d3 = new Genesis (3, "Ground and Plants", true);
  63. Genesis d4 = new Genesis (4, "Sun, moon and stars", true);
  64. Genesis d5 = new Genesis (5, "Flying Animals and Fish", true);
  65. Genesis d6 = new Genesis (6, "Ground Animals", true);
  66. Genesis d7 = new Genesis (7, "Rest", true);
  67.  
  68. // Printing all the variables
  69. System.out.println("Day " + d1.getDay() + ". Creation: " + d1.getCreation() + ". is good? - " + d1.getGood());
  70. System.out.println("Day " + d2.getDay() + ". Creation: " + d2.getCreation() + ". is good? - " + d2.getGood());
  71. System.out.println("Day " + d3.getDay() + ". Creation: " + d3.getCreation() + ". is good? - " + d3.getGood());
  72. System.out.println("Day " + d4.getDay() + ". Creation: " + d4.getCreation() + ". is good? - " + d4.getGood());
  73. System.out.println("Day " + d5.getDay() + ". Creation: " + d5.getCreation() + ". is good? - " + d5.getGood());
  74. System.out.println("Day " + d6.getDay() + ". Creation: " + d6.getCreation() + ". is good? - " + d6.getGood());
  75. System.out.println("Day " + d7.getDay() + ". Creation: " + d7.getCreation() + ". is good? - " + d7.getGood());
  76.  
  77. /* for (int i=1; i<7; i++) {
  78. System.out.print("Please enter Creation for day " + day.getDay() + ":");
  79. day.setCreation() = Input.next();
  80. day = new Genesis (i+1);
  81. }*/
  82.  
  83.  
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement