0% found this document useful (0 votes)
66 views2 pages

Object-Oriented Programming - 1 Sem SY 2021-2022 Activity 2: Applying Control Structures Competencies Measured

The document provides instructions for an activity on applying control structures in object-oriented programming. Students must create programs that use switch statements to check if a number is odd, even, positive, negative or zero, and use iteration to reverse and sum numbers from 1 to a user-input value. Submissions are due by a specified deadline and will be evaluated on programming concepts like syntax, logic, correctness, completeness, clarity and modularity. Late submissions receive reduced points.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views2 pages

Object-Oriented Programming - 1 Sem SY 2021-2022 Activity 2: Applying Control Structures Competencies Measured

The document provides instructions for an activity on applying control structures in object-oriented programming. Students must create programs that use switch statements to check if a number is odd, even, positive, negative or zero, and use iteration to reverse and sum numbers from 1 to a user-input value. Submissions are due by a specified deadline and will be evaluated on programming concepts like syntax, logic, correctness, completeness, clarity and modularity. Late submissions receive reduced points.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Object-Oriented Programming – 1st Sem SY 2021-2022

Activity 2: Applying Control Structures

Competencies measured:
At the end of this activity, the students are able to:
a. apply concepts of BufferedReader or JOptionPane class.
b. analyze, design, and develop an algorithm/flowchart to solve given problem.
c. implement, test, and debug an algorithm to solve a given problem.

Submission Instructions:
a. For mobile phone users, make a recording of the final program for the problem given. It
shall include the starting clear code, to testing the code and sample output.
b. For desktop or laptop users, send the file (.java, .class) in the specified submission bin.
c. As much as possible, do not put in folder, only your final file added in the submission
bin.

Rubrics for checking:


Program Excellent Good Fair Poor

Syntax Program compiles and Program compiles and Program compiles, but Program does not
Ability to understand contains no evidence of is free from major contains errors that compile or (in a dynamic
and follow the rules misunderstanding or syntactic signal misunderstanding language) contains
of the programming misinterpreting the syntax misunderstandings, of syntax – such as the typographical errors
language. of the language. but may contain non- semi-colon in if(exp);{} leading to undefined
5 points standard usage or 2 points names.
superfluous elements. 1 point
4 points
Logic Program logic is correct, Program logic is Program logic is on the Program contains some
Ability to specify with no known boundary mostly correct, but right track with no conditions that specify
conditions, control errors, and no redundant may contain an infinite loops, but shows the opposite of what is
flow, and data or contradictory occasional boundary no recognition of required (less than vs.
structures that are conditions. error or redundant or boundary conditions greater than), confuse
appropriate for the contradictory (such as < vs. <=) Boolean AND/OR
problem domain. 5 points condition. 4 points 3 points operators, or lead to
infinite loops
2 points
Correctness Ability Program produces correct Program produces Program approaches Program does not
to code formulae answers or appropriate correct answers or correct answers or produce correct answers
and algorithms that results for all inputs appropriate results for appropriate results for or appropriate results for
reliably produce tested. most inputs. 4 points most inputs, but can most inputs.
correct answers or contain miscalculations 1 point
appropriate results. 5 points in some cases.
2 points
Completeness Program shows evidence Program shows Program shows some Program shows little
Ability to apply of excellent case analysis, evidence of case evidence of case recognition of how
rigorous case and all possible cases are analysis that is mostly analysis, but may be different cases must be
analysis to the handled appropriately. complete, but may missing significant cases handled differently.
problem domain. have missed minor or or mistaken in how to 2 points
5 points unusual cases. 4 handle some cases.
points 3 points
Clarity Program contains Program contains Program contains some Program contains no
Ability to format and appropriate documentation some documentation documentation (at least documentation, or
document code for for all major functions, on major functions, the student’s name and grossly misleading
human variables, or non-trivial variables, or non- program’s purpose), but indentation.
consumption. algorithms. Formatting, trivial algorithms. has occasionally 1 point
indentation, and other Indentation and other misleading indentation.
white space aids formatting is 2 points
readability. appropriate. 4 points
5 points

Prepared: BILLY S. JAVIER


Subject Teacher
Object-Oriented Programming – 1st Sem SY 2021-2022
Activity 2: Applying Control Structures
Modularity Program is decomposed Program is Program is decomposed Program is one big
Ability to into coherent and reusable decomposed into into units of appropriate function or is
decompose a units, and unnecessary coherent units, but size, but they lack decomposed in ways
problem into repetition has been may still contain coherence or reusability. that make little sense.
coherent and eliminated some unnecessary Program contains 2 points
reusable functions, 5 points repetition. 4 points unnecessary repetition
files, classes, or 3 points
objects (as
appropriate for the
programming
language and
platform).
Maximum points 30 24 15 9
Timeliness + 5 points 1 hour before + 3 exactly beating
deadline the deadline

Task 1: Decision Control Structures


Using a switch structure, define a class named ifswitchOddEven to check whether or not an
inputted number, either integer, float, and double. The program checks and displays whether
the inputted number is Odd Number, Even Number, Positive, Negative, or Zero.

Task 2: Iteration Structures


Define a class reverseSum that prompts a user a positive integer (n) greater than 10000. The
program shall read the input as integer, and print the reverse of the number as well as the sum
of the numbers from 1 through n.

For instance,
Enter a positive integer (>10000): 12345
The reverse of the number is: 54321
The sum of the numbers is: 1475412681

Prepared: BILLY S. JAVIER


Subject Teacher

You might also like