Basic program gives only one quess and then the program ends.

Slides:



Advertisements
Similar presentations
Siouxland Republican Women. Go to and check out the bills. Make a list of which bills are important to you.
Advertisements

After logging in, select Grading under the Faculty Information heading on the Faculty & Staff Menu.
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
Python November 18, Unit 7. So Far We can get user input We can create variables We can convert values from one type to another using functions We can.
JavaScript Switch Statement. Switch JavaScript Switch Statement If you have a lot of conditions, you can use a switch statement instead of an if…elseif…
1 CS101 Introduction to Computing Lecture 29 Functions & Variable Scope (Web Development Lecture 10)
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Loops Doing the same thing over and over and over and over and over and over…
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
The Grammar of JavaScript.  Each line of a script is a statement  An instruction that JavaScript can evaluate (make sense of)  Ends with a semicolon;
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Variety of JavaScript Examples Please use speaker notes for additional information!
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
Addition and Substraction
Designing While Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
JavaScript Challenges Answers for challenges
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
Adapted from  2004 Prentice Hall, Inc. All rights reserved. 5 th and 4 th ed: Chapters 6,7,8 SY306 Web and Databases for Cyber Operations SlideSet #6:
Answer questions about assignment.. Starting JavaScript, at my site these examples are under programs and JavaScript. You can see the address for this.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Input, Output and Variables GCSE Computer Science – Python.
© Mark E. Damon - All Rights Reserved Add © All rights Reserved Your Name Topic of Game.
GCSE COMPUTER SCIENCE Practical Programming using Python
CSS Colors, JavaScript Variables, Conditionals and Basic Methods
TODAY YOU WILL NEED YOUR QUOTE OF ARMS YOUR READING LOG
Whatcha doin'? Aims: To start using Python. To understand loops.
A Simple Quiz for Alice 3.2:
Using iLocker.
Week of 12/12/16 Test Review.
Chapter 3: Variables, Functions, Math, and Strings
ECS10 10/10
At the Grading screen, use either the Term drop-down selection or enter a Start and End Date to access your classes for grading. You cannot enter both.
Chapter 5: Control Structure
September 25, 2017 Multiple Digit Multiplication Day Warm Up
Accumulators in Programming
2-D Lists Taken from notes by Dr. Neil Moore
Python - Iteration Iteration
The three programs to look at are at:
Please use speaker notes for additional information!
Using the Multiple Choice Template
More Loops.
A Simple Quiz for Alice 3.2:
We are starting to program with JavaScript
T. Jumana Abu Shmais – AOU - Riyadh
Topic 1: Problem Solving
Introduction to TouchDevelop
Pasa números Divide students in to teams and have each team sit in a row. Give each student a dry erase marker and something to erase with. Each team gets.
Programming We have seen various examples of programming languages
random number between 1 and 5.
We are starting JavaScript. Here are a set of examples
Input Repeat until Concatenation
CSC115 Introduction to Computer Programming
How to Submit Google Docs to the Homework Drop Box
The + can mean concatenate or add
Programs. at the code at the site..
Developing a Program.
JavaScript: Introduction to Scripting
Question 10.
True / False Variables.
Module 5 ● Vocabulary 1 a sensing block which will ask whatever question is typed into the block and display an input text box at the bottom.
The Web Wizard’s Guide To JavaScript
2-D Lists Taken from notes by Dr. Neil Moore
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Did a few weeks ago. tag would work..
Google POP QUIZ Work with your table. Record your answers and put a checkmark in the box for each correctly answered question.
Presentation transcript:

Basic program gives only one quess and then the program ends.

guessing until the user guesses the correct answer.

until I guess correctly.

the box.

Random number is determined outside the loop because we don't want it to change. Guess changes so we want it in the loop. !=

saying TheRanNum != myGuess

Now I want to change the program so I allow the user to play multiple times. I will use a prompt where they can choose to play again.

is within the outer loop. controls playing again.

The bottom diamond is checking for playAgain != N

This program does a document This program does a document.write on the screen and puts up an alert box.

window.prompt(...) each variable an initial value. The user is then prompted to enter a number, the number is assigned to the defined variable. Then I do a calculation and store it in the variable ans. Finally I document.write the contents of the variable ans.

together as one. I entered 3 and 4 so concatenated they are 34. parseFloat and parseInt are two ways to convert to a number. You have to do this when using the + because the plus has two meanings. It can mean add or it can mean concatenate. It is context driven so if we convert to numbers, it will assume the + means add. Note when I used the + without converting, the program concatenated and put the concatenated numbers in ans.