Anne Dawson: CSCI120A_LAB4A_FA08.htm   

 

Last updated: Monday 29th September 2008, 10:58 PT

 

This document is subject to change without notice.

 

Please report any errors or omissions in this document:

adawson@coquitlamcollege.com

 

Special instructions:

 

To avoid losing participation points, please save your Lab 4A file as yourstudentnumber.py to:

CSCI on Pineapple\AnneDawson

\CSCI120A\Week04\lab4A before the start of the next class.

 

 

CSCI120A

 

Introduction to Computer Science and Programming

Fall 2008

Lab Assignment 4A

Printing out the times tables

For this lab only, you do not need to supply an algorithm. 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.annedawson.net/Python_Editor_IDLE.htm

 

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

 

#  File:       yourstudentnumber.py

#  Purpose:    The times tables

#  Programmer: [your name]   

#  Course:     CSCI120A

#  Date:       Monday 29th September 2008

 

Before the start of the next class, save your program file (yourstudentnumber.py) to the following network:

 

CSCI120A\Week04\Lab4A

 

THIS LAB IS NOT MARKED.

The following marking scheme is for guidance only:

Marking Scheme: CSCI120A   - Lab 4A  -   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.