Download presentation
Presentation is loading. Please wait.
Published byMargaretMargaret Harper Modified over 6 years ago
1
Lesson 5-2 AP Computer Science Principles
Multi-Screen Apps Lesson 5-2 AP Computer Science Principles
2
Objectives Students will be able to:
Write a simple event-driven program that has multiple screens. Recognize debugging as an important step in developing a program. Use console.log to debug simple issues related to event-driven programming.
3
Beyond the Chaser Game In the last lesson you ended up making a simple “chaser game” that wasn’t much of a game. In this lesson you’ll learn improve that app by: Adding more screens Adding a way for the game to end.
4
Coding Buddy Today you will still work independently but there are a few more problems to solve and mysteries to figure out than in the previous lesson. It is recommended that you have at least one coding buddy or thought partner to work through these stages with. Read instructions together, and ask questions of each other. In particular, it’s effective to do prediction tasks with a partner.
5
Stage 2 - Vocabulary Debugging - Finding and fixing problems in your code or algorithm User Interface (UI) - The “User Interface” or UI of an app refers to how a person (user) interacts with the computer or app. Event-driven program - a program designed to run blocks of code or functions in response to specified events (e.g. a mouse click) Event handling - an overarching term for the coding tasks involved in making your app respond to events by triggering functions.
6
Stage 2 – console.log Every programming language has some way of display simple plaintext output Printing to the console is a very common technique not only for debugging but also as an aid in program construction and development. In other words, you can use console.log to send messages to yourself to verify the program is doing what you think it’s doing which helps prevent errors down the line. console.log("Message 1"); Messages appear at the bottom of the App Lab screen
7
Stage 2 Complete Stage 2 In the last 20 minutes of class we are going to do a gallery walk of the games so try and finish before that.
8
Wrap-Up Today was one of the first times we saw error messages in our programs and started thinking about debugging our code. Is it “bad” to generate an error message? Will every error in our programs generate an error? Why might a programmer actually “like” to get an error message?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.