Computer Programming and Problem Solving

Home Admissions Course Guide Computer Programming and Problem Solving

This Course Guide has been taken from the most recent presentation of the course. It would be useful for reference purposes but please note that there may be updates for the following presentation.

COMP S258

Computer Programming and Problem Solving

Welcome to COMP S258 Computer Programming and Problem Solving! I am the Course Coordinator, Dr Jeff Au Yeung.

This course might be your first course taken at the Hong Kong Metropolitan University (HKMU). If this is the case, you may need extra time to learn the study skills and management skills to get through the course. You will need knowledge about distance learning and how HKMU courses are organised.

For those of you who have taken HKMU courses before, you should already know the importance of reading the Course Guide thoroughly. Please read on!

This Course Guide will tell you briefly about the following:

  • what the course is about;
  • how you can work your way through the material;
  • the amount of time you will likely need to spend to complete each unit; and
  • a general idea of what you will need to do to complete the course.

A note about studying a distance learning course

This course is presented in distance learning mode. HKMU practises open and distance learning, with the aim of providing everybody with an opportunity to pursue structured and formal tertiary education. A distance learning course bears resemblance to a conventional face-to-face one, but there are considerable differences.

Let's talk about the similarities first. The amount of study effort is about the same. While the distance learning mode requires a lot of self-study, the face-to-face mode actually demands the same amount of self-study. Both modes use assignments and homework to encourage students to work hard.

Face-to-face teaching is offered in distance learning courses at HKMU as in face-to-face courses. Study materials are also available for students, though the format may vary between lecture notes, presentation slides, study units, study guides and textbooks. In both modes, students attend face-to-face teaching, go home and self-study various materials, work on assignments, and prepare for the examination.

Distance learning courses are nothing to fear, even if it is your first time taking such a course.

At HKMU, distance learning courses are more flexible. Face-to-face teaching sessions are mostly optional. You can choose to skip the classes if you prefer other ways of studying. Video recordings of some sessions may be available too. Students can choose to skip study for one week and play catch-up the following week. On the other hand, face-to-face courses impose compulsory class attendance. Students are required to follow the study schedule very closely and do more quizzes and classwork at designated times.

The flexibility of distance learning courses allows students more room to balance their work, family, study and other aspects of life. Due to the flexibility, however, students have to exercise more time management and discipline when handling a distance learning course. They will need to manage their own study schedule and put in additional effort if needed.

COMP S258 is a full-year, ten-credit, compulsory course for the Computing and Networking Degree programmes as well as the Computing Degree programmes. It is also an optional course for a number of other programmes.

COMP S258 Computer Programming and Problem Solving aims to provide you with fundamental skills and knowledge in programming and application development. After completing this course, you will have picked up sufficient knowledge to take the following courses, among others, offered by HKMU:

  • COMP S359 Relational Databases
  • COMP S311 Programming Languages and Java Programming
  • COMP S356 Software Engineering and Project Management

The study units / study guides, textbook, assignments and self-tests associated with COMP S258 will help you master the topics over a period of two terms.

A hands-on practical approach will be emphasised in COMP S258. Concepts will generally be introduced and described after you have been given the opportunity to try and experience the concepts and applications without really knowing what they are. We believe programming skills can only be acquired through repeated practice.

There will be four assignments and a three-hour final examination.

 

Course aims

The course aims to:

  • develop fundamental programming skills using a structured programming language;
  • enable you to grasp programming concepts through a hands-on approach;
  • apply problem-solving methods and processes with a perspective on selecting suitable data structures for data handling; and
  • demonstrate the operations and analyse the performance issues of key algorithms.

Course learning outcomes

Upon the completion of COMP S258, you should be able to:

  • describe the essential syntax and components of structured programs;
  • develop structured computer programs;
  • apply programming processes and techniques to computational problems;
  • explain the design and operations of fundamental data structures and algorithms; and
  • use and evaluate data structures and algorithms for programming tasks.

The concepts and notions mentioned above might not mean much to you right now. However, they are a good way to check what you have learnt when you are assessing your readiness for the examination or when you simply want to know how you are progressing during the course.

COMP S258 Computer Programming and Problem Solving is designed to create a structured yet stimulating environment in which you can learn the fundamental concepts of structured programming.

The following table provides an overview of the course (a brief description of each unit is provided later in this section), showing the number of weeks expected for completing each unit.

 

UnitNo. of weeks
1Basics of programming3
2Decision and repetition structures4
3Modular programming5
4Built-in data structures and exceptions5
5Introduction to problem solving4
6Searching and sorting5
7Intermediate data structures4
8Data analysis4
Revision1
Total35

 

Each study unit / study guide involves three to five weeks' worth of work. You are suggested to draw up a study schedule and stick to it by exercising discipline and will. Your attitude will be very important to success in the distance learning mode — be progressive and willing to try again and again.

The suggested number of weeks of study indicates the length of each study unit / study guide. You can adjust this based on your own circumstances.

The course is structured so that each unit builds upon previous knowledge. Each unit contains different features to help you study, but you are typically required to:

  • read the study units / study guides and the textbook;
  • test your comprehension and analytical skills by working through activities, self-tests and programming segments that appear in the unit;
  • complete the assignments; and
  • do other tasks, e.g. check out relevant information from the Internet.

The following provides a brief description of the units.

 

Unit 1 — Basics of programming

This unit introduces the essential components of a computer, including hardware and software. It then describes the history of development of programming languages from machine language, assembly language and various types of high-level programming languages. It also explains the characteristics of Python programming language as one of the high-level programming languages, demonstrates how to install a Python interpreter and a suitable programming environment. The unit finishes with a section on the software development cycle, and introduces how to write a simple program with input, output, variables and operations.

 

Unit 2 — Decision and repetition structures

This unit introduces the decision and repetition structures, the programming constructs that make programs appear to be thinking and working efficiently. The basic principles of sequential execution of program statements and the decision structures that make execution conditional are explained. Then the way to repeat the execution of statements by repetition structures — in particular condition-controlled loops (while statements) and count-controlled loops (for statements) — is demonstrated. The unit also explains additional data types and operations that enable the development of more capable programs.

 

Unit 3 — Modular programming

This unit introduces the concept of modular programming using functions for implementation. It explains the methods of function definition and function usages in Python programming. The benefits of modular programming, which is breaking down a program into modules, are highlighted and the implementation of modular programming with functions is demonstrated. A number of programming concepts associated with functions are also explained.

 

Unit 4 — Built-in data structures and exceptions

This unit introduces four primitive data structures in Python, namely list, tuple, dictionary and file. Examples of using these data structures in problem solving are given. The file structure is not strictly a true data structure but is abstracted as one. Key file operations are explained. The unit also introduces some common exceptions that happen in Python programs and ways of handling exceptions.

 

Unit 5 — Introduction to problem solving

This unit discusses well-proven principles, techniques and best practices for problem solving that will start you on the road to becoming an able programmer. The unit begins with an overview of general problem-solving techniques that can be applied to programming projects, whether large or small. It provides an overview of where algorithms and data structures are used in practical applications. It outlines the popular categories of existing algorithms for solving a variety of problems and warms you up to the idea of selecting and implementing the right algorithm for your needs. Lastly, the unit looks at the use of recursion to solve various programming problems. The process of creating recursive functions is presented along with classic examples such as the Towers of Hanoi.

 

Unit 6 — Searching and sorting

This unit is concerned with two important problems in computing — searching and sorting. In this unit, you will study the key searching and sorting algorithms and their characteristics. By implementing these algorithms and conducting experimental analysis, you will discover how algorithm strategy and design can impact the complexity, speed and efficiency of the programs you write. You will also learn how to analyse the performance of algorithms independently of the hardware and software platform used to run a program. This gives you a consistent framework for comparison and for determining the best algorithm or solution for a particular problem.

 

Unit 7 — Intermediate data structures

This unit discusses intermediate data structures such as stacks, queues, trees and hash tables. It examines how each data structure organizes individual data items and the operations available for managing the collection of data. It shows different ways to implement these data structures in Python. By examining examples of how these data structures are used in real world situations, you will learn how some data structures are better suited than others to particular problems.

 

Unit 8 — Data analysis

Data analysis requires the development and use of applications for collecting data and then cleaning, processing and visualizing it. Python comes with libraries and built-in features that greatly facilitate data analysis and processing. Since you will have had a good grasp of fundamental Python programming by the time you reach this unit, this unit introduces the main Python programming elements and techniques that are specifically used in data analysis. It illustrates how data gathering, cleaning, merging and integration can be done. It demonstrates some of the data analysis methods that are available. You will also learn the significance of data visualization and take a look at some popular data visualization methods and libraries in Python.

In this course, you will come across the following types of course materials.

 

Study units / Study guides

The study units / study guides summarise key issues, explain the relevant concepts and examples, and comment on related readings.

A study unit is a self-contained booklet, containing the core of the learning material for that unit. A study guide makes use of the accompanying textbook to guide your learning for that unit. However, both types of material are structured in a similar way.

Each study unit / study guide is divided into a number of sections. The first section introduces the materials to be covered. The next sections constitute the contents of the study unit / study guide. These sections will guide your learning and direct you to complete activities and self-tests. The final sections of the unit are the unit summary and the answers to the activities and self-tests.

The self-tests, in particular, are included to ensure your assimilation of the issues under discussion. They are not part of the assessment. They are designed to help you remember and apply what you have learnt, and also to prepare you for the assignments and examination. By doing the self-tests and referring to the suggested answers included at the end of every unit, you can check your progress. You should attempt all questions in each self-test or activity before referring to the answers.

As mentioned, study guides will refer you to the textbook, and both study units and study guides may refer you to additional online readings and materials as you work through them.

If you encounter any problems, make a note of them and raise them with your tutor.

 

Textbook

The textbook for this course is:

Gaddis, T (2022) Starting Out with Python, Global edn, 5th edn, Pearson.

This textbook will be provided with your course materials.

 

Online Learning Environment

The Online Learning Environment (OLE) provides additional online materials and is a platform for file download, course schedules, assignment download and submission, and discussion forums.

 

Assignments

Assignments form part of the assessment of the course. The feedback provided will help you achieve the objectives of the course.

The assignment papers will be available on the OLE one at a time. Usually an assignment paper will be available at least four weeks before the due date, by which time you must send in your work to your tutor. The method of assignment submission will be demonstrated in the first assignment.

 

Presentation Schedule and Tutorial Schedule

The Presentation Schedule contains information such as a suggested study timetable and the dates of the tutorials and surgeries. You should go to the course website to see the most up-to-date Presentation Schedule.

The Tutorial Schedule and the Surgery Schedule offer detailed descriptions of the dates and locations of every tutorial and surgery session. Again, the most up-to-date schedules can be found on the OLE.

We hope that you will complete this course and learn everything that needs to be learnt. We hope to help you become a true professional, and someone who will want to carry the banner of the university. Here we discuss the equipment, skills and attitude that you will need to complete the journey.

 

Equipment requirements

Both students and tutors need to have at least the following equipment for the course.

Hardware requirements

  • PC or compatible, with sufficient memory (at least 4GB of RAM)
  • Sufficient hard disk space
  • Broadband connection

Software requirements

Programming environments

A programming environment is a piece of software that you can use to write programs. Unit 1 has a section that describes how to install the required programming environments, which include the Python interpreter and Visual Studio Code.

If you want to become more knowledgeable about Python programming, you may also consider installing other Python programming environments such as Anaconda Python.

 

Study skill requirements

Distance learning has given students a lot of flexibility and room for decision making. It also requires you to have more independent study skills and manage your study in a disciplined manner.

Programming requires practice, practice and practice. You cannot learn programming without rolling up your sleeves and trying out some programs. Just as it is easier to learn English conversation in an English-speaking country — because you practise everywhere you go — practice is essential in learning programming.

We suggest that for every program you find in the study units / study guides, textbook and supplementary notes, you do the following:

  • test-run the program on your computer;
  • understand what the program does by trying a few runs;
  • read the program code and work out how the program does what it does; and
  • once you have figured out how the program works, modify the program to change its behaviour, and then test-run it again to see if the desired change takes place.

Your efforts will pay off when you attempt to write your own programs, as you will realise that most programs are modifications of other programs.

The study skills we have mentioned here aren't the only important ones — there are other skills that you will need to pick up along the way. So keep your eyes open and be ready to change your way of thinking.

 

Attitude requirements

Some students are afraid of computers. One probable reason is the feeling of inability to control computers. In this case, remind yourself that computers are stupid. They know nothing until you feed them with programs that instruct them to carry out actions. Programming should help to get rid of the fear.

You will need discipline and independent study skills to get through the course. It takes two terms to get to the finishing line. A great mental and psychological effort is needed. Draw up a study plan and stick to it.

Avoid deadline fighting. Attempt the assignment questions early, one question at a time. The first couple of assignments cover the more basic topics and arguably the marks are easier to get. Be sure not to miss the first assignment in particular.

 

Social skills in the learning community

Although this is a distance learning course, you will be communicating with many other people, including students, tutors, the Course Coordinator, the teaching assistant, and, to a lesser extent, other staff at HKMU. All of us together will form a virtual community, in which, like any community, social rules apply.

One problem with virtual communities is that communication can sometimes break down. Misunderstandings happen. Not meeting face-to-face can lead to the misunderstanding of acts or misread intentions. Try to be sensitive to the feelings of others, and in a positive way, make our own feelings known to others. For example, we can tell other members that we are happy, calm, angry, frustrated or whatever, and explain why.

In this course, besides the Course Coordinator, your tutor is probably the person you will have the most contact with. Misunderstandings can sometimes occur because there is so little face-to-face interaction and so much electronic and indirect interaction.

Our tutors are by and large nice people to deal with, but as part-time teachers they can sometimes be a bit tired from their regular jobs. A good approach is to work with your tutor — treat him or her as a partner in your learning journey rather than a teacher that controls your fate. Stand by your tutor, instead of opposite them, so they will stand by you. A good relationship with your tutor will make a significant difference to your learning experience.

At the end of the day, you want to pass this course and obtain a qualification. It is thus important to be familiar with the course assessment.

The assessment of this course has two components:

  • assignments; and
  • a three-hour final examination.

The following table tells you the total marks allocated to the assessment and to your final examination.

 

Assessment typeMarks
Four assignments
The scores for all assignments will count towards the final assessment.
7.5% each x 4
30%
Examination
The three-hour examination will comprise short questions and long questions.
70%
Total100%

 

The assignments and the examination contribute 30% and 70% of the final Course Score (CS) respectively. To pass the course, you will need a passing CS achieved by obtaining a passing score for both the assignment score (OCAS) and the examination score (OES).

The OCAS is calculated from the average of your four assignment scores. You are encouraged to submit all assignments in order to keep you moving along. It is perfectly alright to submit a half-finished assignment or even just a small part. You will still get some marks and receive useful feedback. You need not submit all four assignments as long as you have obtained enough marks to get a passing OCAS.

The first assignment is particularly important. Statistics have shown that students who do not submit Assignment 1 are much less likely to pass the course.

 

Assignments

The assignments serve three purposes:

  • providing a mechanism for you to keep up your progress;
  • testing your understanding of the topics and requiring you to demonstrate your achievement of the objectives of each unit; and
  • providing an opportunity for you to apply what you have learnt by completing some application work and case studies (programming exercises).

Assignments, after being marked by the assigned tutor, will be returned to you so that you will become aware of your mistakes and can sort out any misunderstandings of the material. You will also be able to widen your perspective through your tutor's feedback.

Please read through the questions and the instructions accompanying the questions thoroughly. The instructions at the beginning are particularly important because they explain the rationale behind the assignment. Each question will specify clearly what needs to be submitted, whether it is a Python program file or a text file.

