PPC125C Practice Lab Test
PPC125C Practice Lab Test
STATIONERY:
1. Lab PC or your own Laptop (BHP222, BHP224 and BHP225)
2. Visual Studio 2022
3. Practical Notes
4. Ethuto to submit zipped program
INSTRUCTIONS TO CANDIDATES:
1. Download the Practice Test template from Ethuto as instructed.
2. Add your Initials and Surname and Student number to the comments of your program
3. Code the program as described below, and Comments are optional
4. Only Edit code where stated ///STUDENT TO CODE and also bookmarks has been put in the code
for easy reference:
Scenario: You were asked to write an ITS program that would capture student details (Student
Number, Name, Surname, final mark) for any subject where there is up to 150 students max.
This program will be used by all the lecturers in SA. The program that you will develop will be
able to do the following:
1. Capture marks
2. ITS Report
3. Exit Program
The Capture Marks as Menu Number 1 (One) The program will capture the marks for a
subject where there could be a max of 5 students (Student Number, Name, Surname, final
mark – Parallel arrays). The user will indicate how many students there are in the class and
then capture the final marks. The system must be able to capture at least 5 students’ records
details and marks, and the user must be able to choose after each capture if they would like
to capture another record or not. If not return to Main Menu.
Menu Number 2 (Two) will create the ITS report where student data will be displayed with
their marks. At the end of the Report the following will be indicated:
• Amount Passed.
• Amount Failed.
• Average Final Mark.
Program Specifics:
• // Add your Initials + Surname, Student Number as comments at the beginning of your
program (Just before the Namespace)
• See Appendix A for Methods and given code to be used in your program and see Appendix
B for recommended Screen Outputs. Note Code Template will also be on ethuto where given
code is already available in a project. Just add your code needed. Download the zip file and
extra to Desktop
APPENDIX A
METHODS TO COMPLETE & PARTIAL TO BE CODED ALSO:
//Global Variables
static int menuOption;
static string captureMarks;
static int passed = 0;
static int failed = 0;
static double totalMarks = 0, avgMark = 0;
//Global Arrays
static string[] studNumber = new string[5];
static string[] studName = new string[5];
static string[] studSurname = new string[5];
static double[] studfinalMark = new double[5];
//Check that user only enters a number between 1 and 3, else repeat.
///STUDENT TO CODE
case 2: //Menu Nr 2
if (studNumber[0] == null || studNumber[0] == "")
{
Console.WriteLine("Note NO data has been captured!!");
Console.WriteLine("The program will return to Main Menu. Press any Key...");
Console.ReadKey();
Menu();
}
else
{
Console.Clear();
ITSmarkReport(); //Call ITSmarksReport Method - Menu nr 3 option
//Code to run after above method is done:
Console.WriteLine("Press any key to return to the Main Menu");
Console.ReadKey();
Menu();
}
break;
case 3: //Menu Nr 3
Exit(); //Call Exit Method
break;
default:
Console.WriteLine("A critical Error has occurred. Press any key to exit program...");
break;
}
}
//If user enters Yes, data can now be captured from the InputData Method.
if (captureMarks == "Yes")
{
InputData();
}
}
//Reading in data as long as the array has space (Index 0 - 4 = 5 elements and as long as the user indicates Yes!
while (counter < 5 && captureMarks == "Yes")
{
//Read Student Number
Console.WriteLine("Please enter Student Number to save:");
///STUDENT TO CODE
//Keep a counting record after data has been captured if the student passed or not.
if (studfinalMark[counter] >= 50)
{
passed++; //Add one to total of passed. To be printed in ITS Report in Menu Nr2
}
else
{
failed++; //Add one to total of failed. To be printed in ITS Report in Menu Nr2
}
//Adding each student's final mark together to calculate the average mark later.
totalMarks = totalMarks + studfinalMark[counter];
//ANOTHER WAY TO DO THE ABOVE CALC using the += operator: totalMarks += studfinalMark[counter];
//Inform the user that the data has been captured for this student.
Console.WriteLine("DATA FOR THIS STUDENT HAS BEEN CAPTURED!");
Menu Nr 1:
If the user indicates no then the program will return to the Main Menu:
Menu Nr 2: (If the user did not enter any records and immediately used Menu nr 2):
Menu Nr 3:
MARKING RUBRIC – Student Initials & Surname: ____________________ Student Nr: ____________________
Menu Nr Functionality of Program to be tested MARK %
1 Program prompts user if they want to capture a record and if YES is provided a record is captured and after first record the user
is asked again and with a NO the program returns to the Main Menu. _______40%
2 If No records exist, the program will provide this error message and return to the Main Menu. If at least the first record exists,
then the IT Report will print, and other records will be indicated empty with a 0 final mark. _______40%
3 Program exit correctly
______/20%
TOTAL
TOTAL: ______%