Python
C Programing
Perl
Kahoot
Quizlet
100

what is the data type 

>>> example = { "FName":"John", "LName":"Doe", "Blk3":98 }

What is Dictionary?

100

// C program to illustrate 

// syntax error 

#include<stdio.h> 

void main() 

    int x = 10; 

    int y = 15;  

      

    printf("%d", (x, y)) 


error: expected ';' before '}' token

100

def Add 

{

   @_;  # special array to hold passed arguments

   $sum = 0;

   $counter = 0;

   foreach $item (@_) # loop for each argument in array

   {

      $sum += $item;

      print "$_[$counter] "; # unpacked argument

      $counter++;

   }

   return $sum;

}

$num = Add(10..20);

print "= $num";

Perl does not read user defined functions with the def command.

100

In a flowchart, what shape is used to denote the start/end of a program?

What is a Rectangle (rounded)?

100

Are often used to automate repetitive tasks.

What are Scripts?

200

('Phase 1', 'Block')
Phase 1
('Python', 'Obj 3f', 'Python', 'Obj 3f')
('UCT', 'Phase 1', 'Block', 3, 'Python', 'Obj 3f')
File "main.py", line __, in
tuple[3] = 3

Type Error: 'tuple' object does not support item assignment

200

#include <stdio.h>

int main()

{

   int count=1.4;

   while (count <= 4);

   {

                printf("%f ", count);

                count+;

   }

   return 0;

}

 

   while (count <= 4)

   printf("%d ", count);

    count++;

 

200

WHAT IS THE OUTPUT?

 

$grade = 72;

$status = ($grade >= 70)? "Passed" : "Failed";

print "You $status\n";

 

ANSWER?

Output:

You Passed

200

Contains routines that support operations such as function definitions, input, output, etc.

What are Libraries?

200

A set of goals to be accomplished for the program to work.

What is a Task List?

300

if spam == 42
    print('Hello!')

Failed to put a : at the end of if statement.

300

for(i=1;i<=10;i++)

 sum1=sum1+i;

 sum2=sum2+i*i;

printf(“%d%dn”,sum1,sum2);

What is missing {}

300

If the user inputs 3, what will the output be?


print "Enter a positive whole number less than 10\n"; $number= <STDIN>; chomp ($number); if ($number > 10) {

print "Try a smaller number";

}

else

{

for ($count = 1; $count<= $number; $count++) {

printf "Square of $count is %d\n", $count**2; } }


ANSWER:

"Square of 1 is 1"

"Square of 2 is 4"

"Square of 3 is 9"


ANSWER:

"Square of 1 is 1"

"Square of 2 is 4"

"Square of 3 is 9"

300

Standard library that includes I/O functions, extended conversions, & memory allocation

What is stdio.h?

300

Are scripts written on the command line in the scripting language of choice and immediately interpreted and executed; not save (nothing left behind to trace).

What are One-Liners?

400

if spam = 42:
    print('Hello!')

Used = instead of ==

400

//for loop example, what does sum = ?

#include <stdio.h>

int num = 3, sum = 0;

int main()
{
    // for loop terminates when n is less than count
    for(int count = 1; count <= num; ++count)
    {
        sum += count;
    }

    printf("Sum = %d", sum);

    return 0;
}

 (answer is sum = 6)

400

What is the error?


@a=0;

while (@a<10)

{

print 1..@a, "\n";

@a++;

}

ANSWER: a is not an array, it is a scalar

400

Default file name that the compiler uses?

What is a.out?
400

Gives the programmer added flexibility to write separate blocks of code for both a true or false evaluation; creates an either-or situation.

What is an "if...else" statement?

500

print('Hello!')
    print('Howdy!')

# or

if spam == 42:
    print('Hello!')
  print('Howdy!')

Using the wrong amount of indentation.

500

include <stdio.h>
int main()
{
   float number;
   printf("Enter an integer: ");
   scanf("%d",&number);

    if(number%2 == 0){
       printf("%d is an even integer.",number);
   }
   else {
       printf("%d is an odd integer.",(number));
   }
   return 0;
}

missing # in header file

number should be an int not a float

too many parenthesis in else print statement

500

What is the issue with the function:

$a = 11;

while( $a > 10 )

{

   print "Value of a: $a\n";

   $a += 1;

}

Will never meet exit conditions.

500

Data type for an object that does not have a value

of any of the other types.

What is Void?

500

Enables you to choose one course of action from a list of possible actions; requires a break statement to terminate a statement.

What is a "Switch" statement?

M
e
n
u