yes
This commit is contained in:
parent
1b914398c8
commit
a2216dbcdc
BIN
GetWeather
Executable file
BIN
GetWeather
Executable file
Binary file not shown.
152
GetWeather.pro
Executable file
152
GetWeather.pro
Executable file
|
@ -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. )
|
||||
}
|
263
GetWeather.pro.user
Executable file
263
GetWeather.pro.user
Executable file
|
@ -0,0 +1,263 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 10.0.2, 2023-07-14T02:00:01. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{2a76ef88-3f3d-407d-bd6a-8a69fb9220c1}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="qlonglong">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">4</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.5.1 GCC 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.5.1 GCC 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.651.gcc_64_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/storage/Users/keyemail/Documents/QT PROJECTS/build-GetWeather-Desktop_Qt_6_5_1_GCC_64bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
<value type="int" key="SeparateDebugInfo">0</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/storage/Users/keyemail/Documents/QT PROJECTS/GetWeather/GetWeather.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/storage/Users/keyemail/Documents/QT PROJECTS/GetWeather/GetWeather.pro</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/storage/Users/keyemail/Documents/QT PROJECTS/GetWeather</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="qlonglong">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
735
WeatherReport.cpp
Executable file
735
WeatherReport.cpp
Executable file
|
@ -0,0 +1,735 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#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
|
||||
*/
|
||||
|
BIN
WeatherReport.exe
Executable file
BIN
WeatherReport.exe
Executable file
Binary file not shown.
26
WeatherReport.h
Executable file
26
WeatherReport.h
Executable file
|
@ -0,0 +1,26 @@
|
|||
#ifndef _weatherReport_h
|
||||
#define _weatherReport_h
|
||||
|
||||
#include <string>
|
||||
|
||||
//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
|
||||
*/
|
16
error.cpp
Executable file
16
error.cpp
Executable file
|
@ -0,0 +1,16 @@
|
|||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#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);
|
||||
}
|
10
error.h
Executable file
10
error.h
Executable file
|
@ -0,0 +1,10 @@
|
|||
#ifndef _error_h
|
||||
#define _error_h
|
||||
|
||||
#include <string>
|
||||
|
||||
void error(std::string msg);
|
||||
|
||||
void stop(std::string msg);
|
||||
|
||||
#endif
|
150
main.cpp
Executable file
150
main.cpp
Executable file
|
@ -0,0 +1,150 @@
|
|||
#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
|
||||
*/
|
Loading…
Reference in a new issue