0% found this document useful (0 votes)
12 views6 pages

Ppc125c Lab Test 2023

This is a test for programming for the year 2023 for first year students.

Uploaded by

kkgwebdesign
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)
12 views6 pages

Ppc125c Lab Test 2023

This is a test for programming for the year 2023 for first year students.

Uploaded by

kkgwebdesign
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/ 6

Page 1 of 6

Extended Curriculum Programme (ECP)

PRACTICAL LAB TEST – PPC125C 2023 (Counts 15%)

DATE: 30 August 2023 TIME: 12:30 – 14:30


SUBJECT: Programming Principles 1B CODE: PPC125C

ECP DIPLOMA IN INFORMATION TECHNOLOGY EX_ITC


ECP DIPLOMA IN COMPUTER NETWORKING EX_CMN

STATIONERY:
1. LAB Computer (BHP222 / 224 / 225)
2. May use Practical Notes
3. Visual Studio 2022

INSTRUCTIONS TO CANDIDATES:
1. Develop your program only in C# (Preferably VS2022)
2. Create a folder, name it your student number and create a Console App (.Net Framework)
in this folder.
3. Add the following Comments in your program before namespace: Initials & Surname and
Student number.
4. Make use of Global Variables, Methods and Ifs, loop where needed. Make sure your
program is a structured program (Break program up into methods and reuse methods).
5. Make sure your program compiles without errors and submit the complete program with
all files in folders as one Zip file on ethuto BEFORE THE TIME EXPIRES!

ASSESSOR: Mr. AD van der Walt & Mr E Mokoduwe


MODERATOR: Mr. P Kruger

Duration of LAB TEST: 2 hours (including submitting) Total marks: 30

Assessor’s Signature Moderator’s Signature


Page 2 of 6

LAB TEST PPC125C 30 Aug - Scenario Instructions [30]

cenario: Eskom has requested that each municipality report on the number of

S instances of loadshedding stages 1 to 2 experienced in a certain month. Municipalities


have resolved to query this information from ward councillors per area, who will
provide a report for a specific month on how many stages 1 to 2 loadshedding were
implemented. To ensure accuracy and consistency, five (5) random citizens in a specific ward
area will participate and provide input on how many times a certain stage of loadshedding was
experienced for that month.

The ward councillors have reached out to you to write a C# Console program that will capture
five (5) inputs for each stage for that ward area from the five (5) random citizens. The program
only needs to capture one ward area for the municipality as each ward councillor will use a
copy of your program. To ensure consistency, an average will be calculated for the five (5)
inputs for each stage of loadshedding received from the five (5) citizens in the ward. The
program will thus run five (5) inputs for each stage 1 to 2 of loadshedding.

The program will start with a Main Menu where the user can choose menu number 1 to capture
the needed data. After capturing the data, the user will be prompted to press any key before
the report is printed on a new clear Console Screen window. If the user enters menu number
2, the program will exit.

THE CLIENT REQUIRES SOFTWARE THAT CAN PERFORM THE FOLLOWING


FUNCTIONS:
 The program will start with a basic menu where the user can enter 1 or 2.
 The input for this menu number must be validated as only 1 or 2 is valid. If the user
enters an invalid number, they will be re-prompted to enter the correct menu number.
(a while loop will check the validation) Only when the input is correct can a switch
statement be used to check for 1 and call a method for menu number 1 and the same
for menu number 2.

Assessor’s Signature Moderator’s Signature


Page 3 of 6

 If the user indicates menu number 1, the program will start capturing five (5) sets of
input from citizens for each stage. (for loops will be used)
 When all data has been captured, a key press will be requested to print the Ward Area
Load Shedding Report on a clean new Console screen which will contains the Month
name, Ward name and averages for each stage that was calculated. (Reminder as data
is received for a specific stage, the inputs will accumulate and then be divided by the
number of inputs to have the average that will be printed in the report for a specific stage
of loadshedding.)
 The user will then be able to press any key to return to the Main Menu when the report
was printed.
 When the user returns to the Main Menu on a clean new Console screen, they can
decide to run the program again with Menu Number 1 or press Number 2 to exit the
program.

Program Specifics:
 // Add your Initials + Surname, Student Number as comments at the beginning of your
