## Forum Posts

sfolax6776

May 23, 2022

In CS Fundamentals for ACSL

HW: Review all the statements below, are they true or false? X + Y = Y * X X * Y = YX (X + Y) + Z = (Y + Z) + X AC + BC = (A+B)*C A + 0 = 0 A + 1 = A X * 0 = 0 Y * 1 = 1 X + ~Y + Z + 1 = 1 Y ~Y = 0 B + B = B ABC = CAB (D + ~D) ~~X = 1 2. Simplify the following boolean expressions ~A ( B + A~B ) A~B ( A + ~B ) ~A + B~A + ~BA + ~B ~A (B + ~A) + A 3. The question I showed you in the class:

0

0

3

sfolax6776

May 09, 2022

In CS Fundamentals for ACSL

A. Notes In this last lesson of boolean algebra, we learned some common identities. Identities refer to the things that are always the same. For instance, A+B and B+A are always the same, so A+B and B+A are identities, we write A+B=B+A. Some commonly used identities in Boolean Algebra are below. #9 above is also called Law of Tautology. We can use these identities to simplify compound boolean expressions. While applying these identities, please keep in mind: A * or a dot both means AND, and sometimes we even omit them. i.e. AB, A*B, A&&B all mean A AND B. A bar on top of a variable means NOT, just as ! and ~. A bar on top of a compound expression means to negate the whole expression. See the example below. Solution I and II both simplify this boolean expression. B. HW Simplify the following boolean expressions: 2. Use DeMorgan's Law to simplify the following:

0

2

13

sfolax6776

May 02, 2022

In CS Fundamentals for ACSL

A. Notes Boolean expressions such as !A && !(B && !C) are called compound boolean expressions since !, && or || are used to connect multiple boolean variables. We can build a truth table to find out what ordered pairs or triples will make a compound boolean expression true (or false). When evaluating a compound boolean expression, it's a good practice to evaluate one part at a time. B. HWs 1. What ordered pair(s) will make the following boolean expressions false? A || ! B !(A&&B) || A 2. What ordered triple(s) will make the following boolean expressions true? !A || !B || !C !(A || B || C) !(A && B && C) 3. Assume that both a and b are integers. Will "a > b and b < 0" make the following boolean expression always true? !(a <= b) && (a * b > 0) 4. Given that a, b, and c are integers, consider the boolean expression (a < b) || !((c == a * b) && (c < a)) which of the following will guarantee that the expression is true? (A) c < a is false. (B) c < a is true. (C) a < b is false. (D) c == a * b is true. (E) c == a * b is true, and c < a is true.

0

1

8

sfolax6776

Apr 25, 2022

0

3

10

sfolax6776

Apr 18, 2022

In CS Fundamentals for ACSL

A. Notes In the computer, we use 1 to represent true and 0 to represent false. We need to use true and false to check facts such as if 100 is greater than 40 We also need and, or, as well as not to connect multiple facts such as "if 100 is greater than 40 or today is the Easter Sunday" We call true and false boolean values. We call and, or, not boolean operators. If we mix boolean values and boolean operators together, we get boolean expressions. B. Exercises

0

1

9

sfolax6776

Apr 12, 2022

0

0

3

sfolax6776

Apr 12, 2022

0

0

4

sfolax6776

Apr 08, 2022

In Scratch

When the green flag is clicked, a cover screen should show, with background music and a "Next" button When the "Next" button is clicked, an introduction screen should display "how-to play", with the "Next" button, background music continues. When the "Next" button is clicked, all characters show on the stage. With a "little rectangular box with a koala dude (Mr. Buster Moon )in it which looks like a FaceTime icon" inviting the player to click the "Next" button to play a song clip, and guess who the singer is by clicking on the character. When the "Next" button is clicked, the first clip plays. The player can click the character to guess or click on a "Hang up" button to stop the game. If the player guesses correctly, a green check will show and the score increases. Otherwise, a red cross will show and the score decreases. If the player finishes playing all the songs, a "Congrats" screen will show and display the score. If the player clicks "Hang up" before finishing all the songs, a plain black screen will show and display his/her score.

0

1

7

sfolax6776

Apr 04, 2022

0

1

6

sfolax6776

Mar 28, 2022

In CS Fundamentals for ACSL

A. Notes Please refer here for how to turn an infix expression to prefix or postfix B. Hw (One question does not show correctly, please skip that one.)

0

2

17

sfolax6776

Mar 23, 2022

In Scratch

A. Finalized gameplay: All characters will be standing on the stage, while a mixed playlist is playing. The game player will guess the singer of the song by clicking on one of the characters. If the player guesses correctly, a big "Congrats" screen will show, otherwise a "wrong answer" signal will be given and the user will keep guessing the next song. There will be a STOP and PLAY button on the screen to allow the player to stop the playlist or continue. B. Finalized characters: As described below: C. Finalized playlist: 20 seconds each clip. There are 10 clips recorded as described below: D. Finalized background/stages: See screenshots below E. Project plan updates: The week following 3/23 HW: 1) Each of Eve should complete part B, C, D above independently. Add them as comments below. 2) Add more animations if you see necessary.

0

0

3

sfolax6776

Mar 10, 2022

In Scratch

A. The gameplay All characters will be on the stage while a mix of songs playing in the background. The user will guess who the singer of the song is. Depends on if the user can guess correctly, the game will respond differently. B. The project plan 3/9: finalize the rough gameplay
3/16: finalize the characters and the playlist. C. HW The week following 3/9: work on the costumes of all characters to finalize on the next Wed.

0

0

5

sfolax6776

Mar 07, 2022

In CS Fundamentals for ACSL

A. Coding: Write a Python program to convert 5 letters to Morse Code. Justin: A-E; Noah: F-J; Jiayin: K-O; Zihan: P-T. B. Convert binary numbers below to octal and hexadecimal.

0

3

21

sfolax6776

Feb 27, 2022

In CS Fundamentals for ACSL

HW: A. Make sure you have a repl.it account, I will create a team in the next class so we can share code. B. Print one or more images from this post using Python. C. Print the black-tiled rectangle as described at the bottom of this post. You can do this in two steps: first only print only the boarder, then modify your code to add the bar at the center. It's perfectly okay if you got stuck at first. We will work it together in class.

0

1

12

sfolax6776

Admin

Followers

Following

Follow