Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago