2COS402 Introduction to Programming - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

2COS402 Introduction to Programming

Description:

YOU will have to take responsibility for learning to program by doing it. IT ... out there catering for complete beginners to the most advanced professional. ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 44
Provided by: usersW
Category:

less

Transcript and Presenter's Notes

Title: 2COS402 Introduction to Programming


1
2COS402 Introduction to Programming
  • Chris Thorpe
  • thorpec_at_wmin.ac.uk
  • Room AG14

2
Today
  • Briefing on what you will be doing this year
  • Learning Resources
  • KEY questions answered
  • Overview of what programming is
  • Guidance on what to do next

3
The Module
  • Module codeCOS402
  • Starts September finished May 2006
  • Worth 30 credits (double)!
  • CORE module
  • My role

4
Learning Resources
  • Yourselves!
  • Course book
  • Blackboard
  • Tutors
  • Each other
  • Library/Other Books
  • Internet

5
Learning Resources
  • YOURSELVES!
  • The MOST important resource!
  • YOU will have to take responsibility for learning
    to program by doing it. IT CAN NOT BE CRAMMED!

6
Learning Resources
  • Yourselves
  • You cannot learn to program by reading a book
    it is more like learning to play a musical
    instrument!
  • This is a double module worth 30 credits it is a
    core module. We estimate that You should put in
    at least 250-300 hours over the year including
    class contact time. Thats 9 hours a week. You
    have 4 hours contact (lectures and tutorials)
    that leaves 5 hours a week for pre-tutorial
    reading and any catching up of lab work not
    completed.
  • We expect you to keep up. Please do not complain
    that I set too much work for the labs, because as
    you have seen you have plenty of time outside
    labs to finish the set work!

7
Learning resources
  • Course Book You MUST get a copy
  • Programming and Problem Solving with C by Nell
    Dale 4th Edition
  • ISBN 07637 0798-8
  • I will simply refer to this as Dale. E.g. do
    exercises 2-4 on page 1001 in Dale.
  • There is also a version available that includes a
    student edition of Visual C.NET Program
    development studio.
  • The bookshop has lots of copies

8
Learning resources
  • Course Book
  • Pre-tutorial reading and exercises and Tutorial
    work will be set from this book. I will refer to
    set question numbers
  • I will NOT be handing any notes out. There are
    far too many of you!

9
Learning resources
  • Blackboard
  • learning.wmin.ac.uk
  • It contains lecture notes (these PowerPoints,
    Demo programs, pre-tutorial and tutorial work
    specifications.)
  • It contains assessment guidelines, past papers
    etc.
  • Available outside the university! E.g. At home!
  • Show them Chris!

10
Learning Resources
  • Blackboard
  • Vital to visit ASAP
  • All fully registered students should have access.
  • If you are registered and cant access go to the
    library and ask what the problem is.
  • If you are not registered fully yet make sure you
    do get registered ASAP. You will have to use my
    backup site to get homework specs and notes.

11
Backup site for course material
  • If you have problems accessing blackboard because
    of registration issues I will dump the necessary
    course material on my old website.
  • Note I will stop doing this after a few weeks
  • http//users.wmin.ac.uk/thorpec

12
Learning Resources
  • Tutors
  • Tutors are there to get you out of holes, and
    give one to one advice on techniques.
  • Suggest approaches to problems NOT solve
    problems for you.
  • Tutors are there to answer any questions on
    written pre-lab and lab-exercises.
  • Tutors should not have to lecture.

13
Learning Resources
  • Each other
  • Talk to your fellow students, find out which
    students understand the material you have
    problems with and ask them nicely to explain it
    to you.
  • If you think you understand something then
    explain it to others (It is the best way I know
    of proving understanding)
  • In labs discuss things with each other.

14
Learning Resources
  • Internet/Library/Bookshops
  • There is a VAST amount of material out there
    catering for complete beginners to the most
    advanced professional.
  • It is always helpful to get alternative views on
    tricky subjects.

15
The frequently asked questions (FAQs)Why,
What, How, Where and When
  • For example
  • Why are you learning to program?
  • What will you learn?
  • How will you be assessed?
  • Where will you learn?
  • When will you learn?

16
Why are you learning to Program? Or whats in it
for me?
  • For pure academic interest (I wish!)
  • To get a job and pay off your loans!
  • You are all doing computer science do you really
    think you can avoid it!
  • Because it underpins virtually all your other
    subjects. You will develop problem solving skills
    and organisation skills.

17
Why C
  • Supports procedural programming and object
    oriented programming.
  • C/C de-facto industry standard programming
    language.
  • It works on our network (I hope! well it did last
    year)

18
Why C
  • Friendly development environment and good
    debugging tools.
  • Cheap for student edition

19
What is computer programming?
  • Specifying a precise set of instructions in a
    particular order in order to get the computer to
    carry out a task

20
What is computer programming?
The Problem is that computer programming
  • Is very different from what many of you have done
    before.
  • Is one of the least doable subject from books.
  • Needs creative problem solving (thinking)
  • Need good organisation
  • Needs Lots of practice

21
What is computer programming?
The good thing is
  • You are all natural problem solvers! Honest!
  • In your lives you are constantly solving
    problems.
  • What to have for lunch?
  • Where to go on holiday?
  • How much will I earn tonight working in the bar?
  • How do I get from here to the bar by the quickest
    route

22
The bad thing is
  • We solve many of these problems unconsciously.
  • Many have difficulties generalising their day to
    day problem solving skills to the precision
    required for problem solving in computing.
  • E.g. A very simple example
  • Bobs DIY

23
Bobs DIY
  • Problem
  • Bob needs to know how many cans of paint needed
    to paint a room.
  • Buys too much then he loses money
  • Buys too little then he loses money (wasted time
    getting more paint)
  • Bob wants a clever computer programmer (YOU!) to
    help him.

24
Computers are a bit dim!
  • You have to detail precisely the instructions No
    Mr Data from Star Trek here, no computer
    understands English!
  • You must be able to figure out how to solve the
    problem first (on paper) before you attempt to
    write a computer program to tackle to task.

25
(No Transcript)
26
Bobs DIY (tidy version)
  • Get the coverage of paint (coverage)
  • Get the height of room (ht)
  • Get the width of wall 1 (w1)
  • Get the width of wall 2 (w2)
  • Calculate total wall area (totalArea)
  • totalArea 2 x ht x w1 2 x ht x w2
  • Calculate Cans of paint needed (nCans)
  • totalArea / coverage
  • Display Result to BOB

27
CODE Instructions in C
include ltiostreamgt using namespace std int
main () float coverage float
ht,w1,w2 float totalArea int nCans cout
ltlt "Please enter the paint coverage from the can
" cin gtgt coverage cout ltlt "Please measure
and enter the height of the wall " cin gtgt
ht cout ltlt "Please measure and enter the width
of the wall 1 " cin gtgt w1 cout ltlt "Please
measure and enter the width of the wall 2
" cin gtgt w2 totalArea 2htw1
2htw2 nCans totalArea/coverage cout
ltlt"Hi BOB, you need " ltlt nCans ltlt" cans of paint"
ltlt endl return 0
28
Check program works for any wall size and coverage
  • There is a problem with this program
  • Can you find it?

MORAL never believe what a computer tells you!
29
Practice, Practice, Practice
  • Computer programming is more like
  • Learning a musical instrument
  • Learning to play a new sport
  • It is an active process
  • It is an incremental process
  • It constantly builds from previously learnt ideas
  • Do NOT get left behind it is VERY hard to catch
    up!

30
What will you learn?
  • You will learn a new vocabulary, the terminology
    of this subject.
  • You will learn how to begin the process of
    problem solving and designing a solution. 
  • You will learn how to write the solution to a
    problem down in an unambiguous way. 
  • You will learn how to verify if the solution is
    correct. 

31
What will you learn?
  • You will learn the basic syntax and structure of
    simple C programs
  • You will learn how to translate solutions you
    design into C code in a systematic and stable
    way. 
  • You will learn how to use the C development
    environment to build and to debug your programs.
  • You will learn how to verify whether the C code
    for the solution is correct. 

32
What you will learn?
  • You will learn the fundamental concepts of
    procedural programming sequences, selection,
    repetition, functional decomposition.
  • You will learn fundamental concepts of data
    structures
  • You will learn fundamental concepts of Object
    oriented programming

33
Overall Syllabus Goal (Semester 1)
  • To be able to
  • investigate and analyse a real world problem
  • Produce and verify a solution formally
  • Using sequences, selection, repetition and
    subprogram invocation.
  • Using C implement and test your solution

34
How will you be assessed?
  • Commitment to learn marks
  • Your tutors will give you an impression mark for
    what you have done in a tutorial. This mark is
    affected by your pre-tutorial work. This will be
    worth (5 per semester).
  • You will have to show your pre-lab exercises and
    specified lab exercises.
  • It is your responsibility to sign in each week
    and to make sure you have been graded. The tutors
    mark sheet is the ONLY evidence of your work that
    will be accepted.

35
How will you be assessed?
  • Working at home/in other times. You MUST do this
    if you want any success. Do not simply rely on
    exercises I set, work from your book.
    Unfortunately because of the burden of proof
    needed only the work done in tutorials will be
    marked.
  • If your tutor misses a tutorial, then the maximum
    number of labs you could have attended is reduced
    by one.

36
How will you be assessed?
  • In a months time there will be a short mid term
    practical test worth 5. Your tutor will simply
    sit sown with you and check you have learnt the
    absolute basics we have covered up to that point.

37
How will you be assessed?
  • You will have a practical laboratory test at the
    end of each semester, where you are given an
    exercise to do during the lab without aid of
    books, this is worth (25 in semester 1 and 20
    in semester 2)

38
How you will be assessed
  • At the end of each semester there will be a test
    to check that you have learnt the theoretical
    parts of the course. Each of these tests are
    worth 20.

39
Importance of Practical!
  • Each component is marked out of 100 marks
  • Semester 1
  • Value Description
  • 5 Tutorial work/Commitment to learning in
    semester 1
  • 5 Mid term practical
  • 25 In tutorial practical at the end of semester
    1
  • 20 Theory test at the end of semester 1
  • Semester 2
  • Value Description
  • 5 Tutorial work/Commitment to learning in
    semester 2
  • 20 In tutorial practical at the end of semester
    2
  • 20 Theory test at the end of semester 2

40
Where and When
  • You come to lectures here at your allocated time.
    Lectures are VERY important. It is not like
    school where I have to teach to a set syllabus. I
    set the syllabus!
  • You will have been allocated tutorial groups.
    Timetable gives location and times for tutorial
    groups.
  • You must stick to your tutorial groups, we cannot
    accept floating from one group to another.
  • Labs this week will run, where you should make
    sure you can log on to the system. Visit
    blackboard or my website and check your
    pre-tutorial and tutorial work. E.g. this week
    You should go through the introduction to C I
    have prepared.
  • Student guide Your tutor will hand out an
    overview of the key information for the module
    during your tutorial.

41
Important Dates (Note in your diary)
  • Teaching week 1 This week labs run
  • Mid term test Teaching weeks 4 and 5, weeks
    starting 16th and 23rd October. It will take
    place during your regular tutorial slot.
  • End of semester practical test Teaching week 12
    (Week starting 11th December) It will take place
    during your regular tutorial slot.
  • Theory Test Tutorial Week (Week starting 8th and
    9th January 2007) Theory Tests in auditorium
    during your normal lecture slot.

42
To Do List!
  • You need to purchase the course book
  • In your labs this week confirm your account
    details (username is your student ID and password
    is your date of birth, see your information
    sheet)
  • In the lab this week, visit Blackboard go to the
    tutorial specs page and do pre-lab reading and
    exercises for next week.
  • Brush up on you basic windows skills, learn to
  • rename files
  • create folders and subfolders
  • copy move files to and from hard disk and
    floppy disk
  • delete files and folders

43
Try to have fun!
  • Bye Bye
Write a Comment
User Comments (0)
About PowerShow.com