0% found this document useful (0 votes)
9 views10 pages

Zodiac

Information Technology

Uploaded by

Marie Jan Beloy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

Zodiac

Information Technology

Uploaded by

Marie Jan Beloy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

#include <iostream>

#include <ctime>

int main()

int iZodiac;

time_t rawtime;

struct tm* timeinfo;

time( &rawtime );

timeinfo = localtime( &rawtime );

std::cout << "-----------Zodiac Program----" << std::endl;

std::cout << "----Project on Compter Pogramming 1 C++----" << std::endl;

std::cout << "----Enter your name:----" << std::endl;

do {

std::cout << "\nWhat would you like to do?" << std::endl;

std::cout << "1.) Chinese Zodiac" << std::endl;

std::cout << "2.) Western Zodiac" << std::endl;

std::cout << "3.) Year Born" << std::endl;

std::cout << "4.) Quit Program" << std::endl;

std::cin >> iZodiac;

if (!std::cin || iZodiac <= 0 || iZodiac > 4) {


std::cin.clear();

std::cin.ignore(1000, '\n');

std::cout << "\nI'm sorry but that is not an option. Please answer 1, 2, 3 or 4." << std::endl;

//Start Chinese Zodiac Option

if (iZodiac == 1) {

int iCbirth;

int iCzodiac;

while ((std::cout << "\nEnter year born." << std::endl) && !(std::cin >> iCbirth)) {

std::cout << "\nI'm sorry but that is an invalid answer. Please answer using numbers." <<
std::endl;

std::cin.clear();

std::cin.ignore(1000, '\n');

iCzodiac = iCbirth-((iCbirth/12)*12);

if (iCzodiac == 0){

std::cout << "\nYour Chinese Zodiac is the Monkey." << std::endl;

else if (iCzodiac == 1){

std::cout << "\nYour Chinese Zodiac is the Rooster." << std::endl;


}

else if (iCzodiac == 2){

std::cout << "\nYour Chinese Zodiac is the Dog." << std::endl;

else if (iCzodiac == 3){

std::cout << "\nYour Chinese Zodiac is the Pig." << std::endl;

else if (iCzodiac == 4){

std::cout << "\nYour Chinese Zodiac is the Rat." << std::endl;

else if (iCzodiac == 5){

std::cout << "\nYour Chinese Zodiac is the Ox." << std::endl;

else if (iCzodiac == 6){

std::cout << "\nYour Chinese Zodiac is the Tiger." << std::endl;

else if (iCzodiac == 7){

std::cout << "\nYour Chinese Zodiac is the Rabbit." << std::endl;

else if (iCzodiac == 8){

std::cout << "\nYour Chinese Zodiac is the Dragon." << std::endl;

else if (iCzodiac == 9){

std::cout << "\nYour Chinese Zodiac is the Snake." << std::endl;

}
else if (iCzodiac == 10){

std::cout << "\nYour Chinese Zodiac is the Horse." << std::endl;

else if (iCzodiac == 11){

std::cout << "\nYour Chinese Zodiac is the Goat." << std::endl;

//End Chinese Zodiac Option

//Start Western Zodiac Option

if (iZodiac == 2) {

int iMonth;

int iDay;

while ((std::cout << "\nEnter month born." << std::endl) && !(std::cin >> iMonth)) {

std::cout << "\nI'm sorry but that is an invalid answer. Please answer using numbers." <<
std::endl;

std::cin.clear();

std::cin.ignore(1000, '\n');

while ((std::cout << "\nEnter day born." << std::endl) && !(std::cin >> iDay)) {

std::cout << "\nI'm sorry but that is an invalid answer. Please answer using numbers." <<
std::endl;

std::cin.clear();
std::cin.ignore(1000, '\n');

if (iMonth == 12) {

if (iDay >= 22) {

std::cout << "\nYour Western Zodiac sign is Capricorn." << std::endl;

else if (iDay <= 21) {

std::cout << "\nYour Western Zodiac sign is Sagittarius." << std::endl;

else if (iMonth == 11) {

if (iDay >= 23) {

std::cout << "\nYour Western Zodiac sign is Sagittarius." << std::endl;

else if (iDay <= 22) {

std::cout << "\nYour Western Zodiac sign is Scorpio." <<std::endl;

else if (iMonth == 10) {

if (iDay >= 23) {

std::cout << "\nYour Western Zodiac sign is Scorpio." << std::endl;

else if (iDay <= 22) {

std::cout << "\nYour Western Zodiac sign is Libra." <<std::endl;


}

else if (iMonth == 9) {

if (iDay >= 23) {

std::cout << "\nYour Western Zodiac sign is Libra." << std::endl;

else if (iDay <= 22) {

std::cout << "\nYour Western Zodiac sign is Virgo." <<std::endl;

else if (iMonth == 8) {

if (iDay >= 23) {

std::cout << "\nYour Western Zodiac sign is Virgo." << std::endl;

else if (iDay <= 22) {

std::cout << "\nYour Western Zodiac sign is Leo." <<std::endl;

else if (iMonth == 7) {

if (iDay >= 23) {

std::cout << "\nYour Western Zodiac sign is Leo." << std::endl;

else if (iDay <= 22) {

std::cout << "\nYour Western Zodiac sign is Cancer." <<std::endl;

}
}

else if (iMonth == 6) {

if (iDay >= 22) {

std::cout << "\nYour Western Zodiac sign is Cancer." << std::endl;

else if (iDay <= 21) {

std::cout << "\nYour Western Zodiac sign is Gemini." <<std::endl;

else if (iMonth == 5) {

if (iDay >= 22) {

std::cout << "\nYour Western Zodiac sign is Gemini." << std::endl;

else if (iDay <= 21) {

std::cout << "\nYour Western Zodiac sign is Taurus." <<std::endl;

else if (iMonth == 4) {

if (iDay >= 21) {

std::cout << "\nYour Western Zodiac sign is Taurus." << std::endl;

else if (iDay <= 20) {

std::cout << "\nYour Western Zodiac sign is Aries." <<std::endl;

}
else if (iMonth == 3) {

if (iDay >= 21) {

std::cout << "\nYour Western Zodiac sign is Aries." << std::endl;

else if (iDay <= 20) {

std::cout << "\nYour Western Zodiac sign is Pisces." <<std::endl;

else if (iMonth == 2) {

if (iDay >= 20) {

std::cout << "\nYour Western Zodiac sign is Pisces." << std::endl;

else if (iDay <= 19) {

std::cout << "\nYour Western Zodiac sign is Aquarius." <<std::endl;

else if (iMonth == 1) {

if (iDay >= 21) {

std::cout << "\nYour Western Zodiac sign is Aquarius." << std::endl;

else if (iDay <= 20) {

std::cout << "\nYour Western Zodiac sign is Capricorn." <<std::endl;

}
//End Western Zodiac Option

//Start Year Born Option

if (iZodiac == 3) {

int iAge;

int iYear;

int iBirth;

iYear = (timeinfo->tm_year + 1900);

while ((std::cout << "\nEnter your current age." << std::endl) && !(std::cin >> iAge)) {

std::cout << "\nI'm sorry but that is an invalid answer. Please answer using numbers." <<
std::endl;

std::cin.clear();

std::cin.ignore(1000, '\n');

iBirth = iYear-iAge;

std::cout << "\nYou were born in the year " << iBirth << std::endl;

//End Year Born Option

} while (iZodiac != 4);

std::cout << "\nThank you for playing, Good bye." << std::endl;
std::cout << "----Created by: Cyexam Augree Eden Beloy <3 ----" << std::endl;

return 0;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy