FINAL
Alternative Assessment
Session (COVER PAGE)
Programme : July 2020
Course
Date of Examination : University of Wollongong
Time
Duration : CSCI334: Software Design
Special Instructions
November 27, 2020 (Friday)
: 8:00am – 11:00am Reading Time: Nil
: 3 Hours
:
Answer ALL the Questions.
Examiner(s) : Leong Siok Jen and Mohd Faizal Bin Alias
Moderator : Dr Hoa Dam
This paper consists of 5 printed pages, including the cover page.
CSCI334 (FAA) / Page 1 of 4
UNIVERSITY OF WOLLONGONG PROGRAMME (UOW)
CSCI334: SOFTWARE DESIGN
FINAL ALTERNATIVE ASSESSMENT: JULY 2020 SESSION
(100 marks -> 55 marks) ANSWER ALL THE QUESTION
AirQ from SmartSense Company is an advanced air quality sensor that measures a range of
pollutants, including data related to gaseous emissions (NO, NO2, CO, SO2,O3) and particulate
matter (PM1, PM2.5 and PM10). Accurate and reliable data is collected from various sensors and
feed into a web browser to ensure that up to date information is available to the users of the
connected SmartSense dashboard. Besides the dashboard all the data is also compiled and allow
the representation of the same data in different ways. For example, the same data can be used to
produce reports in variety of chart types such as bar chart, pie chart and table view to help manager
make better decision on how to manage the air quality.
The first step that was taken with the AirQ sensor was to optimise the solution to meet NB-IoT
bandwidth requirements The aim of the deployment is to test the performance of NB-IoT for
collection of all the data currently collected by the AirQ sensor and to measure the power
requirements for developing a battery powered sensor in the future. It is also important that this
system is error free so rigorous testing need to be conducted. It is hope that in the future this system
can be used to measure chemical component in larger area as now the area of coverage is only up
to maximum 10 feet.
1. Based on the air quality sensor system above, discuss the system design challenges in terms
of product design and engineering design. (10 marks)
2. Produce TWO (2) functional requirement and TWO (2) nonfunctional requirement
statement for the air quality system above. Identify also what type of non-functional
requirement it can be categorized under. (15 marks)
3. Identify and justify FOUR (4) suitable criteria for evaluation in the scoring matrix based
on the air quality sensor system above. (12 marks).
4. The copy machine is initially off. When power is turned on, the machine reverts to a default
state – one copy. While the machine is warming, it flashes the ready light. When the
machine completes its internal testing, the ready light stops flashing and remains on. Then
the machine is ready for copying. The operator may change any of the parameters when
the machine is ready. The operator may increment or decrement the number of copies.
Once the parameters have been set, the operator pushes the start button to start making
copies. Ordinarily, copying proceeds until all copies are made. Occasionally the machine
may jam or run out of paper. When the machine jams, the operator may open the lid and
clear the paper path. When the operator closes the lid, the machine continues making
copies. Adding paper allows the machine to continue copying after running out of paper.
Draw a state chart diagram for the situation above. (12 marks)
CSCI334 (FAA) / Page 2 of 4
5. There are many architecture design style that can be used to draw a system. One of it is
Model View Controller Pattern (MVC). Use MVC to draw the air quality sensor system
above and justify using ONE (1) reason why do you think the architecture design style is
suitable to represent the situation above. (13 marks)
6. Case Study: Analogous to Subway Surfers Android Game.
6 In the Subway Surfers Android game, there is one and only one player. The Player has
methods of jump, slideDown, jumpLeft and jumpRight. Since there is only one Player
object, suggest suitable design pattern and explain why this pattern is suitable. Draw Class
diagram and sequence diagram for the design pattern that you have suggested. From the
class diagram drawn give ONE (1) example to explain how the design support modularity
principle. (14 Marks)
7. Based on the Subway Surfers Android game in the above question, Observer pattern is
implemented with totalScore, currentScore and highScore objects. These objects will be
updated by the Player state while the user is playing the game. Example, when the Player
captures a coin item, it need to notify all the objects mentioned earlier.
Draw appropriate UML class diagram and Sequence diagram for this. (12 Marks)
CSCI334 (FAA) / Page 3 of 4
8. Given the following code segments with code smells.
Re-write the code by conducting the following code refactoring requirements.
(i) Extract method by introducing only one Query Execution method name
executeMyQuery. After that provide suitable calling methods on the StaffReport
code segment. (5 marks)
Note: You may shorten the Query statement in your answer.
void StaffReport( )
{
{
static string Conn = "datasource=localhost; …."
MySqlConnection MyConn = new MySqlConnection(Conn);
string dateR = staffReportDate.Value.ToString("yyyy-MM");
string Query1 = "select staff.staffID, staff.Name, ... from staff ... staff_job.jobID=" +
"job.jobID join ... clientID=" + "client.clientID where job.jobStatus='complete' and
job.dateOfJob like '" + dateR + "-%';";
//allWorks Query Execution
MySqlCommand MyComd1 = new MySqlCommand(Query1, MyConn);
MySqlDataAdapter MyAdapter1 = new MySqlDataAdapter();
MyAdapter1.SelectCommand = MyComd1;
DataTable dTable1 = new DataTable();
MyAdapter1.Fill(dTable1);
workRecord.DataSource = dTable1;
string Query2 = "select distinct(staff_job.staffID), ... from staff join ...
staff_job.jobID=" + "job.jobID where job.jobStatus='complete' and job.dateOfJob like
'" + dateR + "-%' group by staff_job.staffID;";
CSCI334 (FAA) / Page 4 of 4
//WorkDone Query Execution
MySqlCommand MyComd2 = new MySqlCommand(Query2, MyConn);
MySqlDataAdapter MyAdapter2 = new MySqlDataAdapter();
MyAdapter2.SelectCommand = MyComd2;
DataTable dTable2 = new DataTable();
MyAdapter2.Fill(dTable2);
workCountRecord.DataSource = dTable2;
MyConn.Close();
}
(ii) Given the following segment of code with code smells. Re-write the code by
introducing Staff Class and two subclasses of SeniorStaff and JuniorStaff inherit
from Staff Class. The Staff Class is having abstract method calcCommission()
where the concrete method is implemented by respective subclasses SeniorStaff
and JuniorStaff. (7 marks)
CalcCommission(staffLevel as String, staffName as String, ElectircalProd as Integer,
FurnitureProd as Integer)
{
if (staffLevel = "SeniorStaff")
{
txtSalesCommission.Text = "Staff Name:"+ StaffName + " " + "Sales Commission is:"
+ (ElectircalProd * 1.05
+ FurnitureProd * 1.07).ToString();
}
elseif (staffLevel = "JuniorStaff")
{
txtSalesCommission.Text = ""Staff Name:" + StaffName + " " + "Sales Commission is:"
+ (ElectircalProd * 1.03
+ FurnitureProd * 1.05)).ToString();
}
}
~ The End ~
CSCI334(faa)/Jul20/formatted