Development

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 »

Shopping Cart
Scroll to Top