Professional Documents
Culture Documents
Introduction:................................................................................................................................................3
Part 1:......................................................................................................................................................3
Section 1:.............................................................................................................................................3
Section 2:.............................................................................................................................................6
Section 3..............................................................................................................................................8
Part 2.....................................................................................................................................................10
Section 1:...........................................................................................................................................10
Section 2:...........................................................................................................................................15
Section 3:...........................................................................................................................................19
References:............................................................................................................................................19
Introduction:
Part 1:
Section 1:
Concept:
The C# code implements a console-based program using a while loop for iterative execution. It utilizes
user input for decimal values, employs conditional statements to check the range, and includes a switch
statement for additional range evaluation. Reference: Microsoft Docs on C#.
Pseudocode:
Initialize Loop:
User Input:
Check Range:
If yes, display a message indicating that the value is within the range.
If no, display a message indicating that the value is not within the range.
Utilize a switch statement to check the range again, with a default case for the out-of-
range scenario.
Continue Program:
Ask the user if they want to run the program again (Y or N).
If the response is affirmative, continue the loop; otherwise, exit the loop.
Flowchart:
Description:
The provided C# code implements a console program that repeatedly prompts the user to input a
decimal value. It checks if the input is within the range of 5.5 to 10.5 using both an if condition and a
switch statement. The program asks the user if they want to run it again, continuing the loop if the
response is affirmative. If the input is invalid, an appropriate message is displayed.
Code:
Screenshots:
Source:
Section 2:
Concept:
The C# code utilizes a while loop to repeatedly prompt the user for an integer between 1 and 100. It
employs a switch statement to determine a corresponding "pin" based on the entered number and
provides an option to continue the program. Reference: Microsoft Docs on C#.
Pseudocode
Initialize Loop:
User Input:
Switch Statement:
Using a switch statement, determine the "pin" number based on the user's input.
Continue Program:
Ask the user if they want to run the program again (Y or N).
If the response is affirmative, continue the loop; otherwise, exit the loop.
Flowchart:
Description:
The provided C# code implements a console program that repeatedly prompts the user to input an
integer between 1 and 100. It uses a switch statement to determine a corresponding "pin" based on the
entered number. The program asks the user if they want to run it again, continuing the loop if the
response is affirmative. If the input is invalid, an appropriate message is displayed.
Code:
Screenshots:
Source:
Section 3
Concept:
The C# code implements a console program that utilizes a while loop to repeatedly prompt the user for a
mark between 0 and 100. It employs a switch statement to determine the corresponding grade and
displays a message based on the entered mark. The program offers an option to continue.
Pseudocode:
Initialize Loop:
User Input:
Switch Statement:
Continue Program:
Ask the user if they want to run the program again (Y or N).
If the response is affirmative, continue the loop; otherwise, exit the loop.
Flowchart:
Description:
The provided C# code implements a console program that repeatedly prompts the user to input a mark
between 0 and 100. It uses a switch statement to determine the corresponding grade based on the
entered mark. The program asks the user if they want to run it again, continuing the loop if the response
is affirmative. If the input is invalid, an appropriate message is displayed.
Code:
Screenshots:
Source:
Part 2
Section 1:
Concept:
Pseudocode:
Concept:
The C# code consists of three forms for an Access Control System: Register, Login, and Dashboard. The
Register form allows users to register with a username and password. The Login form checks user
credentials against hardcoded values and opens the Dashboard form upon successful login.
Pseudocode:
Register Form:
If successful, show registration successful message, open Dashboard, and close Register window.
Login Form:
If successful, hide Login window, open Dashboard, and optionally close the application.
Dashboard Form:
Description:
The C# code comprises three forms for an Access Control System. The Register form allows users to
register, the Login form checks credentials against hardcoded values, and the Dashboard form displays a
welcome message and provides options to navigate or close the application. Flowcharts and pseudocode
illustrate the logic and interactions in each form.
Code:
Screenshots:
Source:
Section 2:
Concept:
The C# code represents a simple student record system using Windows Forms. It utilizes a ListView to
display student information, and users can add, update, and delete student records. The program also
calculates and displays grades based on student marks.
Pseudocode:
Initialize Form:
Initialize the form with necessary components (e.g., ListView, TextBoxes, Buttons).
In the Form_Load event, populate the ListView with sample student data.
Calculate Grade:
Flowchart:
Description:
The C# code implements a Windows Forms application for managing student records. Users can add,
update, and delete student records, and the program calculates and displays grades based on student
marks. The form is initialized with components, and sample data is loaded on form load. User
interactions trigger actions such as adding, updating, and deleting records, as well as calculating grades.
Error messages are displayed for invalid operations.
Code:
Screenshots:
Source:
Section 3:
Personal Reflection:
Pseudocode and Flowchart Design: Creating accurate pseudocode and flowcharts presented a challenge
in condensing complex logic into concise, comprehensible representations. It required careful
consideration of syntax and the identification of essential steps. Overcoming this difficulty enhanced my
ability to translate high-level program logic into visual representations.
Logical Program Structuring: The task emphasized the importance of logical program structuring and
documentation in C#. It highlighted the need for clear organization and flow, fostering a deeper
understanding of how to structure code effectively. This aspect aligns with broader learning outcomes,
reinforcing my commitment to producing well-documented and maintainable code in future projects.
References:
1. Title: "C# Programming Yellow Book" Author: Rob Miles Publication Year: 2014 Publisher:
Unknown (available online) URL: C# Programming Yellow Book
2. Title: "Microsoft Docs - C# Programming Guide" Author: Microsoft Publication Year: Ongoing
Publisher: Microsoft URL: C# Programming Guide
3. Title: "GPT-3: Language Models for Few-Shot Learning" Authors: OpenAI Publication Year: 2020
Publisher: OpenAI URL: arXiv:2005.14165
4. Title: "PlantUML - Unified Modeling Language" Author: PlantUML Publication Year: Ongoing
Publisher: PlantUML URL: PlantUML Official Website
5. Title: "Head First C#" Authors: Andrew Stellman, Jennifer Greene Publication Year: 2013
Publisher: O'Reilly Media ISBN-13: 978-1449343507
6. Title: "Windows Forms 2.0 Programming" Author: Chris Sells Publication Year: 2006 Publisher:
Addison-Wesley ISBN-13: 978-0321267962