Print "Hello World"
Create two variables and assign them a number. Add them together and print the answer
Create a variable that collects a persons first and last name. Print both of these out using concatenation in a sentence
Create an input and collect the user's date of birth and calculate their current age
Write a program that calculates the perimeter of a rectangle. 4 number inputs.
Write a program that allows a user to enter 4 numbers. The program should total and average the amounts.
Create an input variable where the user enters a number. If number is bigger then 10 - print "larger then 10" else print "less then 10"
Write a program that asks the user how many pets they have at home. For each response up to 3 or more, the program should print a unique response. Include concatenation in each of your responses with the users input - need to cast input as a string
Write a program that allows a user to enter in multiple numbers. The program should keep adding them up until the user enters 0.
Write a program that accepts 3 number inputs and sorts them from smallest to largest.
Write a program that accepts 4 numbers, but only sums odd numbers.
Prompt the user to type in their favorite movie. Prompt the user to type in how many stars they would give it out of 5. If they enter a number outside the range of 1 - 5, print an error message and ask the user to try again. Once the user enters a valid number, the program should print a concatenated string including the movie name and number of stars.
Create a program that can allow a user to enter in their weekly budget. The user should enter their weekly income first, then have an option to enter all their expenses. The program should keep subtracting from the income until the number 0 is entered. A count variable should keep track of the number of items entered. Then calculate and print how much money this person could save per year.
Print the 8 times tables from 1 -12 using a for loop.
Build a working calculator with an appropriate menu.
***Design a program to continually add the following numbers. 1 + 2 + 3 ...... 97+98 + 99
Design a program a basic ATM program. The solution should enable the user to deposit and withdraw funds from an account. The program should print the total or remaining funds in the account after each deposit or withdraw. EXTENSION - add a log in feature, where the user must enter a valid username and PIN number.
Copy and run the following program:
name='Bob'
print('Hello '+name)
Challenge task:
Complete the following program so it uses the variables to print out ‘the cat sat on the mat’. It should print out on
one line, with spaces.
E.g.
word1='the'
word2='cat'
word3='sat'
word4='on'
word5='the'
word6='mat'
[REMAINDER OF PROGRAM HERE]
Copy and run the following program:
name=input('What is your name?')
print('Hello '+name)
Challenge task:
Write a program that asks the user their name and then asks what their favourite food is, using their
name in the question, and responds to their answer.
Challenge task:
Write a program that asks the user their first name and then asks them their surname and then prints
their whole name 3 times.
Eg:
What is your first name?
What is your surname?
Miss Dodd Miss Dodd Miss Dodd
Challenge task:
Write a program that uses the following variables to calculate the number of minutes in a week:
Variables:
DaysPerWeek
HoursPerDay
MinutesPerHour
Challenge task:
Type Casting
To cast data to an integer we use int()
To cast data to a string we use str()
Challenge task:
Write a program that asks the user their name, says ‘Hello’ to them, using their name and then asks how
old they are. The program should then calculate their age at their next birthday and respond “So your
next birthday you are (age)?’
Type Casting
To cast data to an integer we use int()
To cast data to a string we use str()
Challenge task:
Find the area of a rectangle
Write a program that finds the area of a rectangle:
Eg:
Please enter width: 9
Please enter height: 5
The area is: 45
Challenge task:
Write a program that asks the user how long, on average, they spend on a computer per day.
IF the user spends less than 2 hours per day, the program needs to say, ‘That seems reasonable’
ELSE, the program needs to say, ‘Get a life’
Challenge task:
Sometimes there are more than two possible options. I could have jelly babies OR gummy bears OR fried eggs OR drumsticks.
Building on challenge 10, write a program that asks the user how long, on average, they spend on a
computer per day and:
IF it is less than 2 hours says ‘That seems reasonable’
ELSE IF it is less than 4 hours per day says ‘Do you have time for anything else?’
ELSE, the programs says, ‘You need to get some fresh air once in a while, and a life’
Hint: ELSE IF becomes ELIF in Python
Challenge task:
For this challenge you will need to use all of the things that you have learnt so far. You will need to import random.
Write a program where the computer thinks of a number between 1 and 100 (i.e. picks a number at
random). It should then ask the user to guess what number it is thinking of. It should then say whether
the number the computer is thinking of is higher or lower than the one guessed. If the user guess
correctly it should say well done and say how many guesses it took them, if not it asks them to guess again.
1. Develop a cricket score book for a 20/20 game that records and calculate the runs for each team for an innings. It should be able to determine the end of an over and end of an innings. Only team runs need to be recorded, not batters yet.
6 ball pers over, unless
Wide = 1 run, plus one more additional ball
No Ball = 1 run, plus one more additional ball
10 wickets per innings
maximum 20 overs per innings
2. Create a program to calculate compound interest. The user should be prompted to enter a principal, interest rate, years of investment and number of times per year the investment is compounding.
The formula for annual compound interest, including principal sum, is:
A = P (1 + r/n) (nt)
Where:
A = the future value of the investment/loan, including interest
P = the principal investment amount (the initial deposit or loan amount)
r = the annual interest rate (decimal)
n = the number of times that interest is compounded per year
t = the number of years the money is invested or borrowed for
3. Create an Australian Government Tax Calculator to allow a user to calculate how much tax they need to pay per year. Use the current tax brackets below. The user should then be able to enter a weekly or fortnightly wage and calculate tax per year also
Resident tax rates 2017–18
0 – $18,200 - Nil
$18,201 – $37,000 - 19c for each $1 over $18,200
$37,001 – $87,000 - $3,572 plus 32.5c for each $1 over $37,000
$87,001 – $180,000 - $19,822 plus 37c for each $1 over $87,000
$180,001 and over - $54,232 plus 45c for each $1 over $180,000
4. Create a Binary to Decimal Converter. The user should be able to enter a binary number (length of 8 numbers) and then the program should convert the binary into a decimal.
The binary system uses the base 2 number system to store binary numbers. See image below.
1. Create a list of types of pets and using a for loop, print them out in reverse order.
2. Create a list of numbers and use a for loop to add them all together (find the sum of all numbers)
3. Using an input prompt, add elements to a list inside a while loop i.e. add multiple inputs into a list
4. Create a list of 10 items and use a loop to remove every second item in the list.
5. Create a program that allows the user to enter a word. The program should print out the word backwards. Store the word characters in a list.
6. Create a text file of names and write a program to gather data into a list and print out in the console
7. Using a list, attempt the binary converter.