Table of content Introduction Single program which comprises the various tasks (1.1-1.10) LO1Define basic algorithms to carry out an operation and outline the process of programming an application. LO2Explain the characteristics of procedural, object-orientated and event driven programming, conduct an analysis of a suitable Integrated Development Environment (IDE) LO3Implement basic algorithms in code using an IDE LO4Determine the debugging process and explain the importance of a coding standard Conclusion Reference
1.1Hello C# (Menu Item 1) importtime name=input('Enter your name: ') time=input('Enter time of the day: ') print('Hello, world!') currentTime = time.strftime('%H:%M') ifcurrentTime.hour < 12 : print('Good morning') ifcurrentTime.hour > 12 : print('Good afternoon') ifcurrentTime.hour > 6 : print('Good evening') 1.2Your Name Characters (Menu item 2) foriin range(0, 5): forj in range(0, i+1): print("0",end="") print() 1.3The Area and the perimeter of a Rectangle (Menu item 3) print("Enter 'x' for exit."); side1=input("Enter length of first side: "); ifside1 == 'x': exit(); else: side2 = input("Enter length of second side: "); side3 = input("Enter length of third side: "); a=float(side1); b=float(side2); c=float(side3); s=(a + b + c)/2; area = (s*(s-a)*(s-b)*(s-c)) ** 0.5; print("\nArea of Triangle = %0.2f" %area);
print("The average of theExam is", round(Exam_average, 2)) if90 <= Final_grade <= 100: return 'A' elif 80 <= Final_grade <= 89: return 'B' elif 70 <= Final_grade <= 79: return 'C' elif 60 <= Final_grade <= 40: return 'D' else: return 'F' 1.6The Random Number Generator (Menu item 6) importrandom #Function to generate #andappend them #start= starting range, #end=ending range #num=number of #elements needs to be appended defRand(start, end, num): res= [] forj in range(num): res.append(random.randint(start, end)) return res #Driver Code num=8 start=1 end=79 print(Rand(start, end, num)) 1.7The Sum of the Elements of an Array (Menu item 7) def_sum(arr,n): #return sum using sum #inbuilt sum() function
return(sum(arr)) #driver function arr=[] #inputvalues to list arr=[12, 3, 4, 15] #calculating length of array n=len(arr) ans=_sum(arr,n) #display sum print(\'Sum of the arrayis \',ans) 1.8Bouncing Ball Game (Menu item 8) fromtkinter import * importtime importrandom WIDTH=800 HEIGHT= 500 tk=Tk() canvas= Canvas(tk, width=WIDTH, height=HEIGHT, bg="black") tk.title("Drawing") canvas.pack() colors=['red','green','blue','orange','yellow','cyan', 'magenta', 'dodgerblue', 'turquoise', 'grey', 'gold', 'pink'] classBall: def__init__(self): self.size = random.randrange(200, 400) color = random.choice(colors) self.shape=canvas.create_rectangle(0,0,self.size, self.size, fill=color) self.speedx = random.randrange(1, 10) self.speedy = random.randrange(1, 10) defupdate(self):
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
canvas.move(self.shape, self.speedx, self.speedy) pos = canvas.coords(self.shape) if pos[2] >= WIDTH or pos[0] <= 0: self.speedx *= -1 if pos[3] >= HEIGHT or pos[1] <= 0: self.speedy *= -1 ball_list = [] foriin range(100): ball_list.append(Ball()) whileTrue: forball in ball_list: ball.update() tk.update() time.sleep(0.01) 1.9Maths practice questions (Menu item 9) print("Enter 'x' for exit."); print("Enter any two number: "); num1=input(); num2=input(); ifnum1== 'x': exit(); else: ch= input("Enter operator (+,-,*,/): "); ifch == '+': res = int(num1) + int(num2); print(num1, "+", num2, "=", res); elif ch == '-': res = int(num1) - int(num2); print(num1, "-", num2, "=", res); elif ch == '*': res = int(num1) * int(num2); print(num1, "*", num2, "=", res); elif ch == '/': res = int(num1) / int(num2); print(num1, "/", num2, "=", res); else: print("Strange input..exiting.."); 1.10Exit (Menu item 10)
defprint_menu():## Your menu design here print 30 * "-" , "MENU" , 30 * "-" print "1. Menu Option1" print "2. Menu Option2" print "3. Menu Option3" print "4. Menu Option4" print "5. Exit" print 67 * "-" loop=True whileloop:##Whileloopwhichwillkeepgoinguntil loop=False print_menu()## Displays menu choice = input("Enteryour choice [1-5]: ") ifchoice==1: print "Menu 1 hasbeen selected" ## You can add your code or functions here elif choice==2: print "Menu 2 hasbeen selected" ## You can add your code or functions here elif choice==3: print "Menu 3 hasbeen selected" ## You can add your code or functions here elif choice==4: print "Menu 4 hasbeen selected" ## You can add your code or functions here elif choice==5: print "Menu 5 hasbeen selected" ## You can add your code or functions here loop=False#Thiswillmakethewhilelooptoendasnot valueof loop is set to False else: #Anyintegerinputsotherthanvalues1-5weprintan errormessage raw_input("Wrongoptionselection.Enteranykeytotry again..")
LO1Definebasicalgorithmstocarryoutanoperationandoutlinetheprocessof programming an application. A great algorithm is a step by step way of solving a problem. It is actually frequently used for data processing, calculations and other related computer and mathematical operations. An formula is also used to manipulate info in several ways, including making use of a new data item, searching for a particular item or perhaps sorting a great item. Developed is a detailed series of guidance for carrying out an operation or perhaps solving a problem. In a nontechnical approach, we use methods in everyday tasks, for example a method to bake a cake or a do-it-yourself guide. Technically, computers use codes to list the precise instructions for carrying out surgery. For case in point, to calculate an employee’s paycheck, the pc uses an algorithm. To full this task, appropriate info has to be entered into the operational program. In terms of efficiency, many codes are able to accomplish operations or perhaps concern solving easily and quickly. Application development measures To begin with, writing a program requires several steps (we can consider folks in the future): Set up the external requirements including the user interface and event handlers oBuild the consumer interface oCode function handlers and write common code oDebug the scheduled method oDocument the scheduled software We will now discuss many of these, and return to folks down the road. 1. The first, most critical and progressive step is definitely defining the external specs of the program. The guidance cannot be written by you meant for doing something until do you know what that may be you want completed, so before you start writing a scheduled program, you need a clear out picture of what this kind of will do when that is done. You have to imagine it working -- what does the screen appear to be? What actions can the client take? What happens when he or perhaps she takes each of these actions? This step is similar to an architect picturing therefore drawing pictures and blueprints for a house to be created. When the architect finishes, they or she turns the plans over to a builder
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
who constructs the house. In case the plans were complete and well written, the house will come away as the architect thought this kind of. Similarly the exterior information of a program should certainly give enough detail that the programmer could use it to write down the program as you envisioned this. You should generate a crafted description, a great external requirements, of the program you are going to create before you begin writing it. For the short program, this explanation may be only one page extended, even though for a large system like Microsoft Word, detailed and it would be very long. The external specification should demonstrate appearance of the user interface -- which controls are on the screen and how they are organized. 1.This kind of should also specify the poker site seizures that can happen -- the actions the user can take, and what the computer should be set to do for each of them. (As we will see later, all situations are not caused by specific action). 2.Build the user software using the VS development program. 3.Code the event handlers. For each event you explain in step 1, you must compose a great event handler, a subprogram telling the computer how to proceed when that event comes about. 4.When you first run the program, it will certainly not do the job properly. Debugging is the procedure of finding and correcting the blunders. In testing a course, it should be given by you severe inputs in an attempt to force mistakes. Some THAT managers need programmers to write their debugging test plans before beginning to program. They assume that in case the programmer does not have a clear enough external description to do so, they just do not understand the nagging problem good enough to program it.
The job is not completed correctly when the program is definitely working. The engineer need prepare documents describing the external requirements and the interior design of the scheduled software. This documentation will be valuable to users and coders who must maintain and modify your program. A large number of people could work as a team if a project is normally large. There might be architects, testers, programmers and documentation writers. It could sound like you work all the way through these steps in order just, however, in practice, you shall be going back at times. For circumstance, while writing event handlers, you may decide you need to replace the user interface, so you need to support and change the external requirements. LO2Explainthecharacteristicsofprocedural,object-orientatedandeventdriven programming, conduct an analysis of a suitable Integrated Development Environment (IDE) Procedural Programing – The first of all and most simplistic programming paradigm is procedural programing mainly becauseit works by steps starting from a great input then to control this input and consequence with an answer depending on what steps the creator selected the program to do to reach the specified end state. As step-by-step programing is very easier to master then other forms of programing it allows companies to use employees without having to retrain all of them as it is commonly what the majority of programmers learn first. As well as procedural programing contains a clean design it enables smaller projects to be finished meant for lower cost as significantly less effort is needed to keep track of the code and the functionality of re-use the code for the similar program allows programs to slice down wasteful time in recoding of the same procedure.
However Step-by-step programing comes with limits especially with large projects since the code of the system will need constant refining and editing so because of this software will turn into Spaghetti code which means that the flow from the code isn’t great and scrambled around the program which makes it confusing for developers to read which part leads to what. This will also result in employing new employees to be far more expensive as it will take several weeks before the custom made will completely understand innards of the program and exactly how it works. Also as all the things in procedural programing is normally connected to each other making adjustments are difficult to make without triggering errors as changing 1 piece of code will result in a great butterfly effect as various other pieces of codes may rely upon that piece of code. Object oriented programing – The 2nd programing paradigm object focused is different to procedural due to procedural breaks down a program in a collection of code structured to perform step by step but object focused programing breaks a program into objects which are independent towards the rest of the program so 1 whole single task may be put into an object instead of this having to executed first past sets of code which might be connected to other tasks. As the objects are self-sustaining they could be easily implemented into various other programs as they don’t ought to be drastically modified to fir with the structure of the other plan which procedural programing would require. Objects also make that easier for programmers to know the flow of the method as they don’t need to look over the whole program to find one particular task as everything for your one task would be exemplified into one object Object focused too has limits due to the fact it’s a newer type of programing so most companies need to teach employees to train new personnel into programing in that way seeing that object oriented tends to need to know more knowledge and skill of programing, this will result in bigger a slower start of making the beginning of the program and also could increase costs of training staff. Another disadvantage is that thing oriented tends to take up even more processing power as that uses up more ram memory as packing each individual object will require reloading the same functions and methods.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Event driven programming – Event driven programming is usually used for GUI’s such as term processing and spread bed sheets as they are made to respond with inputs generated by users. Even driven programs operate by simply execute different unique codes depending on external stimulus that is inputted, this is done by employing event handlers so every time a certain input has been built a batch of code is executed to respond with this input. Event driven courses can be written in nearly all programing language as it a method of programing which cracks the program into handles that happen to be triggered whenever the desired source is made for example when an individual clicks or possibly drags a subject a great hander is activated causing the program to do the actual developers have codded once that happens. LO3ImplementbasicalgorithmsincodeusinganIDE The Visual Service interactive development environment (IDE) is a creative launching cushion that you can use to view and modify nearly any kind of code, and after that debug, build, and content apps for Android, is, Windows, the web, and the cloud. There are versions available for Macintosh pc and Windows. This subject matter highlights you to the features of the Impression Studio IDE. We'll walk through some things you can do with Noticeable Studio and how to mount and use this kind of, make a simple project, get tips about debugging and deploying code, and take a tour with the various tool home windows. Generate mobile apps You can develop native mobile apps several programs by using Amari and C#, or Visual C++, or hybrid apps working with JavaScript with Apache Cordova. You can write mobile game titles for
Unity, Ideal come true, DirectX, Cocoas, and more. Visual Studio room includes a fantastic Android emulator to help you run and debug Android apps. You can influence the power of the cloud to your mobile apps by creating Azure app services. Violet app services enable the apps to store info for the cloud, properly authenticate users, and instantly scale it is resources up or to enable the needs of the app and your corporation. To find out more, see Mobile app production. Make cloud apps intended for Azure Visual Studio gives a suite of tools that enable you to ideally create cloud-enabled applications powered by Microsoft Company Azure. You can configure, build, debug, package, and release applications and services in Microsoft Azure directly from the IDE. To get Orange Tools for. NET, pick the Azure development workload as you install Noticeable Studio. For further data, see Visual Studio room Tools for Azure. Hockey App helps you distribute beta alternatives, collect live crash reviews, and get feedback coming from real users. In addition, you may integrate Office environment 365 SLUMBER APIs into your own iPhone app to connect to data stored in the cloud. For more information, look at these GitHub samples. Software Info helps you detect and diagnose quality issues inside your web and apps providers. Application Insights too assists you understand what your users really do with your app, so you can maximize the user experience. Create applications for the web The web pushes our modern world, and Visual Services can help you compose apps for it. You can produce web apps using OR NET. NET, Consumer. Jess, Python, Typescripts and JavaScript. Vision Studio knows web frames like Slanted, jQuery, Share, and more. ASP. NET Main and. NET Core operated with Windows, Mac, and Apache operating systems. ASP. NET Key is a major update to MVC, Signal and webapi, and runs on Home windows, Mac, and Linux. OR NET. NET Core has been designed from the ground to supply you with you with a lean and compostable up. NET stack to get building modern cloud-based net services and apps.
Vision Studio is more lightweight than before now. The flip-up installer enables you to select and install workloads, which are sets of features needed for the coding platform or language you want. This strategy helps keep the impact of the Visual Studio device installation smaller than ever prior to, this means it places and improvements faster also. In addition to improved installation performance, Vision Business 2017 has short IDE start-up and option load times also. To reveal more about putting together Visual Studio on your program, see Install Cosmetic Studio room 2017. To stick to things for creating a scheduled method, be sure to select the. NET Primary cross-platform progress workload through the assembly. Visual Studio The C# code to your application is shown inside the editor window, which occupies most of the space. Notice that the code syntax is quickly colorized to disclose several types of types, such as keywords and code. In addition, small, straight dashed lines in the code indicate which braces meet one another, and line figures later help you locate code. You can choose the small, encased minus signs to collapse or perhaps expand code. This code outlining feature lets you cover code you don't need, helping to decrease onscreen clutter. Debug, check, and increase your code Nothing runs perfectly continuously. When you write code, you should run it and check that for performance and bugs. Visual Studio's revolutionary debugging system enables you to debug code running in your local task, on a remote gizmo, or perhaps on an emulator such as the single for Android devices. You may step through code 1 statement at a time and examine variables as you go. You can established breakpoints that are only reach when a specified condition is valid. You can monitor the ideals of variables as the code runs, and more. This can be had the opportunity in the code director itself, so that you do not have to leave your code. To get additional details about debugging in Image Studio, see Debugger characteristic tour.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
For testing, Visible Studio offers unit examining, IntelliTest, efficiency and load screening, and more. To learn more about tools, testing and see testing scenarios. To find out more about bettering the performance of your applications, see Profiling feature travel. Deploy your finished submission When your application is ready to release to users or clients, Beauty Studio provides the equipment to do that, whether you're implementing to Microsoft Store, into a SharePoint site, or with Install Shield or Windows Installation software solutions. It's all attainable through the IDE. For more information, find Deploy applications, services, and components. The Quick Kick off search box is a great way to rapidly find what you need found in Impression Studio. Just commence entering in the true term of whatever you are looking for, and Obvious Studio lists effects that take you wherever you want to go. Quick Release also shows links that start the Visual Studio room Installer for any workload or perhaps individual component. Launch search field quickly Refactoring includes procedures such as intelligent renaming of variables, moving selected lines of code into a separate function, moving code to different places, reordering function details, and more. Refactoring IntelliSense is definitely an umbrella term for your set of well-liked features that display type information about the code directly in the cropping and editing tool and, in some full cases, produce small bits of code for you. It's like having standard documentation inline in the publisher, which saves you from needing to look up type information within a separate help display. IntelliSense features vary just by words. For more info, see C# IntelliSense, Obvious C++ IntelliSense, JavaScript IntelliSense, and Image Basic IntelliSense. The following example shows some IntelliSense features in work:
Visual Studio room Membership List Squiggles will be wavy red underlines that alert you to errors or maybe potential problems in your code in real time as you type. This permits you to fix them immediately without having to wait for the error to get discovered during program or perhaps run time. If you are positioned over the squiggle, you see further information about the trouble. A light bulb may possibly also appear in the left margin with advice for how to fix the error. For more information, see Rapid Actions. Visual Studio Crew Services is a cloud-based services for hosting software jobs and enabling collaboration found in teams. VSTS supports either Get or Team Groundwork Source Control systems, along with comma development methodologies, Agile and Scrum. Team Foundation Variant Control (TFVC) uses a sole, centralized server repository in order to and files version. Neighborhood changes are always checked to the central server where additional designers can get the latest alterations. Team Foundation Machine (TFS) is the submission lifecycle control hub for Visual Studio room. It allows everyone a part of the development process to take part in using a single option. TFS is useful for managing heterogeneous projects and teams, as well. Cloud Explorer Server Manager Helps you browse and control SQL server assets and instances locally, remotely, and Azure, Salesforce. Com, Office environment 365, and websites. To spread out Server Explorer, on the key menu, choose View >Components Explorer. Find Add new connections for more info on using Server Manager. SQL Server Data Tools (SSDT) is a powerful expansion environment for SQL Web server, Azure SQL Data bank and Azure SQL Info Stockroom. You are stimulated because of it to build, debug, maintain, and refactor databases. You can make use of a database project, or immediately with a connected database occasion on- or off-premises.
SQL Hardware Object Explorer in Image Studio provides a watch of your database objects very much like SQL Components Management Facility. SQL Equipment Object Browser enables you to do light-duty listings design and administration do the job, including editing table info, comparing schemas, executing concerns by using contextual options from SQL Space for storage Object Manager, and more. SQL Server Article Explorer Extend Visual Business If Visual Studio hasn't got the exact functionality you need, it could be added by you! You are able to personalize the IDE based upon your style and workflow, put support for external equipment not really yet integrated with Obvious Studio, and change existing functionality to increase the productivity. To find the latest version with the Visual Studio Extensibility Equipment (VS SDK), see Eyesight Studio SDK. LO4 determine the debugging process and explain the importance of a coding standard Debugging is an organized process of finding and lowering the true number of bugs, or perhaps defects, in a computer software or perhaps a piece of electronic components making it act in response as expected therefore. Types of Errors •Compile Time (syntax) •VB error scanning finds errors made on a single series. •Run Time •Failure during run period (egg. divide by simply zero) •IDE gives a mistake highlights and message annoying line. •Logical •Program doesn’t behave as anticipated. Steps in Debugging
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
oCopy the bug, and decide conditions which produce that. oSimplify the program to isolate the bug. oInvestigate program’s performance. oUse tracing (I. Elizabeth. print statements) oEmploy debugger tools presented by simply IDE Tracing - Produce & Assert File format: Debug. Print expression Habits: Images values of variables or perhaps expressions as text inside the “Immediate” window. Syntax: Debug. Assert (expression) Behavior: Factors a design-time break in the Demand statement when the current expression evaluates to False. In the event the expression evaluates as True, program operation proceeds. Debugger Tools •Control the program’s execution: •Stage Into/Over/Out •Breakpoints Lug yellow highlight bar in code •Analyze the values of factors and expressions: •Look at Window •Local Home window •Report over cursor •All readily available through menu, toolbar, keyboard techniques, right-click menu Step Into/Over/Out •Step Into starts software then stops before initial executable, or perhaps steps series by line. Enters termed console and functions. •Stage Over skips current range (but certainly not its execution). Doesn’t enter into subroutines or perhaps functions. •Step Out leaves current subroutine and silence in next expression inside the calling code.
Breakpoints •Internal stopping or stopping place in a program •Set you back breakpoint, examine variable beliefs then. Easier than moving. •Multiple ways to “toggle” on/off Watches •Timely report of a variable or perhaps value of an excellent phrase •Local window reveals all variables in termed console. •If that’s lots of, add select variables to observe glass windows. •Quick Enjoy adds variables quickly to look at window. Conclusion The limits of special event driven is that takes more processing power mainly because it needs much more coding to manage each individual input that may be possible for the user to make therefore the program would need to consume additional storage. Also event motivated is only useful for GUI applications so companies which coach employees on how to write code as even driven is going to drop money when they do not make a program which uses GUI’s, this as well signifies that event driven isn’t helpful for commercial programs as they need data processing which is not needed of event motivated. Reference Web based tutorials http://www.virtualsplat.com/tips/visual-basic-debugging.asp
Microsoft Support Overview of Visual Basic Editor Debugging Tools (http://support.microsoft.com/kb/165517) Tips for Debugging Visual Basic for Applications Code (http://support.microsoft.com/kb/142999) - Old Access ESRI Support http://edndoc.esri.com/arcobjects/8.3/gettingstarted/ vbspecifics.htm#Debugging_Visual_Basic_Code Albrecht, Michael, Patrick Donnelly, Peter Bui, and Douglas Thain. “Makeflow: A Portable Abstraction for Data Intensive Computing on Clusters, Clouds, and Grids.” Proceedings of the 1st ACM SIGMOD Workshop on Scalable Workflow Execution Engines and Technologies (2012): 1–13. ACM Press. doi: 10.1145/2443416.2443417. Alted, F. “Why Modern CPUs Are Starving and What Can Be Done about It.” Computing in Science & Engineering 12 (2010): 68–71. doi:10.1109/MCSE. 2010.51. Barendregt, Henk P., and Erik Barendsen. “Introduction to Lambda Calculus.” Nieuw archief voor wisenkunde 4 (1984): 337–372. Beck, Kent. Test-Driven Development: By Examples. Boston, MA: Addison- Wesley, 2002. Chacon,Scott,andBenStraub.ProGit.2nded.NewYork:Apress,2014.http:// git-scm.com/book/en/v2. Collette, Andrew. Python and HDF5: Unlocking Scientific Data. Sebastopol, CA: O’Reilly Media, 2013.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Donoho, David L., Arian Maleki, Inam Ur Rahman, Morteza Shahram, and Victoria Stodden. “ReproducibleResearchinComputationalHarmonicAnalysis.”ComputinginScience& Engineering (11): 8–18. doi:10.1109/MCSE.2009.15. Drepper, Ulrich. “What Every Programmer Should Know About Memory.” September 21, 2007. http://lwn.net/Articles/250967/.