software engineering principles dr. josé m. reyes Álamo
Post on 13-Dec-2015
214 Views
Preview:
TRANSCRIPT
12
An App is a Set of Event-Handlers
• Mobile and web apps have graphical user interfaces (GUIs) with which the user interacts. Such apps are better described as a set of event-handlers, with multiple recipes that are only performed in response to some event.
13
An App Consists of Event-Handlers That Can Ask Questions and Branch
• Many responses to events are not sequential, but contain branches and loops.
• The app is allowed to ask questions and determine its course based on the answers. We say that such apps have conditional branches:
Conditions are questions such as “has the score reached 100?” or “did the text I just receive is from Joe?”
Depending on the condition evaluation (true or false) either B1 or B2 are going to be executed, but not both.
14
If and ifelse statement
Test statement
If test statement is TRUE, then do the following…
If test statement is TRUE, then do the following..
If test statement is FALSE, then do the following…
If test statement is FALSE, skip the if statement
15
Conditions are Boolean
Conditions are Boolean, meaning they return true or false. They test the value of properties and variables using the following logical operators:
These operators can be found in the Math and Logic drawers.
16
Algorithm – Pseudo CodeAlgorithm – Pseudo Code
// Use if statement to check the default size.defaultSize = 5;smallSize = 3;bigSize = 8;If defaultSize<8 && defaultSize>3
Display in LabelResult = The dot size is set to default;end
18
OpenLab and Blackboard
• Check OpenLab for any new lab.
• Check Blackboard for any new quiz.
• Project:
– Brainstorm an idea
– Get professor's approval
– Post your idea in your portfolio
– Must work in teams of 2 or 3
– It must be an app and the topic is open: a game, a tool, an enhanced version of a previous app
top related