The plan is to search the whole record of all rainfall data for a particular station's...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The plan is to search the whole record of all rainfall data for a particular station's data, and then present this data on the client screen. This search should be done in a thread. Consider the class implementation stub below (where stn is the station's data that is required). (/*all data*/, Qstring stn) station{stn} StationThread::StationThread : record{ /*all data*/), {} void StationThread: :doSearch () { } 3.1 foreach (/*rain record in the data */) } //get the station, date, and mm as strings if (/*this station in the data*/ == station) emit foundStation (/*date as string */, /*mm as string */); Write the class definition for the StationThread class, remembering that it should be run as a thread. (8) 3.2 3.3 Consider the code below that is run when data for a particular rain station is found by the code running in the thread, where QTableWidget *tableWidget and int row have already been declared and appropriately initialised. void Client::handle Found (QString date, Qstring mm) { } QTableWidgetItem *dateItem{ new QTableWidgetItem (date) }; QTableWidgetItem *mmItem { new QTableWidgetItem (mm) }; tableWidget->setItem (row, 0, dateItem); tableWidget->setItem (row++, 1, mmItem); Assume the following code in Client. QThread *t {new QThread}; StationThread *st(new StationThread (/*passing parameters */)}; Write the code that would follow these declarations to get the thread running with the StationThread object, ensuring that the data is received from the running thread and passed on to the handle Found () function. (6) Would you agree that the QTableWidget used in 3.2 is the best approach that can be used for displaying a station's rainfall data on the client window? Give reasons for your answer. Note that marks are only allocated to your reasoning. (2) The plan is to search the whole record of all rainfall data for a particular station's data, and then present this data on the client screen. This search should be done in a thread. Consider the class implementation stub below (where stn is the station's data that is required). (/*all data*/, Qstring stn) station{stn} StationThread::StationThread : record{ /*all data*/), {} void StationThread: :doSearch () { } 3.1 foreach (/*rain record in the data */) } //get the station, date, and mm as strings if (/*this station in the data*/ == station) emit foundStation (/*date as string */, /*mm as string */); Write the class definition for the StationThread class, remembering that it should be run as a thread. (8) 3.2 3.3 Consider the code below that is run when data for a particular rain station is found by the code running in the thread, where QTableWidget *tableWidget and int row have already been declared and appropriately initialised. void Client::handle Found (QString date, Qstring mm) { } QTableWidgetItem *dateItem{ new QTableWidgetItem (date) }; QTableWidgetItem *mmItem { new QTableWidgetItem (mm) }; tableWidget->setItem (row, 0, dateItem); tableWidget->setItem (row++, 1, mmItem); Assume the following code in Client. QThread *t {new QThread}; StationThread *st(new StationThread (/*passing parameters */)}; Write the code that would follow these declarations to get the thread running with the StationThread object, ensuring that the data is received from the running thread and passed on to the handle Found () function. (6) Would you agree that the QTableWidget used in 3.2 is the best approach that can be used for displaying a station's rainfall data on the client window? Give reasons for your answer. Note that marks are only allocated to your reasoning. (2)
Expert Answer:
Answer rating: 100% (QA)
Certainly Heres an example of a class definition for the StationThread class that runs as a thread c... View the full answer
Related Book For
Introduction To Management Science and Business Analytics A Modeling And Case Studies Approach With
ISBN: 9781260716290
7th Edition
Authors: Frederick S. Hillier, Mark S. Hillier
Posted Date:
Students also viewed these programming questions
-
The Corporate Average Fuel Economy (CAFE) regulations were put into law by Congress in 1975 to promote the sale of fuel-efficient automobiles and light trucks. The law requires automakers to boost...
-
Mary, who is single, had the following items for 2016: Required: Determine Marys adjusted gross income for 2016. Salary $80,000 Loss on sale of 8 1244 small business stock acquired 3 years ago...
-
Use the result of Exercise 61 to find a general form of the equation of the line having x-intercept (5, 0) and y-intercept (0, 6).
-
The idea of the average value of a function, discussed earlier for functions of the form y = f (x), can be extended to functions of more than one independent variable. For a function z = f (x, y), he...
-
(a) Show that Eqs. 8.47 reduce to Eqs. 8.46 when you consider a system of just one object. (b) Follow the procedure used to get from Eq. 8.21 to Eq. 8.24 for a system of many interacting objects....
-
SHL Americas provides a unique, global perspective of how talent is measured in its Global Assessment Trends Report. The re-port presents the results of an online survey conducted in late 2012 with...
-
A hiker and his dog have discovered a skeleton hidden deep in the woods. The medical examiner has identified this skeleton as female. What characteristics of the skeleton would help the examiner make...
-
Parson Company acquired an 80 percent interest in Syber Company on January 1, 2020. Any portion of Sybers business fair value in excess of its corresponding book value was assigned to trademarks....
-
Explain the term "marginal rate of technical substitution." (Assume a two-input production function.) O A. The MRTS gives the amount by which the quantity of one input must be increased when one...
-
Keats started operation in Mar1 making one product, their standard cost were: $ Direct Labor 5 Direct Material 8 Variable Production OVH 2 Fixed Production OVH 5 Standard Production cost = 20. The...
-
How do cellular quality control mechanisms, including autophagy and the ubiquitin-proteasome system, contribute to maintaining proteostasis and mitochondrial homeostasis, and what are the...
-
Critically discuss that why Pakistan's economic growth continues to be "Balance- of - Payments" constraint which is one you of think that the cose causes to keep the foreign exchange reserves under...
-
Introduction to Written Analyses in this Course Read and follow the instructions contained in the Orientation to Writing Assignments For each of these analyses topics in the course you will analyze...
-
How does the concept of "set points" in homeostatic regulation provide a framework for understanding individual variability and resilience in maintaining physiological stability, and what factors...
-
this is not nursing. this is community services. also this has a reading . https://lms.stotts.edu.au/pluginfile.php/136109/mod_assign/introattachment/0/Question%201-Reading.pdf?forcedownload=1 A)...
-
Design a circuit which negative the content of any register and store it in the same register.
-
Reconsider Problem 2.16. Using the data on the Clean Data worksheet tab, partition the historical records into a training partition (60 percent of the records) and a validation partition (the...
-
What is the formula for calculating the seasonally adjusted call volume from the actual call volume and the seasonal factor?
-
What is the advantage of the series of short-term loans for Everglade?
-
What are the main phases of a design review?
-
Classify these Bluetooth layers using the OSI model: a. baseband; b. L2CAP; c. RFCOMM.
-
Use the power state machine of Fig. 8.12 to determine the energy used in these use cases: a. idle 1 s; receive 10 ms; idle 0.1 s; transmit 5 s; b. sleep 1 min; receive 50 ms; idle 0.1 s; receive 100...
Study smarter with the SolutionInn App