Assignment 2 - 1618 C# Programming, Assignments of Computer Science

This assignment got Pass grade. Hopefully, it will help u!

Typology: Assignments

2021/2022

Uploaded on 09/16/2023

ecco3kdaddy
ecco3kdaddy 🇻🇳

6 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 2 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 1: Programming
Submission date
Date Received 1st submission
Re-submission Date
Date Received 2nd submission
Student Name
Student ID
Class
Assessor name
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P2
P3
P4
P5
M2
M3
M4
D2
D3
D4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Assignment 2 - 1618 C# Programming and more Assignments Computer Science in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

    1. Introduce the Overview Chapter 1 – Introduction your program 5 s
    1. List out application’s requirements
  • Chapter 2 – Explain programming paradigms................................................................................................
      1. Explain what is Procedural programming with source code and illustrations
      1. Explain what is Object-Oriented Programming with source code and illustrations
      1. Explain what is Event-Driven programming with source code and illustrations
      1. Conclude which paradigms will be used to develop the application with explanation
  • Chapter 3 – IDE Features
      1. Introduce what is IDE
      1. Introduce features of IDE with illustrations
    • development 3. An explanation and evaluation of debugging process in the IDE used and how it helped with
      1. Evidence that you have used debugging during the implementation
    • using an IDE 5. An evaluation of developing applications using an IDE versus developing an application without
  • Chapter 4 – Design and Implementation
      1. Flowchart of the application
      1. Source code and screenshots of the final application with explanation
      1. Explain and evaluate coding standards used in the program
      1. Explain the benefits of using coding standards
  • References
  • Figure 1: The characteristic of OOP Table of figures
  • Figure 2: The comparison between Procedural Programming and Object-Oriented Programming (OOP)...
  • Figure 3: Visual Studio
  • Figure 4: Start Debugging
  • Figure 5: Input choice from the Console Window
  • Figure 6: Program in the debugging mode
  • Figure 7: Run to cursor
  • Figure 8: Edit the code while the program is running
  • Figure 9: Call Stack Window
  • Figure 10: Using IDE (VS) to write code
  • Figure 11: Using Microsoft Word to write code
  • Figure 12: Main menu system
  • Figure 13: Search book function
  • Figure 14:Main menu hub
  • Figure 15: Add Book
  • Figure 16: Display
  • Figure 17: Sort book through year................................................................................................................
  • Figure 18: Search book in name of the book
  • Figure 19: Search book in name of the author

Chapter 1 – Introduction your program

1. Introduce the Overview

➢ In this assignment, I would like to write a program about the general system of the book management system. The system includes types, such as adding books, displaying the data on the screen, sorting, and searching for books users want to find. The Internet nowadays is very developed, and so is the book management system. Instead of entering the information on paper, the users can enter it on the computer. This method is the best choice because it’s fast and effective.

2. List out application’s requirements

