This week in class we went over the unit of computational think. Or in other words how to solve problem in a similar manner as a computer think. This way of thinking is how to putting a problem into a way that we can go on and put into code later on. In computational thinking there are 4 main pillars.
- Decomposition – breaking a big problem into smaller parts
- Abstraction – removing information irrelevant to solving the problem
- Pattern Recognition – looking for patterns to help simply
- Algorithms – a set of step by step instruction written in everyday langue
Down bellow are the assignment problems that where put into algorithms and flow charts using the four pillars of Computational thinking.
Problem 2: Deciding if Courtenay is Safe to Land
- find out what the current wind conditions are
- determine if the current wind conditions are over 12 knots
- if yes land in Smits field
- if no land in Courtenay
Problem 3: Find alternate landing time or location
- put in the current time
- put in the time left
- subtract the current time from the time left and call it landing time
- put in available time
- compare the a landing time to the to the available time
- determine if the available time is greater than or equal the landing time
- is the available is greater than the landing time output land in Courtney
- finish running program
- if it is determined that the available time is lesser than the landing time determine if the list is empty
- if the list is not empty go back to compare landing time to available time and continue the program
- if the list is empty land in Smits Field
- finish running program
Problem 4: Book a Dinner Reservation
- put in the results of problem 3
- put in the landing time
- determine if the plane is landing in Courtenay
- if the the answer to determining the plane is landing in Courtenay is yes add 20 mins to the landing time
- input the available reservation time
- compare the taxi time to the available reservation time
- determine if the available reservation time is grater or equal to the taxi time
- if the out come is yes output reservations
- finish program
- if the out come is no determine if the list is empty
- if the list is empty out put no reservations available
- finish program
- if the list is not empty go back to comparing taxi time to reservation time and continue program
- if the determined answer for landing in Courtenay is no as 45min to landing time and call it loaner care time
- call the Air Marshall to request a loaner car
- put in available reservation times
- compare the available reservation times to the loaner care times
- if greater or equal to out put book reservation
- finish program
- if lesser than
- determine if the list is empty
- if the list is empty then output no available reservation
- finish program
- is the list is not empty go back to compare loaner car time to available reservation time
Leave a Reply