This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-11-21 11:08:56

princesscarla4
New Scratcher
Registered: 2011-11-09
Posts: 8

Does anyone know this?

Hello, I am fairly new to this, and I am working on a project and I am trying to get a better understanding of everything, and had a few questions about scratch. Can anyone help me?

1) Once a variable contains a value, can that value be changed?

2) Can a variable contain a number, then later in the program, contain words, and if so could that be a bad thing?

3) If there are two loops, the outer executes 5 times, the inner executes 3 times. Inside the inner loop, there is a block of code that makes a sprite say "text". How many times will the sprite say, text'?

4) You have a program that has an if/else structure, and two variables, X and Y. The only time you want the alternative block(s) to execute is when both variables equal 10. What Boolean expression could you use for this situation?

Offline

 

#2 2011-11-21 11:16:43

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Does anyone know this?

1) yes it can be changed

2) yes

3)15 times

4)[blocks] << <( <{ X }> <=>10  )> <and> <( <{ Y }> <=>10  )> >>[/blocks]


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2011-11-21 11:18:43

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Does anyone know this?

TRocket wrote:

1) yes it can be changed

2) yes

3)15 times

4)[blocks] << <( <{ X }> <=>10  )> <and> <( <{ Y }> <=>10  )> >>[/blocks]

Here's a clearer version of 4);
If (X = 10) and (Y = 10) then (ect..)


I'm back.
Maybe.

Offline

 

#4 2011-11-21 11:27:58

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Does anyone know this?

1) Once a variable contains a value, can that value be changed?

Yes.

2) Can a variable contain a number, then later in the program, contain words, and if so could that be a bad thing?

Yes, and then no.

3) If there are two loops, the outer executes 5 times, the inner executes 3 times. Inside the inner loop, there is a block of code that makes a sprite say "text". How many times will the sprite say, text'?

15.

4) You have a program that has an if/else structure, and two variables, X and Y. The only time you want the alternative block(s) to execute is when both variables equal 10. What Boolean expression could you use for this situation?

X=10 and Y=10.

Hope I helped!  smile


Why

Offline

 

#5 2011-11-21 13:55:00

nightmarescratcher
Scratcher
Registered: 2011-10-10
Posts: 1000+

Re: Does anyone know this?

RedRocker227 wrote:

1) Once a variable contains a value, can that value be changed?

Yes.

2) Can a variable contain a number, then later in the program, contain words, and if so could that be a bad thing?

Yes, and then no.

3) If there are two loops, the outer executes 5 times, the inner executes 3 times. Inside the inner loop, there is a block of code that makes a sprite say "text". How many times will the sprite say, text'?

15.

4) You have a program that has an if/else structure, and two variables, X and Y. The only time you want the alternative block(s) to execute is when both variables equal 10. What Boolean expression could you use for this situation?

X=10 and Y=10.

Hope I helped!  smile


http://fc07.deviantart.net/fs70/f/2011/171/f/3/derpy_hooves_derp_sig_by_alicehumansacrifice1-d3jg613.png

Offline

 

#6 2011-11-21 16:26:30

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Does anyone know this?

Sounds like homework questions to me! hahaha  tongue

also, the 4th question asks that the ALTERNATIVE block executes when both variables equal 10 - so your condition could be one of these two possibilities...

1.   not (x = 10) or not (y = 10)
2.   not ( x=10 and y=10 )

this interchangability between negated and/or conditions is called Demorgan's Law

Last edited by Ratty1967UK (2011-11-21 16:31:50)

Offline

 

#7 2011-11-21 16:41:21

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Does anyone know this?

Ratty1967UK wrote:

Sounds like homework questions to me! hahaha  tongue

also, the 4th question asks that the ALTERNATIVE block executes when both variables equal 10 - so your condition could be one of these two possibilities...

1.   not (x = 10) or not (y = 10)
2.   not ( x=10 and y=10 )

this interchangability between negated and/or conditions is called Demorgan's Law

Oh yeah, I didn't realise that it said ALTERNATIVE blocks execute. That's what happens when you only skim the question though I guess  hmm   lol


Why

Offline

 

#8 2011-11-22 09:22:40

princesscarla4
New Scratcher
Registered: 2011-11-09
Posts: 8

Re: Does anyone know this?

TRocket wrote:

1) yes it can be changed

2) yes

3)15 times

4)[blocks] << <( <{ X }> <=>10  )> <and> <( <{ Y }> <=>10  )> >>[/blocks]

-THANKS THIS HELPS A LOT-

Offline

 

#9 2011-11-22 09:28:14

princesscarla4
New Scratcher
Registered: 2011-11-09
Posts: 8

Re: Does anyone know this?

DigiTechs wrote:

TRocket wrote:

1) yes it can be changed

2) yes

3)15 times

4)[blocks] << <( <{ X }> <=>10  )> <and> <( <{ Y }> <=>10  )> >>[/blocks]

Here's a clearer version of 4);
If (X = 10) and (Y = 10) then (ect..)

-THANKS THIS HELPS A LOT-

Offline

 

#10 2011-11-22 09:38:55

princesscarla4
New Scratcher
Registered: 2011-11-09
Posts: 8

Re: Does anyone know this?

RedRocker227 wrote:

1) Once a variable contains a value, can that value be changed?

Yes.

2) Can a variable contain a number, then later in the program, contain words, and if so could that be a bad thing?

Yes, and then no.

3) If there are two loops, the outer executes 5 times, the inner executes 3 times. Inside the inner loop, there is a block of code that makes a sprite say "text". How many times will the sprite say, text'?

15.

4) You have a program that has an if/else structure, and two variables, X and Y. The only time you want the alternative block(s) to execute is when both variables equal 10. What Boolean expression could you use for this situation?

X=10 and Y=10.

Hope I helped!  smile

-THANKS THIS HELPS A LOT-

Offline

 

#11 2011-11-22 09:42:14

princesscarla4
New Scratcher
Registered: 2011-11-09
Posts: 8

Re: Does anyone know this?

Ratty1967UK wrote:

Sounds like homework questions to me! hahaha  tongue

also, the 4th question asks that the ALTERNATIVE block executes when both variables equal 10 - so your condition could be one of these two possibilities...

1.   not (x = 10) or not (y = 10)
2.   not ( x=10 and y=10 )

this interchangability between negated and/or conditions is called Demorgan's Law

-THANKS THIS HELPS A LOT-

Offline

 

#12 2011-11-22 19:28:06

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Does anyone know this?

you're welcome - glad I could help  smile

Offline

 

#13 2011-11-22 19:58:23

FallenIce
Scratcher
Registered: 2011-10-14
Posts: 100+

Re: Does anyone know this?

only know 1 and 2 [:p]

yes and yessire


http://i.imgur.com/Yc7aC.gif

Offline

 

Board footer