➢ Well, to the system management operations, it needs some following requirements:

  • There are functions: Add, display, sort, and search.
  • The program needs to run on Console App (C#) in Microsoft Visual Studio 2022.
  • The system must have a Main Menu that users can operate types.
  • Check if the users inputted the data is missing or not.

Chapter 2 – Explain programming paradigms

1. Explain what is Procedural programming with source code and illustrations

Definition:

Procedural programming Could also be the primary programming paradigm that a replacement developer will learn. Fundamentally, the procedural code is that the one that directly instructs a tool on the way to finish a task in logical steps. This paradigm uses a linear top-down approach and treats data and procedures as two different entities. supported the concept of a procedure call, Procedural Programming divides the program into procedures, which also are referred to as routines or functions, simply containing a series of steps to be administered. Simply put, Procedural Programming involves writing down an inventory of instructions to inform the pc what it should do step-by-step to end the task at hand.

The Key Features of Procedural Programming:

➢ The key features of procedural programming are given below:

  • Predefined functions: A predefined function is usually an instruction identified by a reputation. Usually, the predefined functions are built into higher-level programming languages, but they’re
  • The importance is given to the operation instead of the information, which could pose issues in some data-sensitive cases.
  • The info is exposed to the entire program, making it not such a lot security friendly.

2. Explain what is Object-Oriented Programming with source code and

illustrations

Definition:

➢ OOP is a programming style that understands life as a collection of objects that work together to solve a specific problem. The most important aspect of OOP is encapsulation, which is the concept that each object that holds the program is self-sustaining, meaning that all of the components that make up the object are contained inside it. Now that each module in this paradigm is self-sustaining, items from one program may be taken and utilized to address another problem with little or no changes.

Advantages:

  • OOP is easy to maintain because of its modularity and encapsulation.
  • OOP simulates the real world, making it simpler to comprehend.
  • Because objects are complete in and of themselves, they may be reused in other applications.

Disadvantages:

  • Object-Oriented applications are often sluggish and consume a lot of memory.
  • Over-generalization.
  • Programs designed using this paradigm may take longer to develop.

The characteristics of OOP:

  • Class definition – Basic building blocks OOP and one entity which has data and operations on data together.
  • Objects – The instances of a category that are utilized in real functionality – its variables and operations.
  • Abstraction – Specifying what to try to but not the way to do; a versatile feature for having an overall view of an object’s functionality.
  • Encapsulation – Binding data and operations of knowledge together during a single unit – a category adheres to this feature.
  • Inherit and sophistication hierarchy – Reusability and extension of existing classes.
  • Polymorphism - Multiple definitions for one name - functions with the same name with different functionality; saves time in investing many functional names. Operator and performance overloading.
  • Generic classes – Class definitions for unspecified data. They are referred to as container classes and are flexible and reusable.\
  • Class libraries – Built-in language-specific classes.
  • Message passing – Objects communicate through invoking methods and sending data to them. This feature of sending and receiving information among objects through function parameters is understood as Message Passing. Figure 1 : The characteristic of OOP

3. Explain what is Event-Driven programming with source code and illustrations

Definition:

➢ Software that is event-driven response primarily to user events or other comparable input. The notion of event-driven programming has inspired the rise of event handlers and other resources in application development and other types of programming. Event – driven software is also known as an event-driven application. In a typical event-driven application, there is a main loop that listens for events and then calls a callback function when one is detected. Instead of a continually running main loop, hardware interrupts can be used in embedded systems to accomplish the same result. Event - driven applications may be developed in any programming language, however, languages with high-level abstractions, such as to await and closures, make the work simpler.

Build automation tools: These can help automate developer tasks that are more common to save lots of time. In addition, some IDEs can also include. ✓ Class browser: won’t to study and reference properties of an object-oriented class hierarchy. ✓ Object browser: won’t to inspect objects instantiated during a running application. ✓ Class hierarchy diagram: This allows developers to see the structure of object-oriented programming code. The IDE could also be a stand-alone application, through it’d even be included as a part of one or more compatible applications.

Microsoft Visual Studio:

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. it's wont to develop computer programs, also as websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms like Windows API, Windows Forms, Windows Presentation Foundation, Windows Store, and Microsoft Silverlight. It can produce both native code and managed code. Visual Studio supports 36 distinct programing language s and allows the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. Built-in languages include C,[9] C++, C++/CLI, Visual Basic .NET, C#, F#,[10] JavaScript, TypeScript, XML, XSLT, HTML, and CSS. Support for other languages like Python,[11] Ruby, Node.js, and M among others is out there via plug-ins. Java (and J#) were supported within the past.

Figure 3 : Visual Studio 2022

2. Introduce features of IDE with illustrations

➢ Basic features of popular IDEs:

  • Test editor: Almost every IDE will have a text editor designed for writing and manipulating source code. Some tools may have visual elements for dragging and dropping user interface elements, but most have simple interfaces with language-specific syntax highlighting such as Turbo Pascal, Notepad++, etc.
  • Debugger: Debugging tools help users identify and fix errors in the source code. They often simulate real-world scenarios to test functionality and performance. Programmers and software engineers can often test different segments of code and identify bugs before an application is released.
  • Compiler: Compilers are components that translate a programming language into a language that a computer can process, such as binary code. Machine code is analyzed to ensure its accuracy. The compiler then parses and optimizes the code to optimize performance.
  • Code completion: Code complete features assist programmers by intelligently identifying and inserting common code elements. These features help developers save coding time and reduce the chance of syntax errors.
  • Support programming language: IDEs are usually specific to one programming language, although some also offer multilingual support such as the Sublime Text IDE. As such, the first step is to find out what language you are using and choose an appropriate IDE.
  • Multiple Plugins Support: With an integrated development environment, it is not surprising that integration needs to be considered when choosing IDEs. Your IDE is your development portal, so being able to combine all your other development tools improves development workflow and productivity,

3. An explanation and evaluation of debugging process in the IDE used and how it

helped with development

“Debugging” explanation: Debugging is the process of detecting and removing of errors and potential errors (also called as “bugs”) during a software code that will cause it to behave unexpectedly or crash. To stop the incorrect operation of a software or system, debugging is employed to seek out and resolve bugs or defects. When various subsystems or modules are tightly coupled, debugging becomes harder as any change in one module may cause more bugs to appear in another. Sometimes it takes longer to debug a program than to code it. ➢ “Debugging” description: To debug a program, the user has got to start with a drag, isolate the ASCII text file of the matter, then fix it. A user of a program must skilled to repair the matter as knowledge about problem analysis is predicted. When the bug is fixed, then the software is prepared

Figure 4 : Start Debugging ➢ After starting, the program will display a Console window that allows me to enter data to start the process of running the code by entering a number into the text " Input your choice:" Figure 5 : Input choice from the Console Window ➢ When starting to check the code, the initial red dot will light up. At this point, you can press F11. This is the “Step Into” function to enhance the execution of the application one statement at a time. When you start the application with F11, the debugger will interrupt the first statement to be executed. This is the function that helps you to understand the execution of the code in the most comprehensive way.

Figure 6 : Program in the debugging mode ➢ During debugging, if there is a piece of code you believe is correct and you don't want to check it anymore, you can press F10. This is the “Step Over” function that allows you to skip code that you are not interested in. This way you can quickly get to the code that interests you more. After you have made sure your program runs correctly. You can press Shift + F5 to exit the debugger. ➢ That's how to do the debugging process, so in Visual Studio what functions are there in the debugging process to help programmers understand more deeply about the program's code, here are a few functions that Visual Studio provides: Granted to programmers:

  • Run to cursor
  • Right-click on the line of code in your application and select Run to Cursor. This step will start debugging and set a breakpoint on the current line of code. If you have set breakpoints, the debugger will pause on the first breakpoint it hits. Press F5 until you get to the line of code you selected Run to the cursor.

Figure 9 : Call Stack Window

5. An evaluation of developing applications using an IDE versus developing an

application without using an IDE

Using IDE:

  • IDE makes it easier and more convenient for you to develop applications, even though you don't need an IDE, you can still write source code, because actually to run the source code of a certain programming language, we just need the corresponding compiler (compiler) of that language. The IDE has a built-in compiler or interpreter inside it that helps you execute code directly when you are programming applications, typically Visual Studio 2022. After using the IDE for programming, I have been able to draw out the following features. the following network points: Figure 10 : Using IDE (VS) to write code

Don’t use IDE:

  • Imagine you use Microsoft Word to write a program, then you have to save the file as a file format according to the language you use. Then run that code again using that language's compiler application. Just imagining it makes me feel uncomfortable. Can you memorize all the syntax of the command to confidently program without using IDE? Moreover, it is also very difficult to avoid syntax errors in the process of writing code. And if your program is 1000 lines long, how long will it take you to find the error? Here is an example of using Word to write code. Figure 11 : Using Microsoft Word to write code
  • Actually, this is the code I copied from Visual Studio and then pasted it here because if I wrote it myself, it would never comply with this coding standard. If you want to write accurately and clearly, it will take time and effort.

Figure 12 : Main menu system ➢ Search Book function: Figure 13 : Search book function

2. Source code and screenshots of the final application with explanation

  • Source code: Main menu hub