End of unit assessment Challenge 1 & 2. Course summary So far in this course you have learnt about and used: Syntax Output to screen (PRINT) Variables.

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Advertisements

CS0004: Introduction to Programming Repetition – Do Loops.
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
JAVA 1.5 New Features Dr V. The syntax of the enhanced for loop (for each) for (type variableName : arrayName) { statements } arrayName could be any.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
1 Lab Session-7 CSIT-121 Fall Introducing Structured Choice 4 The do~While Loop 4 Lab Exercises.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Python Programming Fundamentals
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Looping While-continue.
General Programming Introduction to Computing Science and Programming I.
Programming Fundamentals. Today’s lecture Decisions If else …… Switch Conditional Operators Logical Operators.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Python Repetition. We use repetition to prevent typing the same code out many times and to make our code more efficient. FOR is used when you know how.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Python Programming Using Variables and input. Objectives We’re learning to use basic knowledge of variables combined with user input. Outcomes Continue.
Programming, an introduction to Pascal
Designing While Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Ten Structures and Sequential Access Files.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
The Hashemite University Computer Engineering Department
Controlling Program Flow with Looping Structures
Lecture 7: Menus and getting input. switch Multiple-selection Statement switch Useful when a variable or expression is tested for all the values it can.
COMP Loop Statements Yi Hong May 21, 2015.
Chapter 6 Controlling Program Flow with Looping Structures.
World of Wokcraft The very best in Single pan cooking themed fantasy gaming!
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Introduction to Computing Science and Programming I
CSC111 Quick Revision.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
1-1 Logic and Syntax A computer program is a solution to a problem.
Topic: Python’s building blocks -> Statements
Completing the Problem-Solving Process
Chapter 2 Assignment and Interactive Input
Variables, Expressions, and IO
Scripts & Functions Scripts and functions are contained in .m-files
Repetition.
Starter Write a program that asks the user if it is raining today.
Chapter 6 – Repetition 6.1 Do Loops 6.2 For...Next Loops
Loops CS140: Introduction to Computing 1 Savitch Chapter 4 Flow of Control: Loops 9/18/13 9/23/13.
While loops The while loop executes the statement over and over as long as the boolean expression is true. The expression is evaluated first, so the statement.
Python Lesson 6 Mr. Kalmes.
Python I/O.
Use proper case (ie Caps for the beginnings of words)
Introduction to pseudocode
Validations and Error Handling
Programming Right from the Start with Visual Basic .NET 1/e
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Coding Concepts (Basics)
Python programming exercise
Let’s all Repeat Together
A LESSON IN LOOPING What is a loop?
Functions continued.
Python Basics with Jupyter Notebook
CSCI N207 Data Analysis Using Spreadsheet
7 – Variables, Input and Output
Arrays.
JavaScript: Introduction to Scripting
Just Basic Lessons 9 Mr. Kalmes.
LOOPS The loop is the control structure we use to specify that a statement or group of statements is to be repeatedly executed. Java provides three kinds.
Types of loops definite loop: A loop that executes a known number of times. Examples: Repeat these statements 10 times. Repeat these statements k times.
CS 1111 Introduction to Programming Spring 2019
Presentation transcript:

End of unit assessment Challenge 1 & 2

Course summary So far in this course you have learnt about and used: Syntax Output to screen (PRINT) Variables User input (INPUT) Strings & lists Conditional statement (IF) Loops (FOR/WHILE) Functions Level 2 - (Beginner) Does not combine lines of code (single line only) Can use variables, user input & print Some syntax errors exist Level 3 - (Beginner) Combines multiple lines of working code (some support) Can use variables, user input, print Some syntax errors exist Can describe what program does Level 4 - (Intermediate) Combines multiple lines of working code (no support) Can use variables/lists, user input, print, loops No syntax errors Can describe what program does Level 5 – (Advanced) Combines multiple lines of working code (no support) Can use variables/lists, user input, print, loops, if No syntax errors Can describe what program does and give Line by line code comments Level 6 – (Advanced+) Combines multiple lines of working code (no support) Can use variables/lists, user input, print, loops, if, functions No syntax errors Can describe what program does and give line-by-line code comments Code is added to validate user input

Challenge 1: Beginner: (Input, Variable, Print) Create a program that requests 5 numbers from the user and stores them each in separate variables. Once all the numbers have been collected in the program will then output/print all the numbers to the screen. Intermediate: (Loop, Input, List, Print) Create a program that uses a loop to request 5 numbers from the user and stores them all in a list. Once all the numbers have been collected in the program will then output/print all the numbers to the screen. Advanced: ( Loop, Input, List, Print, If) Create a program that uses a loop to request numbers from the user and stores them in a list. The loop will repeat until the number 10 is entered at which point it will exit the loop and output/print all the numbers that have been entered to the screen. Advanced+: ( Loop, Input, List, Print, If, Function) Create a function that is passed an integer number ‘N’ The function will loop to request numbers from the user and stores them in a list. The loop will repeat until ‘N’ is entered at which point it will exit the loop and output/print all the numbers that have been entered to the screen.

Challenge (Input, Variable, Print) Create a program that requests from the user and stores 5 numbers. The numbers should be stored in separate variables and then output to the screen. Pseudo-code Collect first number Store first number in variable Collect second number Store second number in variable Collect third number Store third number in variable Collect fourth number Store fourth number in variable Collect fifth number Store fifth number in variable Print first variable Print second variable Print third variable Print fourth variable Print fifth variable Challenge 1 – Beginner help: Reminder: To collect and store a user input (String) VariableName = input(“Prompt”) To collect and store a user input (Integer) VariableName = int(input(“Prompt”)) To output/print to the screen print(VariableName) print(‘Example text’) print(‘Example text %s’ % VariableName)

Challenge 2: Beginner: (Input, Variable, Print) Create a program that collects in 1 number and stores it as an integer. The program will then double the number in var1 and output/print it to the screen. Intermediate: (Input, Variable, Print, Loop) Create a program that collects a number from user and stores it in Var1. Print Var1 to the screen and then start a loop that runs 5 times. For each loop the program will load Var1, double it and save it in to Var1 and then output/print to the screen. Advanced: (Input, Variable, Print, Loop) Create a program that collects a number from user and stores it in Var1. The program will then collect a second number from the user and store it in Var2. A loop will then run for the number of times stored in Var2. For each loop the program will load Var1, double it and save it in Var1 and then output/print to the screen. Advanced+: (Input, Variable, Print, Loop, Function) Create a function that collects a number from user and stores it in Var1. The function will then collect a second number from the user and store it in Var2. A loop will then run for the number of times stored in Var2. For each loop the function will load Var1, double it and save it in Var1 and then output/print to the screen.

Challenge (Input, Variable, Print) Create a program that collects in 1 number and stores it as an integer. The program will then double the number in var1 and output/print it to the screen. Pseudo-code Collect number from user Store number from user in Var1 Double number Store number in Var1 Output/Print Var1 to screen Challenge 2 – Beginner help: Reminder: To collect and store a user input (String) VariableName = input(“Prompt”) To collect and store a user input (Integer) VariableName = int(input(“Prompt”)) To output/print to the screen print(VariableName) print(‘Example text’) print(‘Example text %s’ % VariableName)

Challenge 3: The open/free-for-all challenge! Create a program of your choice that uses: Output to screen (PRINT) Variables User input (INPUT) Strings & lists Conditional statement (IF) Loops (FOR/WHILE) Functions Don’t forget to comment each line of code!