Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CS111 Lab Test 1 (5%)

Time Limit: 1 hour


Submission: Be sure you submit .cpp files only. Name your program file as LabTest1_YourIdNumber.cpp,
where YourIdNumber is your student id number (e.g. LabTest1_S01234561.cpp). Do not submit the .exe
executable versions of your program

This test requires you to implement the task given below as a C++ program.

As the programmer, you are asked to develop a program which allows the user to enter two readings in
the range 0 to 10. The readings are for temperature inside side a house and outside a house. The
program determines the lower of the two readings. The lower temperature is then used to display a
message indicating the action to be performed based on the following table:

You have to apply all the programming constructs that you have learned so far, as needed, to complete
this exercise. (decisions, loops, input validation)

Sample Run 1:
Enter reading 1: 8
Enter reading 2: 3
Wait for 10 minutes then increase heat
Program Marking Rubric
Exceptional Acceptable Amateur Unsatisfactory

Documentation The code is well Comments describe There is visible There are no comments,
documented. Comment most components, attempt to comment or poor comment; out -
(5 Marks) describes the main variables and all components and dated, irrelevant, or
components, variables, functions. Some functions. However, cryptic
functions. Comments comments might be some comments
are used to describe the dated; most might be outdated,
structure. The comment may make or only relevant to
comments are up to sense to someone someone familiar with
date. The comments unfamiliar with code the code
are relevant, and
make sense to
someone unfamiliar
with the code
(5 Marks) (3 Marks) (2 Marks) (0 Marks)

Programming The code uses layout to The layout of the The layout of the The layout of the program
Style convey the structure of program makes it program makes it is coincidental, and
the program clearly. possible to identify the possible to identify makes it difficult to
(5 Marks) Different components structure of the the structure of the identify the structure of
are easily recognized. program. Names are program with some the program. Names
Name are by meaningful in the effort. Names make are cryptic. No discernible
themselves meaningful context of the sense to a person effort was made to
if they refer to the problem. The code familiar with the adhere to common coding
specific problem and adheres to general problem. The code practices. The output
generic if they refer to good makes adheres to contains spelling
part of the code that is coding practices, and some good practices, mistakes, and does not
reusable. The code the but ignores others. make an effort to ensure
adheres to the given output is spelled Some minor spelling proper formatting
coding guideline. All correctly with only mistakes, or mistakes
output is spelt correctly minor in layout
with a proper layout. glitches in layout

(5 Marks) (3 Marks) (2 Marks) (0 Marks)


Semantics The program uses The program uses The program works The program has
the programming most constructs most of the times several minor run time
(5 Marks) construct correctly and correctly and as correctly given some errors, like use of
competently. The intended, and is only implicit assumptions uninitialized variables, or
program does avoid sometimes overly about its use. The one or more fatal run
programming short complicated. It may program uses time errors. It uses
cuts, and does not contain constructs differently programming constructs
abuse syntax. There a few minor semantic from their intended with no regard for their
are no superfluous errors, such as dead use. There may be a semantics or intended
statements or code, few run time errors use
conditions, no dead or unused variables, that manifest
code, no unused but themselves for
variables, no nothing that would unusual input or for
uninitialized variables, cause certain compilers
no potential division by a run-time error
zero or other run-time
error
(5 Marks) (3 Marks) (2 Marks) (0 Marks)

There was nothing


Functional The program satisfies The program satisfies The program satisfies The program does not substantial
Correctness all requirements and the requirements the core satisfy core requirements. submitted to award
produces the correct almost completely, requirements. Some It is easy to find any marks
(10 Marks) behavior for all possible and produces the requirements might examples where the
legal input. It handles correct answer for not be addressed. It program computes the
incorrect input and all obvious legal input. produces the correct wrong result. The
responds adequately It handles all output for obvious program does fail for
incorrect legal input unexpected input
Input without fatal
failures
(10 Marks) (8 Marks) (6 Marks) (4 Marks) (0 Marks)

You might also like