Vous êtes sur la page 1sur 1

COMP1405 - Assignment #1

(Due: Thursday, September 29th @ 9:00pm)


In this assignment, you will practice your problem solving and abstraction skills.

(1) Going Home - High Level


Write a pseudocode program that is exactly 5 lines long which explains (step by step) how you can get from this course's classroom to the front door of your house or apartment or room. You will be marked on clarity, conciseness and grammar. Note: If you are concerned about privacy issues, you do not need to
use actual street names and your actual house/apartment/room number ... you can make up names and numbers.

(2) Going Home - Low Level


Expand on your solution in question 1 by writing a more detailed pseudocode program that is between 15 and 25 lines long which explains (step by step) how you can get from this course's classroom to the front door of your house or apartment building. You will be marked on clarity, conciseness and grammar. You must make sure that your steps are expanded versions of your 5 steps from question 1. Group steps together somehow to show that they are expanded versions of the steps in question 1. Keep in mind that some steps from question 1 may expand further than others in terms of detail.

(3) Musical Chairs


Write a pseudocode program in the minimal amount of concise steps that describes how a single person will play a game of musical chairs from start to finish. The program should not assume a specific number of chairs or people playing. Rather, it is written from the point of view of how a single player would play the game. So you should not have steps for setting up the chairs, gathering players or getting them to some initial location, etc... Your code should start with the user waiting for the music to start. Remember, either the player continues to the end of the game (i.e., wins) or he/she loses along the way. You will be marked for accuracy, conciseness, clarity and grammar.

(4) Change Calculator


Write a pseudocode program that asks the user for a price of a product (between $0.01 and $5.00) and then computes the amount of change for a person, assuming that the person paid with a $5 bill and that there was no tax on the product. The change should consist of some number of toonies, loonies, quarters, dimes, nickels and pennies. Your solution must produce the minimum amount of coin.

NOTE: For each question, submit your solution as a simple .txt file. Submit your assignment using WebCT. Note that if your internet connection at home is down or does not work, we will not accept this as a reason for handing in an assignment late ... so make sure to submit the assignment WELL BEFORE it is due !

Please NOTE that you WILL lose marks on this assignment if any of your files are missing. You will also lose marks if your pseudocode is not written neatly with proper indentation. See examples in the notes for proper style.

Vous aimerez peut-être aussi