Conditionals In Alice

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

can either be true or false

A Boolean variable

If statement

A type of conditional or selection statement that allows for another option if the Boolean expression is true.

T

A conditional expression is a question that will evaluate to either true or false T/F

Return types

A data type that indicates what type of information that method will give back when it is called.

stored

A function returns a value, and we will need a place for this variable to be _____

String

A popular data type that is used to store groups of characters. Usually this means words or sentences

If else statement

A type of conditional or selection statement that allows for a choice of options, one if the Boolean expression is true and a different one if it is false.

functions

Alice allows us to obtain input from the user through the use of _____

T

Alice provides us with built-in functions. T/F

function

In a _____, objects do not move or perform any actions, so the state of the world is left unchanged.

conditional statement

In order for the computer to make a decision we are going to have to use a _______

Variables

_____ allow you to store data by assigning the value to a name

integer

a data type that stores integer numbers.

Functions

a method that returns a value

Object

a thing such as a person or vehicle created based off of a 3D model or class

conditional statement

allows us to choose which statement will be executed next based on the evaluation of a boolean condition.

event

an action like a button push or a mouse click

Real Number

any number that can be written as a fraction

Function

asks a question of the object and returns a value when called

Integer

data type that stores numbers that is positive or negative whole number and zero

Double

data type that stores real numbers.

double

data type that stores real numbers. A real number is any number that can be written as a fraction

data type

indicates what values can be stored with a variable

compound conditional

joining more than one conditional, usually with a relationship operator like NOT, AND, and OR

vehicle

means that the two objects are linked so that if the vehicle moves this object will also move

variable

named memory location which is used to store values for the program

Procedures

no return value

class

outline of the object that defines the procedures and properties for all objects of that class

procedures functions

In Alice we have both___ and ___

return type

In Alice, all functions have a _____ because they must return some information.

property

piece of info about a particular object (thing)

parameters

piece of info that is passed to the procedure

String

popular type that is used to store groups of characters. usually this means words or sentences

Boolean

The value returned from a function can be a number, an object or a _____

d) Boolean

The value that the proximity question "mummy is within a given distance of an object" will return is a: a) Number b) Position c) Object d) Boolean e) None of the above

Function available to get input from the user

This is an example of what? this getBooleanFrom User message ????

Method (local): defined for use within a method Parameter: variable passed to a method Object (property): used to store an object property

Three types of variables

Conditional

something that can be true or false. Also known as a Boolean expression

initialize

to give it a starting value to a variable

while loop

type of indefinite loop used to repeat a section of code while a condition is true

positive whole number negative whole number zero

What are the numbers an integer can be

Use an if statement or if-else statement.

What do we use to create a decision in our programs?

Conditional

Something that can be true or false. Also known as a Boolean expression.

Boolean

Something that can be true or false. Also known as a conditional.

Boolean

Something that can be true or false. Known as a conditional

Function

Asks a question of the object and returns a value when called.

abstraction

By creating our own functions we have demonstrated the use of ______

Procedure

Commands that tell an object to complete a task.

Integer - positive, negative whole numbers and 0. Double - real numbers, anything that can be written as a decimal. Boolean - true or false. String - characters that are put together to form words or sentences.

Describe the different variable types

procedure's name.

Rather than having to write out all the details involved in our new procedures, we can just call the ______________

vehicle

Use the ___ property to synchronize the movements of two objects

visual or textual storyboard

We would want to use a _______ to plan out our method.

1. Start with a letter 2. Contain only letters, numbers or underscores 3. Can not be a keyword

What are Rules for identifiers

function procedure

What are the 2 types of methods in Alice

1. We have to choose a data type, from the following choices: integer double boolean string 2. name our variables by using a proper identifier 3. initialize the variable- give it a starting value

What are the 3 steps to create a variable

c) If the horse moves, so does the cat.

What does it mean to say that the "cat's vehicle is the horse"? a) If the cat moves, so does the horse b) Clicking on the cat makes the horse move c) If the horse moves, so does the cat. d) Clicking on the horse makes the cat move e) None of the above

A boolean statement that can be judged as either true or false

What is a conditional statement

Type of method. Something an object knows how to do like move or turn

What is a procedure

a conditional statement. A boolean statement that can be judged as either true or false

What is an if statement

A function is like a question. It will return a value. A procedure is a command. There is no return value.

What is the difference between functions and procedures?

A completed statement that we can use to get the number of times we want the skater to spin.

What is this an example of Double numSpinTimes= this getDoubleFromUser "Enter the number of times the skater should spin"


Ensembles d'études connexes

Chapter 7: Love and Romantic Relationships

View Set

Ortografía: palabras con m antes de p y b, y n antes de v

View Set

Anatomy & Physiology Unit 1.1.1 - 1.1.3

View Set

2-3-1 Working with Powers of 10 and Metric Prefixes

View Set