Anne Dawson: CSCI110A_HW2_SP04.htm

 

First created: Thursday 29th January 2004, 6:53 PT, AHD

 

This document is subject to change without notice.

 

Please report any errors or omissions in this document:

adawson@coquitlamcollege.com

 

 

For due date, see course schedule.

 

Special instructions:  Each student must complete this homework.

 

CSCI110A Homework 2

-------------------

 

Specification:

-------------

 

The area of a triangle can be computed using the formula:

 

area = Ö (s(s-a)(s-b)(s-c))

 

where a, b and c are the lengths of the sides, and s is the

semiperimeter:

 

s = (a + b + c) / 2

 

Write a VB program with a function that uses four parameters

(a, b, c, s) and computes the area. a, b, and c are entered in

text boxes. s is also calculated using a function with 3 parameters

for a, b and c.

 

Produce an error message in a message box for illegal combinations

of sides; for example if any side is 0 or negative.

For legal triangles the following rules apply:

 

a < (b + c)

b < (c + a)

c < (a + b)

 

 

Marking Scheme :

--------------

 

The following marking scheme applies:

 

Course Code:             CSCI110A

Semester:                SP04

Assignment Code:         HW2

Lab Specification:       Area of triangle

Instructor Name:         Dr Anne Dawson

 

Student Name:

Student Number:

 

DESIGN

 

 

1.  Appropriate data types are used.                     /10

 

2.  Appropriate control structures are used

    (i.e. loops and decisions).                          /10

 

3.  The User Interface (output to the screen) is

    clear and tidy.                                      /10

 

MAINTAINABILITY

 

4.  The program is commented appropriately - including

    programmer name, date and filename.                  /10

 

5.  The program has meaningful identifiers.              /10

 

6.  The program is indented (spaced out) correctly, to

    aid the understanding of the code.                   /10

 

7.  The code is easy to follow.                          /10

 

CORRECTNESS:

 

8.  The program contains zero errors                     /10

 

9.  Appropriate test data and results

    are shown in the comments at the top of the code.

    An appropriate number and variety of test data

    sets is supplied.                                    /10

 

10. The program is complete.                             /10

                           

 

                                               Total:   /100

                                     

                                    Date: