You have been provided with a QTCreator project called Project12 _ Student. Open the project in QTCreator and make the necessary changes to the main.cpp and infostation.cpp / h files. The class InfoStation contains 3 public methods namely : float getTemp ( ) ; - Returns a random temperature between 1 and 100 ( In float format ) float getHour ( ) ; - Returns a random hour between 1 and 24 ( In float format ) string getDay ( ) ; - Returns a random day between 1 and 10 ( In string format ) Using the class InfoStation fill the provided multidimensional array named WData[10][4] with values in the main function. The first 3 columns in WData should contain a temperature a hour and a day generated using the InfoStation class.  Column 1 - temperature retrieved using getTemp ( ) from the InfoStation class.  Column 2 - hour retrieved using getHour ( ) from the InfoStation class.  Column 3 - day retrieved using getDay ( ) from the InfoStation class. Column 4 - no value at this stage will be calculated by calcPower ( ... ) This should be repeated for each of the 10 rows. After populating the multidimensional array with values create and call the function calcPower ( ... ) . The calcPower ( ... ) function will receive the array WData as parameter and calculate the solar power that would have been produced on the day. The solar power value is calculated by multiplying the days temprature with the the ( hour / 2 ) The calculated value should be stored in the 4th column of WData

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You have been provided with a QTCreator project called Project12 _ Student. Open the project in QTCreator and make the necessary changes to the main.cpp and infostation.cpp / h files.

The class InfoStation contains 3 public methods namely : float getTemp ( ) ; - Returns a random temperature between 1 and 100 ( In float format )

float getHour ( ) ; - Returns a random hour between 1 and 24 ( In float format )

string getDay ( ) ; - Returns a random day between 1 and 10 ( In string format )

Using the class InfoStation fill the provided multidimensional array named WData[10][4] with values in the main function. The first 3 columns in WData should contain a temperature a hour and a day generated using the InfoStation class.

 Column 1 - temperature retrieved using getTemp ( ) from the InfoStation class.

 Column 2 - hour retrieved using getHour ( ) from the InfoStation class.

 Column 3 - day retrieved using getDay ( ) from the InfoStation class.

Column 4 - no value at this stage will be calculated by calcPower ( ... )

This should be repeated for each of the 10 rows.

After populating the multidimensional array with values create and call the function calcPower ( ... ) .

The calcPower ( ... ) function will receive the array WData as parameter and calculate the solar power that would have been produced on the day. The solar power value is calculated by multiplying the days temprature with the the ( hour / 2 )

The calculated value should be stored in the 4th column of WData

C:\QE\Tools\QtCreator\bin\qtcreator_process_stub.exe
Example output:
This is how the array WData may look after populating with values from
Your values wiii be different as they are randomly generated
Infostation
TEMP
42
1
79
65
82
92
28
5
93
17
HOUR
DAY
POWER
12
9
18
3
7
9
18
4
9
20
10
13
2
15
2
23
8
15
7
This is how the array WData may look after calculating the power
TEMP
42
1
79
65
82
92
28
5
93
17
HOUR
DAY
POWER
12
9
252
18
9
7
9
276.5
18
4
585
4
9
164
20
10
920
13
2
182
37.5
15
23
1069.5
7
127.5
O m n m5
Transcribed Image Text:C:\QE\Tools\QtCreator\bin\qtcreator_process_stub.exe Example output: This is how the array WData may look after populating with values from Your values wiii be different as they are randomly generated Infostation TEMP 42 1 79 65 82 92 28 5 93 17 HOUR DAY POWER 12 9 18 3 7 9 18 4 9 20 10 13 2 15 2 23 8 15 7 This is how the array WData may look after calculating the power TEMP 42 1 79 65 82 92 28 5 93 17 HOUR DAY POWER 12 9 252 18 9 7 9 276.5 18 4 585 4 9 164 20 10 920 13 2 182 37.5 15 23 1069.5 7 127.5 O m n m5
Expert Solution
Introduction

Program description :

The program contains the three files

  • 1.Header file : infostation.h
  • 2.Implementation file : InfoStation.cpp
  • 3. Tester file : Tester.cpp

The infostation header file contains the methods getTemp ,getHour and getDay declarations.

The InfoStation implementation file contains the method implementations 

In the main method of Tester.cpp file, declare a 2D array WData of 10x4 size. Fill the random values for temp, hour, and day values. Then, calculate the power using the method, calcPower .Display the results of WData before and after the method,calcPower calling.

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education