Only in circumstances of sickness (with medical proof), long business trips (at least one week long and happening within two weeks of the assignment due date), and exceptional events, will your application for extension be considered (but please note that it will not necessarily be granted). If you happen to be in such an unfortunate situation, please follow the instructions outlined in the assignment files. No marks will be awarded for any late assignments without prior approval obtained from the Course Coordinator and/or the Dean. Your tutor is authorised to grant extensions of up to seven days, except for the last assignment.

 

Plagiarism

Plagiarism is the theft of somebody else's work or ideas. If you commit plagiarism, you will be penalized severely (such as receiving zero marks for handing in work that you have copied from elsewhere). This applies just as much to using the work of other students as it does to using the work of book authors.

You may include parenthetical references to the works you cite, e.g. (King 2000, 38). If you do so, you should include a section at the end of your assignment called 'References', where the full name, title, date and place of the publication appear. The way to cite a reference is:

King, K N (2000) Java Programming: From the Beginning, New York: W W Norton & Company.

There is a significant difference between copying from others and discussing with others. It is alright to discuss your work with others or discuss in a study group, but you must prepare and work on the assignment solutions on your own.

 

The final examination

The final examination for this course will be three hours long (closed book) and will count for 70% of the course score (CS). You should use the time between finishing the last unit and taking the examination to review the entire course. You might find it useful to review your self-tests, assignments and your tutor's comments on them before sitting for the examination.

The final examination covers information from all parts of the course and will be in a form you have already experienced in self-tests and assignments.

The Registry will advise you of examination arrangements later in the course.

Each student is expected to manage their independent study schedule and effort, and to enjoy some of the support provided to make your study effort more effective.

 

Tutors and tutorials

The course includes a number of tutorial meetings of two hours each. The tutorials do not take the form of a lecture presentation, but rather are conducted to provide you with an opportunity to receive some guidance from the tutors to help you progress through the course.

Attendance at tutorials is not compulsory. Quite a lot of students prefer purely self-study, choose to omit all the tutorials and still pass the course. This is the flexibility of distance learning.

Each student is assigned to a tutorial group led by a tutor. The tutors at HKMU are often part-time IT professionals who are interested in teaching. They have good experience in their own work and can share with you valuable observations and knowledge.

Your assignments will be marked and commented on by your tutor, who will keep an eye on your progress and assist you if you encounter problems during the course.

Details of the dates, times and locations of the tutorials as well as the name and phone number of your tutor will be sent to you in due course.

 

Surgeries

Surgeries are different from tutorials in that they are designed to offer a more personal level of consultation.

An on-duty tutor will chair each surgery session and answer questions that students ask during the session. Some on-duty tutors might speak to the whole class so that the problem and solution of one student can benefit others.

 

Telephone tutoring

If you have an urgent issue, you may contact your tutor at the assigned time-slots.

Many students in the past have felt that it is difficult to discuss programming over the telephone. It is more effective to discuss online or by email. Your tutor will let you know which method they find to be most effective.

 

Discussion forum

The discussion forum at the OLE is for discussing study topics as well as to share your learning experiences. In a distance-learning course, you may find that the opportunities to meet with other learners are rather limited. The discussion forum can provide a forum for discussion.

 

Email

You may submit more personal questions concerning your study to your assigned tutor through emails. Emails also offer a way to both you and your tutor to overcome the limitations of telephone tutoring in solving more technical issues.

For course content discussion, the discussion forum is preferred.

COMP S258 Computer Programming and Problem Solving aims to provide you with a sound foundation of knowledge for computer programming.

In order to understand the content of this course, you must analyse the materials and apply the concepts you learn. We hope that you will be able to apply the knowledge and skills you gain from this course throughout your career.

This Course Guide is a rather long document because I want to cover everything important here. From time to time, I will post more course-related documents for you on the OLE and by email.

We wish you success in this course and a challenging and inspiring learning experience!

Coming soon