Anne Dawson: CSCI120A_LAB4_SP05.htm   

 

Last updated: Wednesday 2nd February 2005, 7:33 PT

 

This document is subject to change without notice.

 

Please report any errors or omissions in this document:

adawson@coquitlamcollege.com

 

Special instructions:

 

For this lab assignment you must work alone.

This is a timed and assessed lab (30 minutes allowed).

 

You may not request instructor assistance for assessed labs.

 

Lab 4 must be saved to your folder in

\Week05\lab4 at 10:40am prompt.

 

Quiz 1 starts at 10:50am prompt.

Duration of Quiz 1 is 45 minutes.

 

CSCI120A

 

Introduction to Computer Science and Programming

Spring 2005

Lab Assignment 4

Printing out the times tables

Time allowed: 30 minutes

For this lab only, you do not need to supply an algorithm or pseudocode. Complete as much as you can of the program.

 

Specification:

 

Your program asks the user for a number for which the times tables will be displayed.  For example, if they enter the number 6, the following table is displayed:

 

1 x 6 = 6

2 x 6 = 12

3 x 6 = 18

4 x 6 = 24

5 x 6 = 30

6 x 6 = 36

7 x 6 = 42

8 x 6 = 48

9 x 6 = 54

10 x 6 = 60

 

After displaying the times table, the program should ask the user if they want to display another times table. The program continues as long as the user requests another table. Use a for loop to print the table and a while loop to repeat the program. See the powerpoint on repetition for example programs using while loops and for loops.

 

Implement your program in the Python language. Use the IDLE GUI to edit and run your program:

http://www.coquitlamcollege.com/adawson/Python_Editor_IDLE.htm

 

Your program should start with a comment block that contains the following information:

 

#  File:       lab4.py

#  Purpose:    The times tables

#  Programmer: [your name]   

#  Course:     CSCI120A

#  Date:       Wednesday 2nd February 2005

 

At or before 10:40am, save your program file (lab4.py) to your folder on the network in:

 

CSCI120A\Week05\Lab04

 

Quiz 1 starts at 10:50 prompt when the Lab 4 folder will be locked.

Program points will be based on the following marking scheme:

Marking Scheme: CSCI120A   -  Assessed  Lab - Lab 4  -   Times Tables

Student name:

Category

Points

Description

Comments

15

The program is commented appropriately.

Style

15

The source code should use meaningful variable names (identifiers).

Output

15

Screen prompts and results should be user-friendly.

while loop

15

Implemented correctly.

for loop

15

Implemented correctly.

Correctness

15

The program should output correct results.

Completeness

10

The program should be complete.

 

 

Assignment Presentations :  In the next class, a random selection of lab assignment programs will be presented to the CSCI120A group.