You are on page 1of 4

Republic of the Philippines

CAVITE STATE UNIVERSITY


Don Severino de las Alas Campus
Indang, Cavite
COLLEGE OF ENGINEERING AND INFORMATION TECHNOLOGY
Department of Information Technology

CPEN21 – PROGRAMMING LOGIC AND DESIGN


ACTIVITY NO. 6

Name PC no. Course Yr sec Date

Rubric for Grading

Criteria Advanced Proficiency Approaching Beginning Points


Proficiency
Program complies and Program complies and Program complies but Program does not
Syntax contains no evidence of free for major syntactic contains error that signal compile or (in dynamic
Ability to understand misunderstanding or misunderstandings but misunderstanding of language) contains
and follow the rules of misinterpreting the may contain non- systax – such as the typographical errors
the programming syntax of the language superfluous element. semicolon in if (exp) : leading to undefined
language (19-20pts) (13-18pts) (7-12pts) names
(0-6pts)
Program logic is on the Program contains some
Logic Program logic is correct, Program logic is mostly right track with no condition that specify
Ability to specify with no known boundary correct but may contain infinite loops, but shows the opposite of what is
condition, control flow, error, and no redundant an occasionally boundary no recognition of required(less than vs
and data structure that or contradictory error or redundant or boundary condition greater than), confuse
are appropriate for the conditions contradictory condition. (such as < vs <=) Boolean AND/OR
problem domain (19-20pts) (13-18pts) (7-12pts) operation or lead to
infinite loops
(0-6pts)
Program approaches
Correctness Program produces Program produces correct answers or Program does not
Ability to code correct answer or correct answers or appropriate results for produce correct
formulae and appropriate for all input appropriate result for most inputs, but can answers or appropriate
algorithms that reliably tested most inputs contains miscalculations results for most inputs
produce correct answer (19-20pts) (13-18pts) in some cases (0-6pts)
or appropriate result (7-12pts)

Program shows evidence Program shows some


Completeness Program shows evidence of case of analysis that is evidence of cases Program shows little
Ability to apply of excellent case analysis mostly complete, but analysis, but may be recognition of how
laborious case analysis and all possible cases are may have missed minor missing significant cases different cases must be
to the problem domain handled appropriate or unusual cases or mistaken in how to handle differently
(19-20pts) (13-18pts) handle some cases (0-6pts)
(7-12pts)
Program contains
Clarity appropriate Program contains some Program contains some
Ability to format and documentation for all documentation on major documentation (at least
document code for major functions, function variable or non- the student’s name and Program contains no
human consumption. variable, or non-trivial trivial algorithm, program’s purposed) but documentation or
algorithm. Formatting, indentation and other occasionally misleading glossy misleading
indentation and other formatting is appropriate indentation indentation
white space aids (13-18pts) (7-12pts) (0-6pts)
readability
(19-20pts)
Problem:

1. Obtain the following integer values from the user:


- the date broken down into month, day (2 variables)
- the current meter reading
- the previous meter reading

Calculate an electric bill based on the following rate & consumption table:
Kilowatt Consumption Cost
----------------------------- ---------------------------------------------
0 - 400 KWH a flat rate of pesos 8.50

401 – 1200 KWH pesos 8.50 (base rate) + 7.525 cents for each KWH over 400 (May –
Sept.) 6.575 cents for each KWH over 400 (all other months)

Over 1200 KWH calculate the first 1200 KWH according to the formula given above plus
5% of the appropriate seasonal rate for the KWH over 1200
NOTE: the program will not accept invalid date

Save as activity 6.1

2. The year is divided into four seasons: spring, summer, fall and winter. While the exact dates that the seasons
change vary a little bit from year to year because of the way that the calendar is constructed, we will use the
following dates for this exercise:

Create a program that reads a month and day from the user. The user will enter the name of the month as a
string, followed by the day within the month as an integer. Then your program should display the season
associated with the date that was entered.

NOTE: the program will not accept invalid date

Save as activity 6.2


Algorithm Flowchart
Program:

You might also like