# YOUR NAME: e.g I. Lv. Sneks
# COMPUTING ID: e.g. ils3py@virginia.edu
# PA NUMBER and NAME: e.g. PA 00 - Fix it Up!
# Resources used (if applicable):

# Hint: comment out other questions when working on one question, then comment them back in when needed

# Note on comments:
# This line is an example of a single-line comment
'''
This
is a
multi-line
comment
'''

# NOTE: Use the button that looks like a play button in the top left corner of each box to run each box of code

###### QUESTION 1 ###### New Line Printing
print("Hello")
print("World")

# HOW DO YOU COMBINE THESE TWO PRINT STATEMENTS INTO ONE PRINT STATEMENT, BUT THE RESULTING OUTPUT
# HAS THE WORDS "Hello" AND "World" ON *SEPARATE* LINES?

# Type your ANSWER (one line of Python code) on the line BELOW (do not put your answer as a comment):
# *DELETE THIS COMMENT LINE & ADD YOUR LINE OF CODE HERE - Hint: it should be ONE print statement*

print("-------------------------------------------------------------------------------------")

###### QUESTION 2 ###### Printing Using Tab
print("Hello")
print("World")

# COMBINE THESE TWO PRINT STATEMENTS INTO ONE, BUT ADD TAB SPACE BETWEEN "HELLO" AND "WORLD" ON SAME LINE

# Type your ANSWER (one line of Python code) on the line BELOW (do not put your answer as a comment):
# *DELETE THIS COMMENT LINE & ADD YOUR LINE OF CODE HERE - Hint: it should be ONE print statement*

# DO NOT USE THE TAB KEY (on your keyboard) TO JUST WRITE print("Hello   World")
# output should look like this: Hello   World
print("-------------------------------------------------------------------------------------")

###### QUESTION 3 ###### Variable Names
# Option 1:
num = 1234
# Option 2:
num = "hello"

# There is no syntax error in the lines of code above. However...
# WHICH OF THESE TWO VARIABLES (OPTION 1 OR OPTION 2) IS MORE APPROPRIATE?
# Type your ANSWER on the line BELOW (write your answer as a comment, do not delete the # symbol):
# ANSWER:

print("-------------------------------------------------------------------------------------")

###### QUESTION 4 ###### Typecasting
'''
num1 = 135      # Do NOT edit this line (line 1)
num2 = "246"    # Do NOT edit this line (line 2)
sum = num1 + num2
print(sum)      # Make sure you don't delete or edit this line! (line 4)
'''

# CURRENTLY, THIS CODE CREATES AN ERROR WHEN THE PROGRAM IS RUN.
# PLEASE FIX THIS CODE BY COPYING THE ABOVE 4 LINES BELOW, THEN EDITING ONLY THE *THIRD* LINE OF CODE.
# *DO NOT MODIFY/CHANGE THE VALUES OF THE VARIABLES IN THE GIVEN CODE*
# -- That is to say, on line 1 if you want num1 to be a string, don't simply add quotations, or remove quotations.
# -- How else can you achieve this to fix the problem? (Hint: review examples in class/on slides)
# Output should be 381 when code is run.  ==> Make sure your answer is executable code and NOT a comment!
# ANSWER:

print("-------------------------------------------------------------------------------------")

###### QUESTION 5 ###### Math Arithmetic
'''
x = 25          # Do NOT edit this line (line 1)
y = 4           # Do NOT edit this line (line 2)
quotient = x/y
print(quotient) # Make sure you don't delete or edit this line! (line 4)
'''

# Modify the code above so that the result of quotient is an integer (rounded down) and not a decimal.
# PLEASE EDIT THIS CODE BY COPYING THE ABOVE 4 LINES BELOW, THEN EDITING ONLY THE *THIRD* LINE OF CODE.
# *DO NOT MODIFY/CHANGE THE VALUES OF THE VARIABLES IN GIVEN CODE*
# YOU MAY NOT USE ANY IMPORT LIBRARIES
# Output should be 6.  ==> Make sure your answer is executable code and NOT a comment!
# ANSWER:

print("-------------------------------------------------------------------------------------")

###### QUESTION 6 ###### Math Arithmetic
# Please complete the code below so that the given decimal is rounded down to the 
# nearest hundredths and not thousandths:
n = 12.345    # do not modify this variable in any way

# ADD YOUR CODE HERE (hint: use a combination of math operators such as /, %, *, +, -)
# NOTE: You must use at least two (2) different math operators in your solution!

print(n)      # do not change this line of code

# YOU MAY NOT USE ANY IMPORT LIBRARIES
# Output should be 12.34

print("-------------------------------------------------------------------------------------")

###### QUESTION 7 ###### Pseudocode
'''
Pseudocode to swap variables a and b:
    - Create a new temporary variable called temp. This variable should be assigned the value of variable a
    - The existing variable a should be assigned the value of b
    - The existing variable b should be assigned the value of temp (original value of a)
'''
# Above is the pseudocode for swapping values between variable a and variable b (using a third variable temp)
# (the variables are already declared with their values. DO NOT CHANGE THEM.)
# Follow the pseudocode from above to write actual code below:
a = 2       # Do NOT edit this line
b = 3       # Do NOT edit this line
# WRITE YOUR CODE BELOW THIS LINE:


print(a, b)     # should print 3 2 and NOT 2 3
print("-------------------------------------------------------------------------------------")
