I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Word statistics - Beginner
Word statistics - intermediate
Word statistics - hard
A matter of age
Keyword game - beginner
Keyword game - intermediate
Save the score
Keyword game - hard
Crossword solver
Notepad!!
File access

These tasks are all related to file access.

Word statistics - Beginner

You are to create a program which will read in text from a file using the sample code below. The name of the text file will be “words.txt” and must be placed in the same place as your code. myfile = open("words.txt", "r") # open file in read mode fullTextFile = myfile.read() # read in […]

Word statistics - intermediate

You are to create a program which will read in text from a file using the sample code below. The name of the text file will be “words.txt” and must be placed in the same place as your code. myfile = open("words.txt", "r") # open file in read mode fullTextFile = myfile.read() # read in […]

Word statistics - hard

You are to create a program which will read in text from a file using the sample code below. The name of the text file will be “words.txt” and must be placed in the same place as your code. myfile = open("words.txt", "r") # open file in read mode fullTextFile = myfile.read() # read in […]

A matter of age

You have been given a text file containing the following data – bert,32 sally,13 mary,21 bill,25 You must save this data into a text file (with a file name of your choice). Your job is to read in this text file, order it by age (the number) and then output it back to the file […]

Keyword game - beginner

Write a simple flash card program which will – Load up flash cards from a file Pick one at random Display the word / idea Wait for a few seconds or for a key press. Then display the answer You need to log in or create an account to submit code!

Keyword game - intermediate

Write a simple flash card program which will – Load up flash cards from a file Pick one at random Display the word / idea Wait for a few seconds or for a key press. Then display the answer Offer a choice of 4 definitions at random (one is correct) Allow the user to guess […]

Save the score

You are to write a program which can load and save scores into a file. The file will be structrued as below – 1,masta,5000 2,bert,4325 3,sally,4011 4,sue,3834 5,Les,3731 Each score is on a new line and is made up of the position, name and score. Your program will need to ask for the new score […]

Keyword game - hard

Write a simple flash card program which will – Load up flash cards from a file Pick one at random Display the word / idea Wait for a few seconds or for a key press. Then display the answer Offer a choice of 4 definitions at random (one is correct) Allow the user to guess […]

Crossword solver

You need to create a program which will ask the user for a word which has a number of unknown letters. When entering the unknown word into the computer you will use “*” for any unknown letters. For example, if the input was “ha**y” then it should output – hairy handy hanky happy hardy harpy […]

Notepad!!

You must create a simple program which will act a bit like notepad! It must – Allow the user to open an existing file and load it all into memory Allow the creation of a file if the specified one does not exist. Allow each sentence to be added one line at a time Add each line […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Information