Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!