Presentation is loading. Please wait.

Presentation is loading. Please wait.

The + can mean concatenate or add

Similar presentations


Presentation on theme: "The + can mean concatenate or add"— Presentation transcript:

1 The + can mean concatenate or add
The + can mean concatenate or add. If you want to add you must be using things that JavaScript recognizes as numbers. You can convert the contents of a field to a number using parseFloat if there are decimals and parseInt for a while number.

2 This is a nested if where I check myPoints < 10 and if that is true, I move Not.. to msg otherwise, I ask another question.

3

4

5 Right now if I enter an * I do multiplication, if I enter anything else I divide. To avoid this I need to add an if where I test for the / to divide. I am going to put an else on that if and move 0 to ans if anything other than * or / is entered.

6

7

8 is the same for these two examples.

9

10

11

12 I increment ct inside the loop
I increment ct inside the loop. This changes ct so eventually I will exit the loop. If the condition does not change, the loop will go on forever.

13

14

15

16

17

18

19 Wrapup where I do one time things when processing is complete.

20

21

22

23

24

25

26

27 complete.

28

29 I could have defined in the body.

30

31

32

33

34 With three questions that can be either Yes or No there are 8 possibilities.


Download ppt "The + can mean concatenate or add"

Similar presentations


Ads by Google