diff --git a/GetWeather b/GetWeather new file mode 100755 index 0000000..7dcb918 Binary files /dev/null and b/GetWeather differ diff --git a/GetWeather.pro b/GetWeather.pro new file mode 100755 index 0000000..bd3f75c --- /dev/null +++ b/GetWeather.pro @@ -0,0 +1,152 @@ +############################################################################### +# Project file for CS106B/X student program +# +# @version Fall Quarter 2022 for Qt 6 +# @author Julie Zelenski +# build client program using installed static library +############################################################################### + +SPL_VERSION = 2022.1 +SPL_URL = https://web.stanford.edu/dept/cs_edu/qt + +TEMPLATE = app +QT += core gui widgets network +CONFIG += silent debug # quiet build and debug symbols always +CONFIG -= depend_includepath # library headers not changing, don't add depend + +############################################################################### +# Find/use installed version of cs106 lib and headers # +############################################################################### + +# Library installed into per-user writable data location from QtStandardPaths +win32|win64 { QTP_EXE = qtpaths.exe } else { QTP_EXE = qtpaths } +USER_DATA_DIR = $$system($$[QT_INSTALL_BINS]/$$QTP_EXE --writable-path GenericDataLocation) + +SPL_DIR = $${USER_DATA_DIR}/cs106 +STATIC_LIB = $$system_path($${SPL_DIR}/lib/libcs106.a) +SPL_VERSION_FILE = $$system_path($${SPL_DIR}/lib/version$${SPL_VERSION}) + +# Confirm presence of lib before build using extra target as prereq +check_lib.target = "$${STATIC_LIB}" +check_lib.commands = $(error No CS106 library found. Install CS106 package following instructions at $${SPL_URL}) +QMAKE_EXTRA_TARGETS += check_lib +PRE_TARGETDEPS += $${check_lib.target} + +# Confirm version of library is current +check_version.target = "$${SPL_VERSION_FILE}" +check_version.commands = $(error Cannot find version $${SPL_VERSION} of CS106 library. Install CS106 package following instructions at $${SPL_URL}) +QMAKE_EXTRA_TARGETS += check_version +PRE_TARGETDEPS += $${check_version.target} + +# link against libcs106.a, add library headers to search path +# libcs106 requires libpthread, add link here +LIBS += -lcs106 -lpthread +QMAKE_LFLAGS = -L$$shell_quote($${SPL_DIR}/lib) +# put PWD first in search list to allow local copy to shadow if needed +INCLUDEPATH += $$PWD "$${SPL_DIR}/include" + +############################################################################### +# Configure project with custom settings # +############################################################################### + +# remove spaces from target executable for better Windows compatibility +TARGET = $$replace(TARGET, " ", _) + +# set DESTDIR to project root dir, this is where executable/app will deploy and run +DESTDIR = $$PWD + +# student writes ordinary main() function, but it must be called within a +# wrapper main() that handles library setup/teardown. Rename student's +# to distinguish between the two main() functions and avoid symbol clash +# Ask Julie if you are curious why main->qMain->studentMain +DEFINES += main=qMain qMain=studentMain + +############################################################################### +# Gather files to list in Qt Creator project browser # +############################################################################### + +# honeypot to trick Qt Creator to allow glob-all to coexist with user-added files +# Qt looks for first 'SOURCES *=' line and lists user-added .cpp/h files there. +# Afterward we glob-add files to SOURCES ourselves. Operator *= will unique +# entries, so no worries about duplicates +SOURCES *= "" \ + WeatherReport.cpp \ + error.cpp +HEADERS *= "" \ + WeatherReport.h \ + error.h + +# Gather any .cpp or .h files within the project folder (student/starter code). +# Second argument true makes search recursive +SOURCES *= $$files(*.cpp, true) +HEADERS *= $$files(*.h, true) + +# Gather resource files (image/sound/etc) from res dir, list under "Other files" +OTHER_FILES *= $$files(res/*, true) +# Gather text files from root dir or anywhere recursively +OTHER_FILES *= $$files(*.txt, true) + +############################################################################### +# Configure compiler, compile flags # +############################################################################### + +# Configure flags for the C++ compiler +# (In general, many warnings/errors are enabled to tighten compile-time checking. +# A few overly pedantic/confusing errors are turned off to avoid confusion.) + +CONFIG += sdk_no_version_check # removes spurious warnings on Mac OS X + +# MinGW compiler lags, be conservative and use C++11 on all platforms +# rather than special case +CONFIG += c++11 + +# WARN_ON has -Wall -Wextra, add/remove a few specific warnings +QMAKE_CXXFLAGS_WARN_ON += -Werror=return-type +QMAKE_CXXFLAGS_WARN_ON += -Werror=uninitialized +QMAKE_CXXFLAGS_WARN_ON += -Wunused-parameter +QMAKE_CXXFLAGS_WARN_ON += -Wmissing-field-initializers +QMAKE_CXXFLAGS_WARN_ON += -Wno-old-style-cast +QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare +QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-conversion +QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-const-variable + +*-clang { # warning flags specific to clang + QMAKE_CXXFLAGS_WARN_ON += -Wempty-init-stmt + QMAKE_CXXFLAGS_WARN_ON += -Wignored-qualifiers +} + +*-g++ { # warning flags specific to g++ + QMAKE_CXXFLAGS_WARN_ON += -Wlogical-op +} + +############################################################################### +# Detect/report errors in project structure # +############################################################################### + +# error if project opened from within a ZIP archive (common mistake on Windows) +win32|win64 { + contains(PWD, .*\.zip.*) | contains(PWD, .*\.ZIP.*) { + message( "*******************************************************************" ) + message( "*** ERROR: You are trying to open this project from within a ZIP archive." ) + message( "*** You must first extract the files then open in Qt Creator." ) + message( "*** In File Explorer open the ZIP and choose to Extract All." ) + message( "*******************************************************************" ) + error( Exiting. Extract project from ZIP first.) + } +} + +# error if name of directory has chars that may cause trouble for qmake/make/shell +PROJECT_DIR = $$basename(PWD) +FOUND = $$PROJECT_DIR +FOUND ~= s|[a-z A-Z 0-9 _.+-]|| # yes, spaces ok, limited punctuation, $ % & are dicey +!isEmpty(FOUND) { + message( "*******************************************************************" ) + message( "*** ERROR: The name of your project directory has disallowed characters." ) + message( "*** The allowed characters are letters, numbers, and simple punctuation." ) + message( "*** Your directory is named $$PROJECT_DIR which contains the" ) + message( "*** disallowed characters: $$FOUND" ) + message( "*** Please rename to a simple name such as Assignment_1 that contains" ) + message( "*** no disallowed characters." ) + message( "*******************************************************************" ) + error(Exiting. Rename project directory to remove disallowed characters. ) +} diff --git a/GetWeather.pro.user b/GetWeather.pro.user new file mode 100755 index 0000000..6a33f75 --- /dev/null +++ b/GetWeather.pro.user @@ -0,0 +1,263 @@ + + + + + + EnvironmentId + {2a76ef88-3f3d-407d-bd6a-8a69fb9220c1} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 6.5.1 GCC 64bit + Desktop Qt 6.5.1 GCC 64bit + qt.qt6.651.gcc_64_kit + 1 + 0 + 0 + + 0 + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Debug + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Release + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Profile + /storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/storage/Users/keyemail/Documents/QT PROJECTS/GetWeather/GetWeather.pro + /storage/Users/keyemail/Documents/QT PROJECTS/GetWeather/GetWeather.pro + false + true + true + false + true + /storage/Users/keyemail/Documents/QT PROJECTS/GetWeather + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/WeatherReport.cpp b/WeatherReport.cpp new file mode 100755 index 0000000..b7e5ee9 --- /dev/null +++ b/WeatherReport.cpp @@ -0,0 +1,735 @@ +#include +#include +#include +#include "WeatherReport.h" +using namespace std; + +/*void weatherReport(string weatherLocationInput) { + cout << endl; + cout << "Gathering Weather Data from " << weatherLocationInput << " Location..." << endl << endl; + usleep(3000000); + cout << "Idfk, go look outside yourself.." << endl; + system("pause"); +} +*/ + +void findWeatherReport(string continent, string country) { + cout << "Caculating the weather for " << continent << ": " << country << "....." << endl << endl; + usleep(3000000); + cout << "Go look outside yourself you lazy human, you think ima just tell you for free? nah 5 bucks buddy.."; +} + +string continents(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "Asia"; + break; + case 2: + return "Africa"; + break; + case 3: + return "North America"; + break; + case 4: + return "South America"; + break; + case 5: + return "Antarctica"; + break; + case 6: + return "Europe"; + break; + case 7: + return "Australia"; + break; + default: + return "Invalid option"; + break; + } +} + +string asia(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "China"; + break; + case 2: + return "India"; + break; + case 3: + return "Indonesia"; + break; + case 4: + return "Pakistan"; + break; + case 5: + return "Bangladesh"; + break; + case 6: + return "Japan"; + break; + case 7: + return "Philippines"; + break; + case 8: + return "Vietnam"; + break; + case 9: + return "Turkey"; + break; + case 10: + return "Iran"; + break; + case 11: + return "Thailand"; + break; + case 12: + return "Myanmar"; + break; + case 13: + return "South Korea"; + break; + case 14: + return "Iraq"; + break; + case 15: + return "Afghanistan"; + break; + case 16: + return "Saudi Arabia"; + break; + case 17: + return "Uzbekistan"; + break; + case 18: + return "Malaysia"; + break; + case 19: + return "Yemen"; + break; + case 20: + return "Nepal"; + break; + case 21: + return "North Korea"; + break; + case 22: + return "Sri Lanka"; + break; + case 23: + return "Kazakhstan"; + break; + case 24: + return "Syria"; + break; + case 25: + return "Cambodia"; + break; + case 26: + return "Jordan"; + break; + case 27: + return "Azerbaijan"; + break; + case 28: + return "United Arab Emirates"; + break; + case 29: + return "Tajikistan"; + break; + case 30: + return "Israel"; + break; + case 31: + return "Laos"; + break; + case 32: + return "Lebanon"; + break; + case 33: + return "Kyrgyzstan"; + break; + case 34: + return "Turkmenistan"; + break; + case 35: + return "Singapore"; + break; + case 36: + return "Oman"; + break; + case 37: + return "State of Palestine"; + break; + case 38: + return "Kuwait"; + break; + case 39: + return "Georgia"; + break; + case 40: + return "Mongolia"; + break; + case 41: + return "Armenia"; + break; + case 42: + return "Qatar"; + break; + case 43: + return "Bahrain"; + break; + case 44: + return "Timor-Leste"; + break; + case 45: + return "Cyprus"; + break; + case 46: + return "Bhutan"; + break; + case 47: + return "Maldives"; + break; + case 48: + return "Brunei"; + break; + default: + return "Invalid option"; + break; + } +} + +string africa(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "Nigeria"; + break; + case 2: + return "Ethiopia"; + break; + case 3: + return "Egypt"; + break; + case 4: + return "DR Congo"; + break; + case 5: + return "Tanzania"; + break; + case 6: + return "South Africa"; + break; + case 7: + return "Kenya"; + break; + case 8: + return "Uganda"; + break; + case 9: + return "Algeria"; + break; + case 10: + return "Sudan"; + break; + case 11: + return "Morocco"; + break; + case 12: + return "Angola"; + break; + case 13: + return "Mozambique"; + break; + case 14: + return "Ghana"; + break; + case 15: + return "Madagascar"; + break; + case 16: + return "Cameroon"; + break; + case 17: + return "Côte d'Ivoire"; + break; + case 18: + return "Niger"; + break; + case 19: + return "Burkina Faso"; + break; + case 20: + return "Mali"; + break; + case 21: + return "Malawi"; + break; + case 22: + return "Zambia"; + break; + case 23: + return "Senegal"; + break; + case 24: + return "Chad"; + break; + case 25: + return "Somalia"; + break; + case 26: + return "Zimbabwe"; + break; + case 27: + return "Guinea"; + break; + case 28: + return "Rwanda"; + break; + case 29: + return "Benin"; + break; + case 30: + return "Burundi"; + break; + case 31: + return "Tunisia"; + break; + case 32: + return "South Sudan"; + break; + case 33: + return "Togo"; + break; + case 34: + return "Sierra Leone"; + break; + case 35: + return "Libya"; + break; + case 36: + return "Congo"; + break; + case 37: + return "Liberia"; + break; + case 38: + return "Central African Republic"; + break; + case 39: + return "Mauritania"; + break; + case 40: + return "Eritrea"; + break; + case 41: + return "Namibia"; + break; + case 42: + return "Gambia"; + break; + case 43: + return "Botswana"; + break; + case 44: + return "Gabon"; + break; + case 45: + return "Lesotho"; + break; + case 46: + return "Guinea-Bissau"; + break; + case 47: + return "Equatorial Guinea"; + break; + case 48: + return "Mauritius"; + break; + case 49: + return "Eswatini"; + break; + case 50: + return "Djibouti"; + break; + case 51: + return "Comoros"; + break; + case 52: + return "Cabo Verde"; + break; + case 53: + return "Sao Tome & Principe"; + break; + case 54: + return "Seychelles"; + break; + default: + return "Invalid option"; + break; + } +} + +string northAmerica(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "United States"; + break; + case 2: + return "Mexico"; + break; + case 3: + return "Canada"; + break; + case 4: + return "Guatemala"; + break; + case 5: + return "Haiti"; + break; + case 6: + return "Dominican Republic"; + break; + case 7: + return "Cuba"; + break; + case 8: + return "Honduras"; + break; + case 9: + return "Nicaragua"; + break; + case 10: + return "El Salvador"; + break; + case 11: + return "Costa Rica"; + break; + case 12: + return "Panama"; + break; + case 13: + return "Jamaica"; + break; + case 14: + return "Trinidad And Tobago"; + break; + case 15: + return "Bahamas"; + break; + case 16: + return "Jamaica"; + break; + case 17: + return "Barbados"; + break; + case 18: + return "Saint Lucia"; + break; + case 19: + return "Grenada"; + break; + case 20: + return "Saint Vincent And The Grenadines"; + break; + case 21: + return "Antigua And Barbuda"; + break; + case 22: + return "Dominica"; + break; + case 23: + return "Saint Kitts And Nevis"; + break; + default: + return "Invalid option"; + break; + } +} + +string southAmerica(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "Brazil"; + break; + case 2: + return "Colombia"; + break; + case 3: + return "Argentina"; + break; + case 4: + return "Peru"; + break; + case 5: + return "Venezuela"; + break; + case 6: + return "Chile"; + break; + case 7: + return "Ecuador"; + break; + case 8: + return "Bolivia"; + break; + case 9: + return "Paraguay"; + break; + case 10: + return "Uruguay"; + break; + case 11: + return "Guyana"; + break; + case 12: + return "Suriname"; + break; + case 13: + return "French Guiana"; + break; + case 14: + return "Falkland Islands"; + break; + default: + return "Invalid option"; + break; + } +} + +string europe(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "Russia"; + break; + case 2: + return "Germany"; + break; + case 3: + return "United Kingdom"; + break; + case 4: + return "France"; + break; + case 5: + return "Italy"; + break; + case 6: + return "Spain"; + break; + case 7: + return "Ukraine"; + break; + case 8: + return "Poland"; + break; + case 9: + return "Romania"; + break; + case 10: + return "Netherlands"; + break; + case 11: + return "Belgium"; + break; + case 12: + return "Czech Republic (Czechia)"; + break; + case 13: + return "Greece"; + break; + case 14: + return "Portugal"; + break; + case 15: + return "Sweden"; + break; + case 16: + return "Hungary"; + break; + case 17: + return "Belarus"; + break; + case 18: + return "Austria"; + break; + case 19: + return "Serbia"; + break; + case 20: + return "Switzerland"; + break; + case 21: + return "Bulgaria"; + break; + case 22: + return "Denmark"; + break; + case 23: + return "Finland"; + break; + case 24: + return "Slovakia"; + break; + case 25: + return "Norway"; + break; + case 26: + return "Ireland"; + break; + case 27: + return "Croatia"; + break; + case 28: + return "Moldova"; + break; + case 29: + return "Bosnia and Herzegovina"; + break; + case 30: + return "Albania"; + break; + case 31: + return "Lithuania"; + break; + case 32: + return "North Macedonia"; + break; + case 33: + return "Slovenia"; + break; + case 34: + return "Latvia"; + break; + case 35: + return "Estonia"; + break; + case 36: + return "Montenegro"; + break; + case 37: + return "Luxembourg"; + break; + case 38: + return "Malta"; + break; + case 39: + return "Iceland"; + break; + case 40: + return "Channel Islands"; + break; + case 41: + return "Isle of Man"; + break; + case 42: + return "Andorra"; + break; + case 43: + return "Faeroe Islands"; + break; + case 44: + return "Monaco"; + break; + case 45: + return "Liechtenstein"; + break; + case 46: + return "San Marino"; + break; + case 47: + return "Gibraltar"; + break; + case 48: + return "Holy See"; + break; + default: + return "Invalid option"; + break; + } +} + +string australia(int responseNumberInput) { + switch (responseNumberInput) { + case 1: + return "Australia"; + break; + case 2: + return "Papua New Guinea"; + break; + case 3: + return "New Zealand"; + break; + case 4: + return "Fiji"; + break; + case 5: + return "Solomon Islands"; + break; + case 6: + return "Micronesia"; + break; + case 7: + return "Vanuatu"; + break; + case 8: + return "New Caledonia"; + break; + case 9: + return "French Polynesia"; + break; + case 10: + return "Samoa"; + break; + case 11: + return "Guam"; + break; + case 12: + return "Kiribati"; + break; + case 13: + return "Tonga"; + break; + case 14: + return "Marshall Islands"; + break; + case 15: + return "Northern Mariana Islands"; + break; + case 16: + return "American Samoa"; + break; + case 17: + return "Palau"; + break; + case 18: + return "Cook Islands"; + break; + case 19: + return "Tuvalu"; + break; + case 20: + return "Wallis and Futuna Islands"; + break; + case 21: + return "Nauru"; + break; + case 22: + return "Niue"; + break; + case 23: + return "Tokelau"; + break; + default: + return "Invalid option"; + break; + } +} + +/* + * 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 + */ + diff --git a/WeatherReport.exe b/WeatherReport.exe new file mode 100755 index 0000000..b3985dd Binary files /dev/null and b/WeatherReport.exe differ diff --git a/WeatherReport.h b/WeatherReport.h new file mode 100755 index 0000000..57d5b07 --- /dev/null +++ b/WeatherReport.h @@ -0,0 +1,26 @@ +#ifndef _weatherReport_h +#define _weatherReport_h + +#include + +//void weatherReport(std::string weatherLocationInput); + +void findWeatherReport(std::string continent, std::string country); + +std::string continents(int responseNumberInput); + +std::string asia(int responseNumberInput); +std::string africa(int responseNumberInput); +std::string northAmerica(int responseNumberInput); +std::string southAmerica(int responseNumberInput); +std::string europe(int responseNumberInput); +std::string australia(int responseNumberInput); + +#endif + +/* + * 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 + */ diff --git a/error.cpp b/error.cpp new file mode 100755 index 0000000..c9ceb16 --- /dev/null +++ b/error.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include +#include "error.h" +using namespace std; + +void error(string msg) { + cerr << msg << endl; +} + +void stop(string msg) { + cerr << msg << endl; + usleep(3000000); + exit(EXIT_FAILURE); +} diff --git a/error.h b/error.h new file mode 100755 index 0000000..fea319b --- /dev/null +++ b/error.h @@ -0,0 +1,10 @@ +#ifndef _error_h +#define _error_h + +#include + +void error(std::string msg); + +void stop(std::string msg); + +#endif diff --git a/main.cpp b/main.cpp new file mode 100755 index 0000000..d8ab42c --- /dev/null +++ b/main.cpp @@ -0,0 +1,150 @@ +#include +#include > +#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 + */