



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
• About your program • Explain some programming paradigms: procedural programming, object-oriented programming, event programming and compare them with each other. • Explain the general features of the IDE and its use to manage your code development. • Evaluate application development using an IDE versus developing an application without using an IDE. • Explain and evaluate the debugging process in the IDE used and how it helped development. • Explain and evaluate the coding standards used in yo
Typology: Assignments
1 / 35
This page cannot be seen from the preview
Don't miss anything!




























Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 2/9/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Le Thi Phuong Anh 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
Grade: Assessor Signature: Date: Lecturer Signature:
After passing the interview round with a presentation to demonstrate his problems solving ability and basic programming skills. Now, a more challenging task is to create a secure working application that is designed using an IDE and adheres to coding standards for a detailed business problem. Along with that is an explanation of programming languages I.1Problem statement The solution to a detailed business problem is to create an application using an IDE. It's an application that helps the management of a bookstore. The assigned task is to help staff manage book information including genre, title, author and producer when customers request to provide and learn. Besides, it is the management of book rental vouchers and purchase vouchers for books and goods of the store. The application will be designed using the Winforms of the Microsoft Visual Studio. I.2 Scenario Before going to the next part, let's build the scenario to complete the task better:
perform an action” (Clark, 2013). Further research (Farrell, 2017) OOP is an expansion of procedural programming. It has variables and methods like procedural programs do, but it centers on objects that contain the variables and methods. An object may be a concrete entity that has attributes and behaviors. The attributes of an object are the highlights it "has"; the values of an object's traits constitute the state of the object. Besides, Object-oriented programming is the de facto programming paradigm for many programming languages and it focuses on manipulating objects rather than the logic for manipulating them, making code manageable, reusable, and maintainable. When an object has the same properties, it will be grouped into an object class. Class can also be used to define a new data type. In other words, Layer is a pattern but object is an a current specifically based on that pattern. and will also have 2 components as properties and methods. Basic characteristics of OOP:
I.3 Event-driven programming According to Gittleman (2005) Event-driven programming may be a programming paradigm where the stream of execution is decided by events like clicks or inquiry comes about from a database. Events are dealt with by event handlers or event. “An event is something that causes an event- driven program to perform an action. This broad definition allows many programs to be understood as event – driven” (Williams, et al., 2019). In other words, Event Driven Programming is the dominant paradigm used in graphical user interfaces and other applications that focus on performing certain actions in response to user input. For example, a simple program that prints either Hello or World depending in user input: Figure 4: Example Characteristics:
III.1 Designing (Flowchart) III.1.1 Input information III.1. 1 Add the book Figure 5: Button Add Click
III.1.2 Save information of book Figure 6: Button Save Click III.1. 3 Delete information of book Figure 7 : Button Delete Click
Figure 8: Button RemoveAll Click III.1. 6 Add each comic book to the list Borrowed Comic Figure 9: Button AddOne Click III.1.7 Remove each comic book to the list Lending Comic Figure 10 : Button RemoveOne Click
III.1.8 Show book rental result Figure 11: Button Result Click III.1. 9 Reset all the application Figure 1 3 : Button Reset Click
III.2.2 Code When the Form is displayed, the Save and Delete button will be hidden, after clicking Save, the Add button will be hidden again. To do this, we have the method below: Figure 19: Control Start the program running, without clicking add, will not be able to enter the information of the book “btnAdd.Enabled = true” and vice versa 'btnSave.Enable = false' and " btnDelete.Enable = false". When the add button is not activated, the application will not allow the user to enter data in the fields, only the command lines “txtType.ReadOnly = true”, .... Let the cursor tick on the Add button we use “btnAdd.Focus” to keep the cursor focused on. Same as above, but on the contrary, when 'Save' and "Delete" is enabled, the remaining function operations “btnAdd.Enabled = false” and “btn.Save.Enable = true” àn btn.Save.Enable = true" are not allowed. Once the application has allowed the user to Add, the fields will allow the user to enter the information of the book. At this point, the application will focus on the book genre. When the form is loaded, you need to lock the control immediately. The global variable Book is assigned to createTable().
Figure 21: Add information into Table To add product information, first we need to unlock the control and the flag variable makes it easier for the program to recognize the Add button. When entering new information, for quick operation, this data will be blank, then 'txtType.Text ', ... must be empty. With this save function will take all the data entered by the user then display it in the table (DataGridView) and then save. The if loop is executed with the '==' operator. If true, it will add all the data entered to the table. Need to check if the user entered enough data. Add an if loop to check the data, if true, the application will work, if it is wrong, it will report an error. After entering the data, it will force the information fields into the DataTable and then add it to the DataGirdBook. After successful saving, the control will be locked to continue entering new book information:
Besides adding or moving the entire list of comics between ListBoxes, there is also transferring individual comic books. And it is similar. Click on the object you want to select. The Add attribute will move the comic book in lstLending to be added to lstBorrowed. Then its position in lstLending will disappear by using Remove. To display the results for customer name, customer ID, book rental date, total number of comics rented and names of comic types rented, I use a for loop to return the number of elements in lstBorrowed. I set the SelectedIndex to a valid value (equal to i), the selection goes to the corresponding object when we select the number of elements in the ListBox To pay library bills including comic book rentals and book purchases, I use an if statement to check we use the checked property of the CheckBox along with the operator "==". If selected, the price of the book is equal to the price multiplied by the number of books. It is applicable to chkNovel, chkComic, chkPoem, chkManazine and chkEncyclopedia. And the total bill at this time is equal to the money of the books plus the rental of comic books (depending on the needs of the customer to calculate the money). MessageBox is a class in C# and Show is a method that displays a message of the Form. Thus, the number will appear on the screen with the Name of customer, Customer's ID, time and total payment. Reset Customer name, Customer ID, time, result and Total Invoice using ResetText() - Reset Text property to default value (Empty). Finally close the application with Close().
Figure 28: Reset and Exit application III.2.3 Result When the application starts running, we will enter the above and ID, the time before the purchase. Next, there are two events that are Add and Save for the user to choose. To enter the information of the books, click on add. Information of the books is entered from the keyboard at the request of the customer. When the information in that Information of Book will be saved to the table by the Save event. The add event allows the user to enter additional information when requested. Figure 29: Add information