0% found this document useful (0 votes)
114 views4 pages

Lab Task 3-Question

The document provides instructions for a lab task on programming fundamentals. Students are asked to write a C++ program to identify candidates for a youth development program based on vote counts. The program should allow input of candidate details, identify the highest voted candidate, and display the results. Rubric criteria include properly declaring variables, using suitable control structures, readability, and obtaining the correct output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views4 pages

Lab Task 3-Question

The document provides instructions for a lab task on programming fundamentals. Students are asked to write a C++ program to identify candidates for a youth development program based on vote counts. The program should allow input of candidate details, identify the highest voted candidate, and display the results. Rubric criteria include properly declaring variables, using suitable control structures, readability, and obtaining the correct output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NAME

REGISTRATION NO MARKS
DATE
CLASS
CODE/SUBJECT DFC20113 - PROGRAMMING

LAB TASK
FUNDAMENTALS
3
100
LECTURER

CLO 2: Show simple programs by developing code to solve problems in a computer using
C++ programming language. (P2, PLO 3)

TOPIC: 3.2 SHOW PROBLEM USING SELECTION CONTROL STRUCTURES


3.3 SHOW PROBLEMS USING LOOPS CONTROL STRUCTURES

DURATION: 2 HOURS
INSTRUCTION: ANSWER ALL THE QUESTIONS

QUESTION 1

i. Write a complete C ++ program to identify YDP candidates in the PMJ campus selection
based on the highest number of votes. (CLO2, P2)

To do that, you may need to follow these steps:


a. Create variables.
b. Declare each variable with the most suitable data type.
c. Initialize variable with initial value if applicable.
d. Write output statement to display title as in Figure 1.

Figure 1

e. Using for loop statement, this program should be able to:


• Allow user to enter total number of candidates.
• Allow users to enter other appropriate inputs such as candidate name,
department and number of votes.
f. Using if..else statement, this program should be able to:
• Display "Invalid number" message when user key in integer less than or
equal to 0 for number of candidates. Sample output as in Figure 2.
• Identify the candidates with the highest number of votes and eligible for title
YDP in the MPP committee.

Figure 2

g. Using do..while statement, allow user to enter the "Y" or “y” character to continue.
Otherwise, the program will be terminated.

ii. Execute the program. (CLO2, P1)

iii. Fix any error if occurred. Final output should be same as in Figure 3 (CL02, P2)
Figure 3
NAME
REGISTRATION NO MARKS
DATE
CLASS
CODE/SUBJECT DFC20113 – PROGRAMMING FUNDAMENTALS
LAB TASK 3 /100
LECTURER
RUBRIC LABORATORY TASK 3

Performance ADVANCED INTERMEDIATE BEGINNER WEAK


Weightage Score
Area 4 3 2 1

All variables are named with Able to declare variables and most Able to declare variables and some Able to declare variables but all
Declare
descriptive names and using the of variables using descriptive of variables using descriptive variable names are cryptic and 10
Variable (P)
most suitable data types. names and suitable data types. names and suitable data types. using incorrect data types.

Student able to write all the input Student able to write most the Student able to write some the Student able to write a few input
Input & Output & output statements given and input & output statements based input & output statements based & output statements but not
use correct symbol based on the on the scenario given and use on the scenario given but not in based on scenario given. 20
Statement (P)
scenario. correct symbol. correct symbol.

Selection Students able to write code and Students able to write most of the
Students able to write some the Students able to write some the
Control use the correct selection control selection control structures but
selection control structures with selection control structures with 25
Structures structures and clearly solves does not derive a solution to the
minor errors. major errors.
(P) the problem. problem.

Students able to write most of the Students able to write some the Students able to write some the
Loops Control Students able to write code use
loop control structures but does loop control structures with minor loop control structures with major
Structures the correct loop control structures 25
not derive a solution to the errors. errors.
(P) and clearly solves the problem.
problem.

Code The code is exceptionally well The code is easy to be read. The code is readable only by The code is poorly organized and
Readability organized, very easy to follow and someone who knows what it is very difficult to read.
10
and Comment include a few comments. supposed to be doing.
(P)
Able to compile and execute the Able to compile and execute the Able to compile the program with Able to compile the program with
Program
program with expected output programs with unexpected output. minor errors. major errors.
Compilation
and based on the scenario. 10
and
Execution (P)

TOTAL 100% / 100

*Zero (0) mark will be given if students do not answer / perform the criteria needed.

You might also like