Flowcharts, Pseudocode and Python
Quiz 4
Input and Output


  1. We want to display "Hello World!" on the screne. Which pseudocode will correctly do this?

    Print 'Hello World!'
    Print "Hello World!"
    Print (Hello World!)
    Print $Hello World!$

  2. We want to get the value of currentAge from the user. Which pseudocode will correctly do this?

    get currentAge
    input currentAge
    get "current age"
    input "current age"

  3. In Python, we use ____ to get numerical information from the user:

    get()
    put()
    print()
    int(input())

  4. In Python, the following code will cause the cursor to blink on the ____ line as the request:

    print("Please enter your age: ")
    currentAge = int(input())
    

    Same
    Next
    Third
    Fourth

  5. In Python, the following code will cause the cursor to blink on the ____ line as the request:

    currentAge = int(input("Please enter your age: "))
    

    Same
    Next
    Third
    Fourth

  6. In Python, print ("Your current age is: " + currentAge) will

    Print correct results
    Produce an error
    Prompt the user for the input
    None of the above

  7. True or False: In Python, we need to convert a numerical variable to a string before printing the results.

    True
    False

  8. print ("2" + str(2)) would produce:

    4
    6
    8
    22

  9. Which variable satisfied camel notation for variables:

    numOfMiles
    NumOfMiles
    numofMiles
    NUMOFMILES

  10. Which name in Python will you use for a constant?

    Rate
    RATE
    rate
    raTe