GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Consider the three code segments. What is the output of the…

Consider the three code segments. What is the output of the programs? Block-Based Pseudo-Code   The pseudocode initializes list and sets temp to 0. For each item in the list, it checks if item MOD 2 equals 1. If true, item is added to temp. After the loop, temp is displayed. Python Program-Code list = [66,55,44,33,22,11]temp = 0for item in list: if (item % 2 == 1): temp = temp + itemprint(temp) Text-Based Pseudo-Code list ← [66,55,44,33,22,11]temp ← 0FOR EACH item IN list{ IF (item MOD 2 = 1) { temp ← temp + item }}DISPLAY (temp)

Read Details

Consider the three code segments. What is the output of the…

Consider the three code segments. What is the output of the programs after they are executed 100 times? Block-Based Pseudo-Code   The pseudocode repeats a process 100 times. Each time, x is assigned a random integer from 1 to 9. If x MOD 2 equals 0, it displays “multiple of 2”. If x MOD 3 equals 0, it displays “multiple of 3”. Python Program-Code from random import*for k in range (100): x = randint(1,9) if (x % 2 == 0): print (“multiple of 2”) if (x % 3 == 0): print (“mulitple of 3”) Text-Based Pseudo-Code REPEAT 100 TIMES{ x ← RANDOM (1, 9) IF (x MOD 2 == 0) { DISPLAY (“multiple of 2”) } IF (x MOD 3 == 0) { DISPLAY (“multiple of 3”) }}

Read Details

Consider the three code segments. What is the output of the…

Consider the three code segments. What is the output of the programs? Block-Based Pseudo-Code The pseudocode assigns 100 to x and 200 to y. It then sets sum equal to x + y and outputs the value of sum. Python Program-Code x = 100y = 200sum = x + yprint (sum) Text-Based Pseudo-Code x ← 100y ← 200sum ← x + yDISPLAY (sum)  

Read Details

Consider the three code segments. What is the program output…

Consider the three code segments. What is the program output with execution input of 1111, followed by a second input of 1234? Block-Based Pseudo-Code   The pseudocode initializes pin to “0000” and repeats until pin equals “1234”. It displays “Enter PIN”, accepts user input, and checks the value. If correct, it displays “Proceed”; otherwise, it displays “Re-enter PIN” and requests input again. Python Program-Code pin = “0000”while (pin != “1234”): pin = input(“Enter PIN”) if (pin == “1234”): print (“Proceed”) else: pin = input(“Re-enter PIN”) Text-Based Pseudo-Code pin ← “0000”REPEAT UNTIL (pin == “1234”){ DISPLAY (“Enter PIN”) pin ← INPUT () IF (pin == “1234”) { DISPLAY (“Proceed”) } ELSE { DISPLAY (“Re-enter pin”) pin ← INPUT () }}

Read Details

Consider the three code segments. score is an integer test v…

Consider the three code segments. score is an integer test value in the [0..100] range. What is the output of the programs? Block-Based Pseudo-Code   The pseudocode checks a score using separate IF statements. If the score is at least 90, grade is set to “A”; at least 80 to “B”; at least 70 to “C”; otherwise to “F”. The program then displays grade. Python Program-Code if (score >=90): grade = “A”if (score >=80): grade = “B”if (score >=70): grade = “C”if (score >=0): grade = “F”print (grade) Text-Based Pseudo-Code IF (score >= 90){ grade ← “A”}IF (score >= 80){ grade ← “B”}IF (score >= 70){ grade ← “C”}IF (score >= 0){ grade ← “F”}DISPLAY (grade)

Read Details

You want to build a box with an open top out of a piece of c…

You want to build a box with an open top out of a piece of cardboard that measures 20 inches by 30 inches. You do this by removing squares from each corner that are x units wide. What is the maximum volume you can create? 

Read Details

Which is the graph of  ? 

Which is the graph of  ? 

Read Details

Convert the equation for the parabola  to standard form. 

Convert the equation for the parabola  to standard form. 

Read Details

In Oklahoma, there was an earthquake that measured 3.1 on th…

In Oklahoma, there was an earthquake that measured 3.1 on the Richter scale. Six years later, there was an earthquake in the same area that measured 5.8 on the Richter scale. How much more intense was the second earthquake than the first?  Use the formula  to solve. 

Read Details

Using the formula  , find the intensity of music at 120 deci…

Using the formula  , find the intensity of music at 120 decibels.

Read Details

Posts pagination

1 2 3 … 91,472 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top