Questions

Program Flow 2

Study the code below 001 print(“Welcome to the Adding Machine”) 002 print(“*****************************”) 003 number1 = int(input(“Enter your first number: “)) 004 number2 = int(input(“Enter your second number: “)) 005 sum = number1 + number2 006 print(“The sum of your inputs is”, sum) State which programming construct this algorithm uses. Explain your answer.

Program Flow 2 Read More »

Program Flow 1

Study the code below: 001 numberToBeGuessed = 72 002 numberTry = 0 003 while numberTry != numberToBeGuessed 004      numberTry = input(“Enter a guess”) 005      if numberTry < numberToBeGuessed 006          print(“Too Low”) 007      elseif numberTry > numberToBeGuessed 008          print(“Too High”) 009      endif 010 endwhile 011 print(“You Got It!”) State what

Program Flow 1 Read More »

Variables and Data Types 1

A Computer Science student is writing a program that must accept various data about the user. In particular, the program needs to store the user’s first initial, surname, age and whether or not the user likes marmite, in 4 separate variables. State the most appropriate data type(s) for these 4 variables: – first_initial – surname

Variables and Data Types 1 Read More »

Merge 1

Study the following dataset:   5 4 3 6 2 7 Show  This command word is requesting that you provide a step by step example how a merge sort would sort the data, step by step.

Merge 1 Read More »

Insertion 3

State This command word requires you to write a statement that clearly highlights one way that an insertion sort is inferior to merge sort a disadvantage of an ‘Insertion Sort’ compared with a ‘Merge Sort’.

Insertion 3 Read More »

Insertion 1

Study the following dataset: 5 4 3 6 2 Show This command word is requesting that you provide a step by step example how an insertion sort would sort the data, step by step.

Insertion 1 Read More »

Shopping Cart