Ppc125c Lab Test 2023
Ppc125c Lab Test 2023
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!
cenario: Eskom has requested that each municipality report on the number of
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.
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 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.
For backup purposes please copy your code and paste it in the Comments
section before submitting and then submit.
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
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.
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
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