Level 2 Creating an event driven computer program using VisualBasic.Net ( )

Similar documents
Level 2 Creating an event driven computer program using Java ( )

Level 2 Creating a procedural program using COBOL ( )

Level 2 Creating an event driven computer program using Java ( )

Level 3 Creating an event driven computer program using Visual Basic ( / )

Level 2 Create software components using Java (7266/ )

Level 3 ICT systems and network management ( )

Level 3 Install, configure and integrate networked hardware and software ( )

Level 3 Creating an object oriented computer program using Java ( / )

Level 2 Creating an event driven computer program using Visual Basic.NET ( )

Level 2 Creating an event driven computer program using Visual Basic ( )

Level 3 Develop software using Java (7266/ )

Level 3 Software design fundamentals ( / )

Level 2 Install and configure ICT equipment and operating systems ( )

Level 2 Install and Configure Equipment and Operating Systems ( )

Level 3 Web fundamentals ( )

Level 3 Creating an event driven computer program using Visual Basic.NET ( / )

Level 2 Select and use IT 2 ( )

Level 2 Install, configure and test ICT networks (7266/ / )

Level 1 Dismantle, assemble, install and maintain a desktop computing system (7266/7267/ )

Level 2 Creating an event driven computer program using C# ( )

Level 2 Networking Principles ( )

Level 3 Designing and creating advanced websites ( )

Level 2 Networking Principles ( )

Level 1 Dismantle, assemble, install and maintain a desktop computing system (7266/7267/ )

Level 2 Security for IT Users ( )

Level 3 Website software ( )

Level 3 Network management and security ( )

Level 3 Develop software using Visual Basic.NET (7266/ )

Level 3 Network management and security ( )

Level 2 Security for IT users (ITS ) ITQ (QCF) Assignment guide for Candidates Assignment A. March 2010 Version 1.

Level 3 Design and maintain ICT networks software components ( )

Level 1 Multimedia Software (MM )

Level 3 Develop software using C# (7266/ )

Level 2 Set up an IT system (SIS )

Level 3 Implementing an ICT systems security policy ( / )

Level 2 Create software components using Visual Basic.NET ( )

Level 2 Install, configure and test ICT networks ( )

Level 2 Networking, telephony and VoIP for the digital home technology integrator ( )

Level 2 Creating an event driven computer program using C# ( )

Level 3 Voice and data communications ( )

Level 2 Designing and creating multimedia presentations (7266/ )

Level 1Using mobile IT devices (UMD )

Level 2 Control and security systems for the digital home technology integrator ( )

January 2010 Version 9.0

Level 2 FS IT user fundamentals (IUFFS )

Level 2 Audio/video installation for the digital home technology integrator ( )

Level 2 Create Software Components Using C# (7266/ )

Level 2 Digital Home Technology Integrator ( )

Level 3 Design and maintain ICT network software components ( )

Level 3 Voice and data communications ( )

Level 1 Creating simple web pages (7266/ )

Level 1 IT user fundamentals (IUF:FS )

Level 2 Designing and creating databases (7266/ )

Level 3 Install, configure and integrate networked hardware and software ( )

Level 3 Design software ( )

Level 1 IT user fundamentals (IUF:FS )

Level 1 Producing simple databases (7266/ )

Level 1 Using the Internet for finding and sending information (7266/ )

Level 3 Install, configure and upgrade ICT software ( / )

Level 1 Internet Safety for IT Users ( )

Level 3 Multimedia software (MM )

Level 1 Using the Internet for finding and sending information (7266/ )

Level 3 Design Software ( )

Level 2 Data management software (DMS )

Level 3 Using the Internet (INT )

Level 1 Internet Safety for IT Users ( )

Level 3 Principles of ICT Systems and Data Security ( / )

Level 1 Working with desktop publishing applications (7266/ )

Level 1 Design software (DIS )

Systems and Principles Unit Syllabus

Level 3 Desktop publishing software (DTP )

Level 3 Database software ( )

Level 1 Design software (DIS )

Level 2 IT software fundamentals (ISF:FS )

Level 1 Desktop publishing software (DTP )

Level 3 Data management software (DMS )

Level 3 Multimedia Software (MM )

Level 3 Using collaborative technologies (UCT )

Level 2 Designing and creating documents using desktop publishing software (7266/ ) e-quals Assignment guide for Candidates Assignment C

Level 3 Word processing software ( )

Level 3 Database Software ( )

Systems and Principles Unit Syllabus

Level 2 Combining word processing, spreadsheet and database applications to present information (7266/ )

Level 2 Designing and creating multi-page websites (7266/ )

Level 3 Integrating applications to create advanced presentations (7266/ )

Level 2 Website software (WS )

Systems and Principles Unit Syllabus

Level 3 Using (EML )

Level 3 Word processing software (WP )

Level 3 Software design fundamentals ( / )

Level 1 Producing simple word processed documents (7266/ )

Level 1 Creating presentations using word processing, spreadsheet and presentation software (7266/ )

Level 1 Creating simple presentations (7266/ )

Level 3 Develop designs and test software components (7266/ )

Level 3 Designing and creating relational databases (7266/ ) e-quals

Level 2 Designing and creating databases (7266/ )

Level 2 Using word processing software to adapt and merge documents (7266/ )

Start IT (itq) Database software ( )

Systems and Principles Unit Syllabus

Level 2 Desktop publishing software (DTP )

Transcription:

Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) Assignment guide for Candidates Assignment B www.cityandguilds.com October 2017 Version 1.0

About City & Guilds City & Guilds is the UK s leading provider of vocational qualifications, offering over 500 awards across a wide range of industries, and progressing from entry level to the highest levels of professional achievement. With over 8500 centres in 100 countries, City & Guilds is recognised by employers worldwide for providing qualifications that offer proof of the skills they need to get the job done. City & Guilds Group The City & Guilds Group includes City & Guilds, ILM (the Institute of Leadership & Management) which provides management qualifications, learning materials and membership services, NPTC which offers land-based qualifications and membership services, and HAB (the Hospitality Awarding Body). City & Guilds also manages the Engineering Council Examinations on behalf of the Engineering Council. Equal opportunities City & Guilds fully supports the principle of equal opportunities and we are committed to satisfying this principle in all our activities and published material. A copy of our equal opportunities policy statement is available on the City & Guilds website. Copyright The content of this document is, unless otherwise indicated, The City and Guilds of London Institute 2010 and may not be copied, reproduced or distributed without prior written consent. However, approved City & Guilds centres and learners studying for City & Guilds qualifications may photocopy this document free of charge and/or include a locked PDF version of it on centre intranets on the following conditions: centre staff may copy the material only for the purpose of teaching learners working towards a City & Guilds qualification, or for internal administration purposes learners may copy the material only for their own use when working towards a City & Guilds qualification The Standard Copying Conditions on the City & Guilds website also apply. Please note: National Occupational Standards are not The City and Guilds of London Institute. Please check the conditions upon which they may be copied with the relevant Sector Skills Council. Publications City & Guilds publications are available on the City & Guilds website or from our Publications Sales department at the address below or by telephoning +44 (0)20 7294 2850 or faxing +44 (0)20 7294 3387. Every effort has been made to ensure that the information contained in this publication is true and correct at the time of going to press. However, City & Guilds products and services are subject to continuous development and improvement and the right is reserved to change products and services from time to time. City & Guilds cannot accept liability for loss or damage arising from the use of information in this publication. City & Guilds 1 Giltspur Street London EC1A 9DD T +44 (0)844 543 0000 (Centres) T +44 (0)844 543 0033 (Learners) F +44 (0)20 7294 2413 www.cityandguilds.com learnersupport@cityandguilds.com

Contents Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) Assignment B Introduction Information for Candidates 2 Candidate instructions 3 Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) 1

Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) Assignment B Introduction Information for Candidates About this document This assignment comprises all of the assessment for Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009). Health and safety You are asked to consider the importance of safe working practices at all times. You are responsible for maintaining the safety of others as well as your own. Anyone behaving in an unsafe fashion will be stopped and a suitable warning given. You will not be allowed to continue with an assignment if you compromise any of the Health and Safety requirements. This may seem rather strict but, apart from the potentially unpleasant consequences, you must acquire the habits required for the workplace. Time allowance The recommended time allowance for this assignment is 4 hours. 2 Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009)

Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) Candidate instructions Candidates are advised to read all instructions carefully before starting work and to check with your assessor, if necessary, to ensure that you have fully understood what is required. Time allowance: 4 hours Assignment set up: A scenario is provided below for this assignment. This assignment is made up of three tasks Task A - provides a detailed design specification for software to demonstrate a program that writes to and reads from a sequential text file. Task B - requires the candidate to analyse the execution of the program using specified debug facilities. Task C - provides presentation criteria that should be followed by candidates when producing their work. Scenario A software development company, AlphaTech, is developing a simple Sales recording program that stores data in a sequential text file. As a contracted employee of AlphaTech you have been asked to create and test the software. AlphaTech have supplied the following outline specification to assist you. You are required to create and test this Sales recording program that reads and writes to a sequential text file called Sales.txt. The program has a user interface comprising of text boxes, command buttons, radio buttons, group boxes and a list box. See figure 1 below: Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) 3

Figure 1 The controls must be coded so that Sales details (Product Name, Quantity, Price) are entered into relevant text boxes and written to the Sales.txt text file. The group box and radio buttons enable records to overwrite or append to the text file. The functionality of the program must include: If Append File is selected entries are appended to the text file. If Overwrite File is selected entries overwrite any existing data in the text file. The default mode should be Append File. The text boxes contain the data to be stored in the text file. The data is written to the text file when the Update File command button is clicked. Once the data is updated, the text boxes should be cleared ready for new data. The program will also display the content of the Sales.txt text file in the list box. The Display Records command button should be disabled until the Update File command button is clicked once. When clicked the Display Records command button will: Initially clear the list box Display the records from the Sales.txt in the list box The Exit button should return a Yes/No Message box and close the program only when the Yes option is clicked. 4 Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009)

Task A Using the Integrated Development Environment: 1 Save the project at regular intervals as you work through the task. Name the form file frmtaska and project as Assignment2. 2 Use an Input Box during the Form Load event to capture the user s name. Assign the results to an appropriate variable. The Input Box should be the same as shown below: Use the same variable to set the form s Text property to display the user s name. See Figure 1 as an example. 3 Add three labels and text boxes on the form as shown in figure 1. Name the controls and set the Text properties from the following list: Control Type Control Name Text Property Label lblprodname Product Name Label lblquantity Quantity Label lblprice Price Text Box txtprodname (Blank) Text Box txtquantity (Blank) Text Box txtprice (Blank) 4 Draw a GroupBox as shown. Name the GroupBox grpeditmode and set the Text property to: Edit Mode. 5 Draw two radio buttons and position within the GroupBox. Name the controls radappend and radoverwrite. Set the Text property for the controls to Append File and Overwrite File. 6 Set the radappend checked property to True. 7 Draw three command buttons as shown. Name the controls and set the Text property as follows: Control Name cmdupdate cmddisplay cmdexit Text Property Update File Display Records Exit 8 Set the Enabled property of cmddisplay to False. 9 Draw a list box as shown and name it lstdisplay. 10 Within the code window declare a String variable called strfilename with Form level scope. Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) 5

11 Code the Form Load event and assign the variable strfilename with the value Sales.txt. 12 Code the cmdupdate Click event as follows: Move the txtprodname text value to a appropriately named and declared string variable Test if txtquantity contains a valid numeric value. If the value is not numeric then display the error message 'Quantity must be numeric', otherwise move the txtquantity value to an appropriately named and declared byte variable Test if txtprice contains a valid numeric value. If the value is not numeric then display the error message 'Price must be numeric', otherwise move the txtprice text value to an appropriately named and declared decimal variable If the radappend Checked property is True then the Sales.txt file is opened in Append mode mode (use the strfilename as the filename) If the radoverwrite Checked property is True then the Sales.txt file is opened in Output mode (use the strfilename as the filename) Use the PrintLine function to write the three variables holding Product Name, Quantity, Price to the sequential text file Close the Open File Set the three text boxes to (blank) ready for the next entry Set the cmddisplay Enabled property to True. 13 Code the cmddisplay Click event as follows: Declare a DataRecord string variable Open the Sales.txt file in Input mode (use the strfilename as the filename) Uses the Items.Clear method to clear any items from the lstdisplay list box Use a loop in combination with the EOF property to: Add each line of the Sales.txt file into the variable DataRecord using the LineInput function Add the content of DataRecord as an item in the lstdisplay list box 14 Code the Exit button to display the following Message Box: Only if Yes is clicked should the program be closed 15 Create test data and determine the expected results. 16 Test the program and compare the actual results to the expected results and correct any errors found. 17 Produce a program listing of the code of your program. Label it TaskA. 6 Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009)

18 Produce a screen print of the form frmtaska. 19 Produce a printout of the Sales.txt file. Task B In the task you are required to make amendments to the functionality of your program. The value of the sale needs to be saved within the Sales.txt file. The value is calculated by multiplying the Quantity and Price variables. 1 Amend the cmdupdate Click event: Declare a variable called Total as a decimal data type Assign to Total the result of the calculation Price x Quantity Ensure that this new value is included in additions to the sequential text file. 2 Amend the cmddisplay Click event to remove potential empty rows being displayed: Place an If statement inside the Loop. A record will be displayed only if the record string is NOT (blank). 3 Produce a program listing of the code of your program. Label it TaskB1. 4 Enter the following Sales Data to test the program: Product Name Quantity Price Product1 5 1.99 Product2 3 4.50 Product3 2 3.00 5 Amend the cmddisplay Click event: Add a Console.WriteLine statement within the Loop to display the content of the variable DataRecord in the Output window Produce a screen print of the Output Window. 6 Determine the expected results from the Sales data given. Test the program and compare the expected results to the actual results and correct any errors found. 7 Produce a program listing for the amended code. Label it TaskB2. 8 Create Technical documentation that identifies each event coded in the program and describes the action that is taken when that event occurs. Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) 7

Task C Candidates should follow the below criteria when producing their work: 1 The program conforms to the design specification. 2 The program syntax is consistently indented to aid readability. 3 The program code is commented. Note Candidates should produce the following for their assessor: A printed program listing for TaskA. Test data, expected results, printed output from Sales.txt. A printed program listing for TaskB1. A printed program listing for TaskB2. A screen print for frmtaska. A screen print of the Output window. Technical documentation. At the conclusion of this assignment, hand in all paperwork and removable media to the test supervisor. Ensure that your name is on the removable media and all documentation. If the assignment is taken over more than one period, all removable media and paperwork must be returned to the test supervisor at the end of the sitting. 8 Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009)

Published by City & Guilds 1 Giltspur Street London EC1A 9DD T +44 (0)844 543 0000 (Centres) T +44 (0)844 543 0033 (Learners) F +44 (0)20 7294 2413 www.cityandguilds.com City & Guilds is a registered charity established to promote education and training Level 2 Creating an event driven computer program using VisualBasic.Net (7540-009) 9