Lesson Plan Computer Science Programming Logic Class: Period: Mode: Classroom/Lab Teacher: ____________________________________________________________________________________ Learning Support Assistant: ____________________________________________________________ Time: 120 min. S.M.A.R.T. Learning Objectives By the end of this session, students will be able to: 1. Understand what is programming. 2. Appreciate the significance of programming approach. 3. Understand the term “logic” and its importance. 4. Develop logic for the solution of a given problem. 5. Differentiate between a pseudocode and a program in a programming language. 6. Perform data validation in the program. Resources Use the eContent to show the animated demos of the lesson. Session Conduction Engage: Inform: There are several programming languages such as Scratch, RobotBasic, Python, Java, JavaScript, C, C++, etc. All the languages have different commands and syntax. To learn a particular programming language, you need to learn the syntax of that language but there is one thing common which needs to be mastered first and this “logic”. Concept introduction: Just like to solve any problem, we use various tools and means, to solve a problem with programming, we need programming approach. To solve a problem, we need to think of the steps involved, the sequence of steps and how to execute them. This entire approach is called programming approach or technique. This is something one has to learn on his/her own because every problem has different ways to solutions. Concept Demo/Explanation: Use the salary calculation example given in the book to explain how to take an estimate of: • The number of statements needed in the program. • Number and types of variables required.
• How to ensure entry of exact 100 salary amounts? Then, explain the approach of the problem given in the example step-by-step. Explain the significance od data variable and loop variable. Demonstrate how a pseudocode of the solution looks like. Then, show the students how to implement the pseudocode in Python language. Explain the difference between the pseudocode and actual program. Discuss: Why it is necessary to have valid values in the program? Elaborate on the garbage in-garbage out concept. Using the example given in the book, demonstrate the technique of applying data validation for the salary amount and how the pseudocode changes accordingly. Concept Practice: Solve the problems given at the chapter end. Home Assignments 1. Revise the topic covered. 2. Practice the interactive exercises in Smart App. Evaluation After completing the lesson solve the exercises given at the end of the chapter.
Lesson Plan Computer Science JavaScript Web Programming Topic-Functions and Mouse Events Class: Period: Mode: Classroom/Lab Teacher: ____________________________________________________________________________________ Learning Support Assistant: ____________________________________________________________ S.M.A.R.T. Learning Objectives By the end of this session, students will be able to: 1. Create user-defined functions in JavaScript code. 2. Call functions to execute the code. 3. Understand what are events. 4. Handle at least 4 types of mouse events in JavaScript code. Resources 1. video https://www.youtube.com/watch?v=hlnpIcVldNY (4.33 to 9.41). 2.video https://www.youtube.com/watch?v=tRU_dIavoi4 (0.00 to 4.25) 3. Use the eContent to show the animated demos of the lesson. Session Conduction Engage: Ask students have they ever used an ATM machine or seen someone using it. Discuss with them how a user uses ATMs for operations like withdrawal of money or checking balance or getting a statement of the account. The process is the same for all. However, output, e.g. the balance, and input, e.g. how much cash they want to withdraw will be different for everyone. These repeated operations which are used by users in an ATM machine are called functions in any programming language. Concept introduction: Introduce functions. Give example, to make our word documents presentable we give headings and write the heading-related content in the paragraph. In the same way, a function is a named block with a group of instructions. Functions are used for reusability. Tell students the alert and prompt are two functions defined in the JavaScript library. Explain what is a user-defined function.
Explain what is an event and when events are triggered. For e.g. when the user clicks a button on the webpage or presses the keyboard. An event handler is a JavaScript function that runs when an event fires. Event Handling is the mechanism that controls the event and decides what should happen if an event occurs. Concept Demo/Explanation: Explain why functions are important. A function can be called by writing the name of the function. Give examples of built-in functions and user- defined functions of JavaScript. Give examples of events, attending or rejecting phone calls, control buttons in media player pressing which will play, forward, replay songs, bulb turning on and off with a switch. In JavaScript, we can write code that will let us make a change when an event is fired. Example button colour changes when the mouse hovers over it, or size increases, text colour changes, etc. Concept Practice: Write a JavaScript code to declare functions and call them. Write a code to explain an event, event handler, and event handling. Complete activity 1, activity 2, and activity 3 under mouse event handling. Optional Activity: Watch the videos from the resources section. Practical Application: Ask students to complete the lab activities. Home Assignments 1. Revise the topic covered. 2. Practice the interactive exercises in Edusoft Smart App. 3. Solve any additional exercises on playground.edusoft.co.in Guided Assignment Ask students to visit https://www.geeksforgeeks.org/javascript-events/ and have a discussion with teachers about their findings. Evaluation After completing the lesson solve the exercises given at the end of the chapter.
Lesson Plan Computer Science JavaScript Web Programming Topic-Handling Keyboard Events Class: Period: Mode: Classroom/Lab Teacher: ____________________________________________________________________________________ Learning Support Assistant: ____________________________________________________________ S.M.A.R.T. Learning Objectives By the end of this session, students will be able to: 1. Understand what are keyboard events. 2. Handle at least 3 keyboard events. 3. Handle onClick event of click events. 4. Use the onChange event when the value of an element has been changed. Resources 1. video https://www.youtube.com/watch?v=tRU_dIavoi4 (4.27 onwards). 2. Use the eContent to show the animated demos of the lesson. Session Conduction Engage: Recap the previous topic. Concept introduction: Discuss most browser-based games with some form of keyboard input. Whenever a user presses any key on the Keyboard, different events are fired. Like if the left or right arrow button is pressed the game object will move. We can write instructions for this in JavaScript using keyboard events. There are three keyboard events, namely keydown, keypress, and keyup. These events are applicable to virtual keyboards too. Explain other events like when a user clicks a button, an event is fired. These are called click events. onChange events are fired when selecting something from a drop-down list or any value of an element changes.
Concept Demo/Explanation: Explain the difference between different key events. The keydown event is triggered first when the user presses a key. The keyup event is triggered last when the user releases a key. In between, the keypress event is triggered. The keypress ignores keys such as delete, arrows, page up, page down, home, end, ctrl, alt, shift, esc, etc. The keydown event is fired for all keys. The keydown and keyup events provide a code indicating which key is pressed, while the keypress indicates which character was entered. For example, a lowercase \"a\" will be reported as 65 by keydown and keyup, but as 97 by keypress. Concept Practice: Write a JavaScript code to show the difference between keypress and keydown. Using the code from the book demonstrate how to display the text typed by the user, and create a dynamic marquee. Using the innerHtml property we can set or change the text of any HTML elements. Write code and demonstrate how to use onClick events for displaying messages on a webpage. Change the background of the web page using onChange event. Optional Activity: Watch the video https://www.youtube.com/watch?v=tRU_dIavoi4 and discuss it with the teacher. Practical Application: Ask students to complete the lab activities. Home Assignments 1. Revise the topic covered. 2. Practice the interactive exercises in Edusoft Smart App. 3. Solve any additional exercises on playground.edusoft.co.in Guided Assignment Ask students to visit https://developer.mozilla.org/en- US/docs/Learn/Getting_started_with_the_web/JavaScript_basics and discuss with the teacher about their findings. Evaluation After completing the lesson solve the exercises given at the end of the chapter.
Search
Read the Text Version
- 1 - 6
Pages: