1 / 20

1: Module introduction and the programming environment

1: Module introduction and the programming environment. Moodle page. To access your module on Moodle go to : http://moodle.kent.ac.uk , log-in and select the required module. Assessment. Coursework 50% Examination 50% The coursework comprises:

lamont
Télécharger la présentation

1: Module introduction and the programming environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1: Module introduction and the programming environment

  2. Moodle page To access your module on Moodle go to: http://moodle.kent.ac.uk, log-in and select the required module. 2

  3. Assessment Coursework 50% Examination 50% The coursework comprises: • Class attendance and effort 10% • In-class test 20% • Programming assignment 1: ‘Using a given class’ 25% • Programming assignment 2: ‘Writing and using classes 25% • In-class on-line multiple choice test 20% 2 hr closed-book written examination. This module is non-compensatable– you must obtain at least 40% overall in this module to progress to Stage 2. 3

  4. Logbooks It is strongly recommended that you keep an A4 bound log/note book (A separate one for different modules. Similar to a laboratory note book) Every time you do any work/activity related to the module, make a record. • Each entry should be dated • Start, possibly, by indicating what is to be achieved during the session, or the purpose of meeting, etc. • Indicate any relevant references, data sources • Record salient points of meeting discussions, agreed decisions and actions 4

  5. Logbooks - cont’d • Record any design decisions or revisions and the reasons why these are considered necessary • Record any failed prototyping, the cause and any conclusions • Indicate what has been achieved and/or still outstanding • Indicate the duration of the session This should not resemble so much a diary but more a jotting pad that records in one place all activities, significant thoughts, attempts and failures relating to your work. 5

  6. Object Oriented Programming “All the world’s a stage, And all the men and women merely players;                  They all have their exits and their entrances, And one man in his time plays many parts,” As you like it, W Shakespeare 6

  7. OOP – cont’d A computer program is an attempt to represent some aspect of the world. Not all of the world but just a small part of interest – the problem domain. Thus a computer program can be thought of as a model. The model will have various components or actors that interact with each other to simulate the behaviour of the problem domain. Accordingly the model will change. In programming the components of the model are called objects and we shall be concerned with manipulating these objects – hence the term: Object Oriented Programming (OOP). 7

  8. Programming environment Most programming is now performed with aid of a software development tool. This is sometimes referred to as anIDE or integrated development environment. This provides the means to write, edit and compile code, and run and debug programs. We shall create Visual Basic programs within an environment calledVisual Studio. 8

  9. Program Development Environment – cont’d When Visual Studio is first opened, it displays a dialog where you select the required developer tool from the profile list, i.e. Visual Basic.Net. It then displays the Start Page. At this point it is recommended that Tools/Options is used to indicated the default folder in which to store VB projects. I suggest you create a folder calledprogswithin your co331 folder, then use the browse button to navigate to this folder to enter location address. 9

  10. Create new project • Click on the New Projectlink on the Start Page, or icon. • Select Windows Forms Application and give project a name, say co331Welcome. • Ok. 10

  11. Environment – cont’d The design view of the IDE is then opened. This comprises several windows, a menu bar and tool bar:

  12. Environment windows • Form1.vb [Design]window contains a form,Form1, where the program’s graphical user interface (GUI) will be constructed. This will be used for data entry and output. • Properties – Form1records/displays the form’s properties,e.g. colour, font style, size, etc. These are listed alphabetically or categorically depending on the tab selected 12

  13. Environment windows – cont’d • Solution Explorer– co331Welcome. This window groups the project’s files by type. Usually referred to as ‘the Solution window’, it has buttons to: • View code– displays a window for writing VB code • View Designer– displays the form in design view • Show all files– lists all files in the current project 13

  14. Environment windows – cont’d The Toolboxcontains controls used to customise forms. Controls are pre-packaged components that may be incorporated into forms and allow programs to be created more quickly. 14

  15. A simple program to display the text “Welcome to Visual basic” on a form. Create New Project calledco331Welcomeand open the IDE in design view. If necessary click the Form design icon to reveal Form1 in design view 2. In the properties window: Set the form’s title bar – opposite Text enter:Lecture1: A simple program 15

  16. A simple program – cont’d Ensure that the form “has the focus” by clicking on the form then Change the form’s background colour, BackColor - choose a light colour from custom palette Set the form’s default font toArial, bold, 14pt. Set the font colour,forecolor, to a dark colour 16

  17. A simple program – cont’d If not already open, click on the Toolbox icon and then the drawing pin symbol so that it remains open. If necessary, click Common Controls within the Toolbox. Add a label control to the form:Click and drag the toolbox label control to the form and position it using the sizing handles. To set the label display:Type the required text:Welcome to Visual Basic!in the label’sText property. 17

  18. A simple program – cont’d Reposition the labelon the form using the handler (top left of label). Note the change of values in the Location property. 18

  19. A simple program – cont’d In Design view an Output window may be made visible: View|OtherWindows|Output When the program is run this windows will report any errors detected. To run the program click theStarticon on the menu bar. The program is terminated by closing the form window. Click the close dialog icon. 19

  20. Summary Moodle page Assessment Logbooks Object oriented programming Visual Studio environment Environment windows Visual programming – controls and properties 20

More Related