Question
Project 3 Have the user provide a name for the weather station upon entry. Add a control loop that allows the user to specify which
Project 3
Have the user provide a name for the weather station upon entry.
Add a control loop that allows the user to specify which of four actions to take:
- Input a complete weather reading.
- temperature,
- wind speed, and
- wind direction
- Print the current weather
- If the user hasn't entered any data then print a message to that effect (no defaults)
- Exit the program
Use a text-driven menu to present the choices for actions to the user
Warning: this project is going to be graded with heavy testing
C++ code:
// EdwardMagruderweatherstation.cpp : Defines the entry point for the console application.
//Edward Magruder
#include "stdafx.h"
#include
#include
using namespace std;
int main()
{
//declaring variables to hold the weather station name, temperature, wind speed, and direction
string weather_station, wind_direction;
double temperature;
int wind_speed;
//assigning some values to the variables
cout << "Enter Name of the weather station:";
getline(cin, weather_station);
cout << "Enter Temperature:";
cin >> temperature;
cout << "Enter wind speed:";
cin >> wind_speed;
cout << "Enter wind direction:";
cin >> wind_direction;
//printing the variables
cout << "The " << weather_station << " Weather Station" << " ";
cout << temperature << " degree F" << " ";
cout << wind_speed << " " << wind_direction << " ";
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started