Exercise 1

Exercise 1
1 / 4
volgende
Slide 1: Tekstslide
Ilearningdeal@gmail.comFurther Education (Key Stage 5)

In deze les zitten 4 slides, met tekstslides.

Onderdelen in deze les

Exercise 1

Slide 1 - Tekstslide

EXERCISE 1 – DATA TYPES AND MATHS FUNCTIONS

Write a basic program that does the following
• Sets up two variables
• Performs an addition of the two variables
• Shows the addition of the two variables to the user
• Shows the multiplication of the two variables to the user
• Shows the subtraction of the two variables to the user
Present the output neatly and add extra formatting so it is clear


Slide 2 - Tekstslide

Exercise 1 
EXERCISE 1 – DATA TYPES AND MATHS FUNCTIONS

Write a basic program that does the following
• Sets up two variables
• Performs an addition of the two variables
• Shows the addition of the two variables to the user
• Shows the multiplication of the two variables to the user
• Shows the subtraction of the two variables to the user
Present the output neatly and add extra formatting so it is clear


Slide 3 - Tekstslide

sum_result = a + b
diff_result = a - b
prod_result = a * b
# 3) Present the output neatly with extra formatting
print("------ Basic Arithmetic Demo ------")
print(f"Variables:")
print(f" a = {a}")
print(f" b = {b}")
print()
print("Results:")
print(f" a + b = {sum_resu
lt}")
print(f" a - b = {diff_result}")
print(f" a * b = {prod_result}")
print("---------------------------------- ")














Slide 4 - Tekstslide