Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A perfect day #10

Open
mohayemin opened this issue Mar 20, 2020 · 0 comments
Open

A perfect day #10

mohayemin opened this issue Mar 20, 2020 · 0 comments
Labels
Fundamentals Topic - OOP Fundamentals like Polymorphism, Inheritance, Encapsulation Abstraction etc Very Easy Difficulty Level - Very Easy

Comments

@mohayemin
Copy link
Contributor

mohayemin commented Mar 20, 2020

Overview

Your astronomer friend has recently observed a "perfect planet". Everything about the motion of the planet seems very perfect.
A day, called a "perfect day", on the planet is equal to exactly 16 earth hours. It has just one moon, called the "perfect moon", that rotates around it in exactly 32 days. The planet rotates around the "perfect star" in exactly 256 perfect days.

Your friend wants you to build a simulation software for the perfect planet. To begin with, you are requested to make date and time simulations for the planet.

Task

  • Create a PerfectDate class that represents a perfect day of the perfect planet.
  • The PerfectDate class should have a year, a month and a date.
  • The PerfectDate class must be immutable, that means that the values of the PerfectDate cannot be changed after initialization.
  • The PerfectDate class should have a method nextDay that should return the next day of the perfect calendar.

Example

The examples are in yyyy/MM/dd format.

  • The day after 1813/01/03 is 1813/01/04
  • The day after 1813/01/32 is 1813/02/01
  • The day after 1813/08/32 is 1814/01/01

Reminders

  • React to the problem if you find it interesting and helpful. This will help others to easily identify good problems to solve.
  • Feel free to comment about the problem. Is the description unclear? Do you think it is too easy or too difficult than what is mentioned? Comment about it.
  • Discussion about the solution is OK. But do not paste a solution here. Give a link to the solution instead.
  • Do you have an interesting problem? Post it.
@mohayemin mohayemin added Very Easy Difficulty Level - Very Easy Fundamentals Topic - OOP Fundamentals like Polymorphism, Inheritance, Encapsulation Abstraction etc labels Mar 20, 2020
ratulMahjabin added a commit that referenced this issue Mar 20, 2020
ratulMahjabin added a commit that referenced this issue Mar 21, 2020
Hasan-Saju added a commit that referenced this issue Mar 26, 2020
Solution Issue #10
Hasan-Saju added a commit that referenced this issue Mar 26, 2020
Hasan-Saju added a commit that referenced this issue Mar 26, 2020
wasiulhaque added a commit that referenced this issue Mar 27, 2020
wasiulhaque added a commit that referenced this issue Mar 28, 2020
mohayemin added a commit that referenced this issue Mar 29, 2020
@mohayemin mohayemin reopened this Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fundamentals Topic - OOP Fundamentals like Polymorphism, Inheritance, Encapsulation Abstraction etc Very Easy Difficulty Level - Very Easy
Projects
None yet
Development

No branches or pull requests

1 participant