program (Just before the Namespace)
✓ Make use of global variables and methods.

✓ for Loops and while Loop must be used, as indicated but any can be used IF NOT specified.

✓ Make sure that there is an appropriate Menu heading for each option of the program interface
that will be displayed.
✓ VALIDATION IS VERY important. The Menu Nr must be validated and only 1 or 2 is valid.
(while loop to be used)
✓ Print each of the four (4) different parts of the program on a new screen. (Console.Clear)

MAKE SURE YOU HAVE READ THE INSTRUCTIONS on ALL pages. A


suggested draft design of the program to guide you to develop a small
interface can be found on the Annexure on the last page.

Assessor’s Signature Moderator’s Signature


Page 4 of 6

MAKE SURE THAT YOUR PROGRAM COMPILES AND HAS NO ERRORS WHEN
SUBMITTING, EVEN IF YOUR PROGRAM IS NOT YET FINISHED AND TIME RUNS
OUT, MAKE SURE THAT THE PROGRAM COMPILES!!! A program that gives
compile errors when marking, will receive a 0% because it cannot be evaluated.
Without a functioning program, no output can be generated or assessed.

THE PROGRAM FOLDER MUST BE ZIPPED AND UPLOADED.

For backup purposes please copy your code and paste it in the Comments
section before submitting and then submit.

Assessor’s Signature Moderator’s Signature


Page 5 of 6

ANNEXURE

MAIN MENU and validate input from the user (USE WHILE LOOP) where only 1 or 2 is correct
inputs and when verified a switch statement route the program to capture data.
MAIN MENU – Loadshedding ward area calculator

1) Capture loadshedding data from users.


2) Exit Program

CAPTURE DATA (input month & ward name. USE FOR LOOPS to capture data for stage 1 & 2):
CAPTURE DATA – Loadshedding ward area calculator
Month Name:
Ward Name:

Stage 1: (Tip a Stage 1 Acounter1 will be used to accumulate the inputs and then be divide by 5 for average)
Enter the number of loadshedding stage 1 – citizen 1:
Enter the number of loadshedding stage 1 – citizen 2:
Enter the number of loadshedding stage 1 – citizen 3:
Enter the number of loadshedding stage 1 – citizen 4:
Enter the number of loadshedding stage 1 – citizen 5:

Stage 2: (Tip a Stage 2 Acounter2 will be used to accumulate the inputs and then be divide by 5 for average)
Enter the number of loadshedding stage 2 – citizen 1:
Enter the number of loadshedding stage 2 – citizen 2:
Enter the number of loadshedding stage 2 – citizen 3:
Enter the number of loadshedding stage 2 – citizen 4:
Enter the number of loadshedding stage 2 – citizen 5:

All data has been captured. Press any key to Print Report…

Remember that for each stage, an extra counting variable (accumulator) will be used to accumulate
the five (5) user inputs for that stage. This variable will be divided by the number of inputs (5) to get
the average for that stage for the report screen.

Assessor’s Signature Moderator’s Signature


Page 6 of 6

REPORT (Clear screen and use and print data captured to averages)
REPORT – Loadshedding ward area calculator
Month Name:
Ward Name:
Stage 1 average occurrences:
Stage 2 average occurrences:
END OF REPORT

Return to Main Menu with a key press…

EXIT THE PROGRAM (Menu Nr 2)


Exit Program – Loadshedding ward area calculator

Thank you for using our program. Press any key to exit the program.

MARKING RUBRIC
PROGRAM PART FUNCTIONALITY TESTED MARK
Test the user input for Main Menu if an invalid menu nr While loop and ranges. 10
was entered where only 1 or 2 is valid
Capture two sets of data by making use of for loops For Loops and the understanding 10
and use two global variables to accumulate the two of Accumulators (where a variable
inputs for each stage data provided by the users. Then value increases with each input)
calculate the average.
Report Printed Correctly with Month, Ward name and Correctness of calculations and 5
average for Stage 1 and Stage 2 Loadshedding providing the correct output
Menu Nr 2 to exit the program correctly Nr 2 in the Switch Statement 5
trigger last method to exit program
TOTAL: 30

END OF PAPER
TOTAL MARKS = 30

Assessor’s Signature Moderator’s Signature

You might also like