Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Foundations of Computer Science (COP 3014) All code in C++ USING the class below named Communication class provided below, make a program that saves all

Foundations of Computer Science (COP 3014) All code in C++

USING the class below named Communication class provided below, make a program that saves all data (weather, light, traffic, and streetlight) that the classes obtain, and puts it into a text file named "theCloud.txt" There has to be a TEST & "PRINT" functions, where we test what happens after each test. After every test is preformed, the screen should show a message that the data has been saved correctly.

*****Make a communication.h and communication.cpp file******

Here's the class that must be used in your program

class Communication

{

public:

void setCommunication()

{

double weather = getWeather();

double light = getLight();

double traffic = getTraffic();

double streetlight = getStreetLight();

std::ofstream theCloud("theCloud.txt");

theCloud << std::endl;

theCloud << weather << std::endl;

theCloud << light << std::endl;

theCloud << traffic << std::endl;

theCloud << streetlight << std::endl;

theCloud.close();

}

};

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

More Books

Students also viewed these Databases questions