Fortune Telling Collection - Horoscope - Use C++: give a date, judge what constellation it is, and give the characteristics of this constellation. Requirements: Object-oriented programming, the realization of related functions is encapsulate
Use C++: give a date, judge what constellation it is, and give the characteristics of this constellation. Requirements: Object-oriented programming, the realization of related functions is encapsulate
Use C++: give a date, judge what constellation it is, and give the characteristics of this constellation. Requirements: Object-oriented programming, the realization of related functions is encapsulated in classes.
Create enumeration
Constellation //enum constellation {}
Write the name of 12 constellation with {}.
Create a class
Build an array of classes
Store the information of 12 constellation respectively.
Put a constellation in the class
Start date of the stone break//Example: 0220
End date int Shu Jie // 032 1
……
//Other functions
Code:
First, judge which constellation the entered date belongs to.
Then print out the information in class.
You can do it yourself.
Exercise yourself.
You can format the date.
From 0 10 1 to 123 1
int riQi
For example, enter 0228.
It means February 28th.
Use the if statement if(riQi & gt;; Shikai & Japanese weather < = Shu Jie)
- Previous article:What's the experience of having a green tea bitch around?
- Next article:What is the constellation of1October 18?
- Related articles
- Which zodiac men are most afraid of their wives leaving? Which zodiac men often neglect their wives?
- Do you know what constellations are best at cutting the boss and giving trouble to others?
- 2001June 18 What's the name of the boy born at 8 am?
- Competing constellation combinations among the twelve constellations?
- Zhang Xiaofeng: Xingyue.
- 12 constellation tomorrow _ 12 constellation tomorrow fortune query
- What are the three most difficult constellations to keep in love among the twelve constellations?
- What is the constellation of Yang Yuhuan?
- A series of novels about constellations, one person represents a constellation, twelve protagonists, and one * * * ten.
- Constellation girl who sees the sun through the clouds _ Zodiac who sees the sun through the clouds