151 lines
4.5 KiB
C++
151 lines
4.5 KiB
C++
|
#include <iostream>
|
||
|
#include <console.h>>
|
||
|
#include "WeatherReport.h"
|
||
|
#include "error.h"
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
//User Input Variables
|
||
|
int userValue;
|
||
|
string continentResult = "";
|
||
|
string countryResult = "";
|
||
|
|
||
|
//Startup Message
|
||
|
cout << "Welcome to the Weather Console! Pick your continent." << endl << endl;
|
||
|
|
||
|
//Loads all the continent up
|
||
|
for (int i = 1; i <= 7; i++) {
|
||
|
cout << i << ". " << continents(i) << endl;
|
||
|
}
|
||
|
|
||
|
//Lets the user select the continent they prefer
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
continentResult = continents(userValue);
|
||
|
//Checks if user didnt put in a invalid number
|
||
|
if (!(continentResult == "Invalid option")) break;
|
||
|
error("Invalid option, try Again.");
|
||
|
}
|
||
|
|
||
|
//States what they entered, asks them for country
|
||
|
if(!(userValue == 5)) {
|
||
|
cout << endl << "You choose " << continentResult << ". " << "Choose your country."
|
||
|
<< endl << endl;
|
||
|
}
|
||
|
|
||
|
//giant fucking lists of if statements cause i have issues
|
||
|
if(userValue == 1) {
|
||
|
//Asia Option
|
||
|
for (int i = 1; i <= 48; i++) {
|
||
|
cout << i << ". " << asia(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = asia(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else if (userValue == 2) {
|
||
|
//Africa Option
|
||
|
for (int i = 1; i <= 54; i++) {
|
||
|
cout << i << ". " << africa(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = africa(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else if (userValue == 3) {
|
||
|
//North America Option
|
||
|
for (int i = 1; i <= 23; i++) {
|
||
|
cout << i << ". " << northAmerica(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = northAmerica(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else if (userValue == 4) {
|
||
|
//South America Option
|
||
|
for (int i = 1; i <= 14; i++) {
|
||
|
cout << i << ". " << southAmerica(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = southAmerica(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else if (userValue == 5) {
|
||
|
//Antarctica Option
|
||
|
cout << endl << "HOW ARE YOU NOT DEAD YET? TF MAN.. GOOD LUCK BRO XD";
|
||
|
return 0;
|
||
|
|
||
|
} else if (userValue == 6) {
|
||
|
//Europe Option
|
||
|
for (int i = 1; i <= 48; i++) {
|
||
|
cout << i << ". " << europe(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = europe(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else if (userValue == 7) {
|
||
|
//Australia Option
|
||
|
for (int i = 1; i <= 23; i++) {
|
||
|
cout << i << ". " << australia(i) << endl;
|
||
|
}
|
||
|
|
||
|
while (true) {
|
||
|
cout << endl << "Pick your choice: ";
|
||
|
cin >> userValue;
|
||
|
countryResult = australia(userValue);
|
||
|
if (!(countryResult == "Invalid option")) break;
|
||
|
error("Invalid option, try again.");
|
||
|
}
|
||
|
|
||
|
} else {
|
||
|
//If something went wrong, then it will close the application
|
||
|
|
||
|
stop("Something went wrong, closing now. Sorry!");
|
||
|
}
|
||
|
|
||
|
//Reports back to the user there choice
|
||
|
cout << endl << "You choose " << continentResult << " as your continent. And " << countryResult << " as your country."
|
||
|
<< endl << endl;
|
||
|
|
||
|
//Starts the proccess of finding the weather
|
||
|
findWeatherReport(continentResult, countryResult);
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
* THIS CODE WAS DESIGNED ENTIRELY BY HATSUNE PATRICK, 初音パトリック.
|
||
|
* LEARNING BOOK IS PROGRAMING ABSTRACTIONS IN C++.
|
||
|
* FILE CONTAINS CHAPTER 2 LEARNING BLOCKS.
|
||
|
* i need to find something better to fucking do
|
||
|
*/
|