Beruflich Dokumente
Kultur Dokumente
TCC 101
Computing I
Course Guide
ii WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Production
Editor: Mr. Terence Too Yang Yau
In-house Editor: Jeanne Chow
Graphic Designer: Audrey Yeong
Wawasan Open University is Malaysia’s first private not-for-profit tertiary institution dedicated to
adult learners.
It is funded by the Wawasan Education Foundation, a tax exempt entity established by the Parti
Gerakan Rakyat Malaysia and supported by the Yeap Chor Ee Charitable and Endowment Trusts,
other charities, corporations and members of the public.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or
transmitted, in any form or by any means, electronics, mechanical, photocopying, recording or
otherwise, without prior written permission from WOU.
Contents
Course Guide
1.0 Studying at WOU using the distance learning mode 1
Course organisation 8
Objectives 9
Outcomes 9
Course delivery 12
Tutors 15
5.0 Examination 19
Examination policies 19
Passing marks 19
Hardware 21
Software 21
WOU has adopted the open distance learning mode as a key element to facilitate the
implementation of programmes that will provide you the opportunities for lifelong
learning. Our flexible learning programmes will meet the needs of working adults
who are unable to study on-campus full-time five days a week for four to five years
and yet yearn for an accredited qualification or personal interest enrichment without
leaving their homes and jobs.
The tutorial sessions are usually held at nights or weekends, either at WOU campus
or through strategically located and well equipped Regional Ofices. You can attend
your tutorial session at the Regional Office closest to your residence. A schedule
of the tutorial sessions will be sent to you at the beginning of the semester. These
sessions provide a platform for you to clarify any queries regarding your courses
with your tutor and for you to exchange ideas with your peers as well. This would
certainly boost your study skills and self confidence.
2. The changed role of the tutor; who meets learners only for selected tasks
such as counselling, giving tutorials or collaborating with learners to
solve their problems.
For you, the overriding benefit of ODL is that it gives you access to education that
you would not otherwise have. Only a minority of adults can afford to stop work
in order to further their studies. ODL allows you to study when and where it suits
you, and to enable you to continue learning while fulfilling commitments to work,
family or community.
You may be pursuing higher education for various reasons. You could be interested
in changing careers or you might simply want to expand your knowledge base for
work or personal reasons. You might even want to start a degree programme that
was postponed due to family or career needs.
In this regard, ODL is able to cater to your needs as you may not have the time,
financial resources, or educational background to be a fulltime student on campus.
Thus, distance education is a means to deliver accessible and affordable education to
you. It is important for you to bear in mind that in ODL, you are not working alone
on your long journey to a degree. Make full use of the facilities and opportunities
during your study at WOU, especially in getting to know fellow students with whom
you can work to achieve your dream.
You should always make an attempt to attend all scheduled tutorials, form study
groups with your peers, check for any latest update on the LMS, participate in e-
forums and contact your tutors. Your tutors are there to help you understand the
course materials, to clarify any subject matter you have difficulty following and to
collaborate with you to enhance learning. They are not there to give a lecture or to
answer your assignment questions for you. The email address and telephone number
of your tutor will be provided. You should also have your tutorial colleagues’ email
and phone contacts in order to work together. An active learning community can
ensure the successful completion of your course.
WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide
The course is organised into 5 study units. These study units guide your learning.
Each unit contains three to four weeks of work and includes specific objectives,
directions for study, commentaries on the material presented in the text and
how to apply it. The titles of the specific study units are included in the course
overview table.
To help you review what you have learnt, the units include self-tests related to the
required readings, and activities to extend and apply your learning. These activities
and tutor-marked assignments assist you in achieving the stated learning objectives
of individual units and the course.
The time needed to complete the study units, work through the self-tests and
assignments and complete the rest of the course will vary from learner to learner.
You can adjust these times to fit your personal needs.
Each of the five units in this course contains three to four weeks of work. Make
sure you have planned your own study schedule. It is important that you complete
self-tests, assignments and the examination successfully and timely.
The course is structured so that each unit builds on previous knowledge. Each unit
includes at least four ways to help you study. These are:
3. Completing the self-tests and activities that appear throughout the units;
these will require you to think, observe or undertake some activity that is
designed to help you apply the knowledge that you have gained.
The average estimated time that you need to spend in this course is about six to
seven hours per week (average one hour a day). This estimate includes the time
for reading the study units and textbook, completing self-tests and practice exercises,
completing your assignments, undertaking the suggested reviews, attending tutorials
and preparing for your final examination.
WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
In general, we avoid duplicating the textbook material in the study unit. Instead,
we attempt to complement the textbook by presenting some of the more difficult
concepts in an alternate (and often simplified) way to help you understand them.
Often we present material which we think is important but that is not found in
the textbook. You should remember that the study unit is not meant to replace the
textbook, which is a good source of information in the course.
One final reminder is needed. Although you can adjust study times to suit yourself,
it is important that you complete and hand in your written assignments on time. You
need to bear this in mind when you are planning your study time. You can find
more information on assignments in a later section of this Course Guide.
In the course materials, you will come across icons that are designed to inform you
of the activities that you are required to do before proceeding to the next section of
the materials. Please follow the guidelines in these examples as the course writers
have included these icons in various activities of the course materials. The following
icons and descriptions explain how these icons lead you towards a richer and more
productive learning experience.
1. C
ould you …………….. in a moment?
I’ll check if she is around.
12. Telephone Feeback “Hi! I am Roger, your tutor for WOU333…I called
to check if you have received my email about…..
as I am still awaiting your confirmation about the
group meeting the following week”
OR
Make an effort to call your tutor within the
next two weeks and see if he/she has any new
guidance for you.
14. Video Load the VCD provided with the course materials
and open the file xyz.wma. Play the video and
answer the questions in section 3.8, page 53 of
your course materials.
WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course organisation
Total 18
Course guide
Objectives
Outcomes
The course has short-term and long-term outcomes. Immediately upon completion
of the course and its associated exercises, you would be confident to comment on
and be capable of analysing simple daily programs through the implementation of
object-oriented programming methodology. You should be capable of writing short
programs to perform routine tasks using Java.
2. Integrate course concepts and knowledge with your own experience and
observations.
Assignments (the Tutor Marked Assignments, TMA) and examinations are designed
to test you and facilitate your progress. To complete the course successfully, you
are required to pass both the continuous assessment and the final examination.
Table 1.0 shows the detail suggested weekly reading and continuous corresponding
assessment.
There are three TMAs for TCC 101 Computing I. Students will complete the first
assignment about one month after commencement of the course to get a written
feedback on their initial performance. All three assignments are compulsory. They
are timed to allow for feedback from one before the next becomes due.
The assignments take the form of case studies or programming exercises. In any
case, the students need to show understanding of course concepts and apply the
concepts appropriately in the assignments. TMA 1 is worth 10% while TMA 2 and
3 is worth 20% each. All three TMAs can be found in the Appendices. Feel free to
practice doing it anytime when you are ready. The suggested weekly reading in Table
1.0 aims to guide and prepare you on the concepts and knowledge necessary in the
three TMAs. All the three TMAs are individual work and you are not allowed to
share your work with other students. Although you are encouraged to have group
discussion among your course mates, remember that the final product should be
your own individual work. Any act of collusion and plagiarism will be punished.
12 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course delivery
Text book
Supplementary readings
4. Deitel/ Deitel (2003) Java How to Program, 5th edn., Upper Saddle River,
New Jersey: Prentice Hall.
• Other print and non-print media that may accompany the set of course
materials.
Course guide 13
Apart from the LMS and tutorials described earlier, WOU is mindful of the need to
support you throughout the conduct of the course. Our Regional Offices are well
equipped and staffed to attend to your queries whenever they arise. We have Regional
Office Managers and tutors who are only too glad to listen to you. Whenever possible
and deemed important, the Regional Office staff will link you up with the relevant
person if need be. The Regional Offices have access to the WOU campus in Penang
and also contact with the Course Coordinator should it be required.
Online support
http://java.sun.com/docs/books/tutorial/index.html
http://www.webreference.com/programming/java/tutorials.html
http://math.hws.edu/javanotes/
http://www.apl.jhu.edu/~hall/java/Java-Books.html#Java-Books-Tutorials2
http://oopweb.com/Java/Documents/JavaNotes/VolumeFrames.html
http://www.cafeaulait.org/course/
http://apex.vtc.com/java.php
http://chortle.ccsu.ctstateu.edu/CS151/cs151java.html
14 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
T o assist you in this course, the appointed tutor will conduct five tutorials. Each
tutorial will be two hours long and will be held on weekends. Tutorials are face-
to-face sessions that enable you to exchange ideas and experiences and make contact
with others. This will benefit you.
Note: These sessions complement distance learning materials, and not replace them
in the form of lectures. In this course, the primary means of learning is through
the written word - that is, through WOU’s study materials, textbook and online
references.
Tutors
The appointed tutors will:
• Be available, at certain times, for consultation with the students via online
and if necessary by telephone.
Tutors are the first point of contact with the WawasanLearn for the students. If the
students need any information or have any problems, they should speak to the tutors
before contacting the Course Coordinator.
16 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Assessment Total
Unit Self-study Hours Tutorial Hours Hours
Tutorials Time
Unit 1 15 2 TMA 1 3 20
Unit 2 20 2 TMA 2 8 30
Unit 3 20 2
TMA 3 8 52
Unit 4 20 2
Unit 5 20 2 22
Total Study Hours 124
TMA policies
The assignment policy of the University as stated in the Student Handbook should
be observed. Students are required to submit assignments for a course in accordance
with the dates communicated by the Course Coordinator. Students may apply for
a submission extension on the grounds of illness, accident, disability, bereavement
or other compassionate circumstances.
Applications for extensions of up to seven (7) days should be submitted to the tutor.
The tutor shall consider valid and unexpected emergencies on an individual basis.
Normally, documented proof of the extenuating circumstances is not required for
extensions of up to seven days. The tutor shall decide and advise you of the revised
date for submission.
For extensions of over seven days, you should note the following:
5.0 Examination
T he final examination counts for 50% of the final course mark. It is three hours
long and consists of:
Type Marks
TMA 1 10%
TMA 2 20%
TMA 3 20%
Final Examination 50%
100%
Examination policies
Students must attend all required scheduled examinations that make up a final grade,
at the appointed time and place.
Any student who misses a scheduled examination without approval will be awarded
“0” marks for the examination.
Passing marks
To pass the course, the students must achieve at least 40% in the continuous
assessment as well as in the final examination. Their performance in these two
components determines their total score for the whole course.
20 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Mark (Percent) ≥ 80 65 – 79 50 – 64 40 – 49 ≤ 39
Grade A B C D F
1. TMA 1 (Appendix I)
Hardware
• Personal Computer with x86 processor (300MHz) or equivalent.
• 256MB RAM.
Software
• Windows 98 Second Edition or newer version.
• Note: The hardware configuration above is the bare minimum. The Java
Software will be provided by WOU, or you can download it from the
official Java website.
22 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 23
A s this course may be the first that you have taken at Wawasan Open University
(WOU), you may not be aware of both the study skills required for distance
learning and how WOU courses are organised. It is recommended, therefore, that
you read this Course Guide thoroughly before looking at the study units or your
textbook. If you have taken WOU courses, you should be well aware of both the
study skills required for distance learning and how WOU courses are organised.
Whichever group you belong to, though, it is recommended that you read this Course
Guide thoroughly before looking at the study units or your textbook.
The Course Guide tells you briefly what the course is about and how you can work
your way through the materials. It also suggests the amount of time you will likely
need to spend in order to complete each unit (and the course), and it gives you a
general idea when your tutor-marked assignments are due.
In distance learning, as practiced by WOU, the study units are coordinated and
prepared in the distance mode of education by your university lecturer. You do not
need to attend face-to-face lectures. This is one of the great advantages of distance
learning. You can read and work through specially designed study material at your
own pace, at times and places that suit you best.
Think of it as reading the lecture notes instead of hearing it from a lecturer. In the
same way that a lecturer might set you some reading to do, the study unit tells you
when to read your textbook or other materials. In the same way that a lecturer might
give you in a class exercise, your study units has exercises (called various names) for
you to do at appropriate points. You are also likely to find review questions at the end
of each unit. Complete them, as these exercises and questions give you the practice
necessary to achieve the objectives of the course and to pass the examination. Even
when you make notes in a direct face-to-face lecture, you are advised to study those
notes and to read and think about them in relation to your textbook. In the distance
mode of education, the course materials replace the live lecture notes.
24 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 25
Appendix I
Tutor-marked
Assignment 1
(TMA 1 - 10%)
26 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 27
Tutor-marked Assignment 1
The intention of this assignment is to assess your understanding of computer concepts
and basic Java programming.
This activity is based on the material in Unit 1, and is also supported by material
in Unit 2.
Instructions:
Your assignment must be word processed (1.5 spacing) and clearly laid out. Any
additional appendices or attachments must be placed at the end of the submitted
document and must be referred to in the main body of the assignment, or it will
not be read by the marker.
Submission
You must submit hardcopy of the assessment.
All files or documents submitted must be labelled with your WOU ID and name.
Please note:
Assessment
This assignment counts 10% towards your total assessment in this course.
[1.5 marks]
[1.5 marks]
[1.5 marks]
4. When you compile a Java source code file (such as Measures.java) with
the javac command, you get a class file (such as Measures.class). What
sort of information is contained in the class file?
[1.5 marks]
What does the word “public” mean here, and why is it necessary?
[1 mark]
Course guide 29
[1 mark]
[1 mark]
7. What is the relationship between the 16-bit Unicode character set and
the 7-bit ASCII character set? Are both supported Java characters?
[1 mark]
The End
30 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 31
Appendix II
Tutor-marked
Assignment 2
(TMA 2 - 20%)
32 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 33
Tutor-marked Assignment 2
The intention of this assignment is to give you experience in applying software
development life cycle (SDLC) using object-oriented methodology.
This activity is based on the material in Unit 2, and is also supported by material in Unit 3.
Your analysis and development of the problem should be within the domain of
given problem.
The assignments in this unit may be discussed in groups of two or three people but
the final document has to be done individually.
Instructions:
Your assignment must be word processed (1.5 spacing) and clearly laid out. Any additional
appendices or attachments must be placed at the end of the submitted document and must
be referred to in the main body of the assignment, or it will not be read by the marker.
Submission
You must submit hardcopy of the assessment.
All files or documents submitted must be labelled with your WOU ID and name.
Please note:
Assessment
This assignment counts 20% towards your total assessment in this course.
Read the following brief description of the Just a Line car validation system.
exit:Barrier
out:Sensor
entrance:Barrier
in:Sensor
Just a Line management wishes to increase security, both in their building and on
site, without antagonising their employees. They would also like to prevent people
who are not part of the company from using the Just a Line car park.
It has been decided to issue identity cards to all employees, which they are expected
to wear while on the Just a Line site. The card records the name, department and
number of the member of staff, and permit access to the Just a Line car park.
A barrier and a card reader are placed at the entrance to the car park. The driver of an
approaching car inserts his or her numbered card in the card reader, which then checks
that the card number is known to the Just a Line system. If the card is recognised, the
reader sends a signal to raise the barrier and the car is able to enter the car park.
At the exit, there is also a barrier, which is raised when a car wishes to leave the car
park. When there are no spaces in the car park a sign at the entrance displays “full”
and is only switched off when a car leaves.
Special visitor cards, which record a number and the current date, also permit access
to the car park. Visitors’ cards may be sent out in advance, or collected from the
reception. All visitors’ cards must be returned to reception when the visitor leaves
Just a Line.
Course guide 35
1. Identify possible objects and derive classes after noun, responsibility and
collaborator analysis from the Just a Line System.
[8 marks]
2. Identify possible attributes of classes and create attribute and class table.
[3 marks]
b. Draw the interactions among the objects and label the operation
involved.
[5 marks]
4. Draw class diagram for the classes with data and operation.
[4 marks]
The End
36 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 37
Appendix III
Tutor-marked
Assignment 3
(TMA 3 - 20%)
38 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 39
Tutor-marked Assignment 3
The intention of this assignment is to give you experience in solving mathematics
problems and writing the code for a simple game using object-oriented methods.
Instructions:
Your assignment must be word processed (1.5 spacing) and clearly laid out. Any
additional appendices or attachments must be placed at the end of the submitted
document and must be referred to in the main body of the assignment, or it will
not be read by the marker.
Submission
You must submit softcopy (virus free) of the working codes and hardcopy of the
answer for assessment.
All files or documents submitted must be labelled with your WOU ID and name.
Please note:
Assessment
This assignment counts 20% towards your total assessment in this course.
1. Write a Java program for exponential raised to power of the user entered
value n (the value of Math.exp(n)). This is the base of natural logarithms
“e” raised to the power n. User only allowed to enter any integer number
between -1 and 20.
Sample output:
[4 Marks]
Course guide 41
2. When cashiers in a store return your change, they try to “fit” dollars first
into the amount you get back, then quarters (25 cent coins), dimes (10
cent coins), nickels (5 cent coins) and finally a few odd cents. For example,
let’s say that your change is 268 cents:
Write a program that reads change due to a user (in cents) and writes out
how many dollars, quarters, dimes, nickels, and pennies she is due. All
variables and all maths in this program will be integers. If you are stuck,
try to do an example problem with paper and pencil.
[5 Marks]
NORTH
WEST EAST
SOUTH
42 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
[4 marks]
[2 marks]
Course guide 43
For example:
[5 marks]
The End
44 WAWASAN OPEN UNIVERSITY
TCC 101 Computing I
Course guide 45
Appendix IV
Specimen Examination
Questions
(Time: 3 Hours)
.../-
Specimen Copy
TCC101
Computing 1
Time: 3 Hours
Instructions to candidates:
1. Please check that this examination paper consists of Fourteen (14) printed
pages before you begin the examination.
3. This paper consists of 4 parts: Part A (10 questions), Part B (20 questions)
and Part C (5 questions) and Part D (4 questions).
4. Answer all questions in Part A, B and C, and three out of four in Part D.
.../-
2
Part A
Please indicate T for True answer and F for False answer in your answer
booklet provided.
Questions T/F
1. Primary storage is sometimes known as the peripheral
equipment of the computer.
2. COBOL is an example of a 1st generation language.
3. All third generation languages are only able to compile.
4. In creating a program you need to frequently revise the source
file, compile new bytecodes, and run the program to see the
result. This process is called the edit, compile and run cycle.
5. Say that your program was compiled without problems, but
when you run it something goes wrong. This is called a bug.
6. An application is a Java bytecode program that runs by help
of a web browser.
7. To convert a string of characters to a double, use the parseDouble()
method of wrapper class Double.
8. When a mechanical machine repeatedly does something in
performing its work it contains a cycle. When a program
repeatedly executes the same statements, it contains a loop.
9. The three things must be coordinated in order for a loop to
run correctly.
a. The initial values must be set up correctly.
b. The condition in the while statement must be correct.
c. The change in variable in the loop body must be correct.
10. A parameter is an item of data supplied to a method when the
method is invoked.
.../-
3
Part B
A. A bite.
B. A bight.
C. A byte.
D. A blight.
.../-
4
A. apple
B. 7up
C. grandTotal
D. boolean
A. (34 - 86) / 3
B. (34 - 86) / -3
C. 34 - 86) / (23 - 3)
D. ( (34 - 86) / (23 + 3) )
class question4{
public static void main ( String[] args ) {
int totalCost = 6;
int items = 12;
System.out.println(“cost per item:” + totalCost/items);
}
}
A. 5
B. -5
C. 2
D. -2
.../-
5
11. What does the following code fragment write to the monitor?
(Notice that the program has changed from the previous question!)
A. Under
B. Over
C. Under the limit.
D. Over the limit.
12. What does the following code fragment write to the monitor?
int sum = 7;
if ( sum > 20 ){
System.out.print(“You win “);
}
else{
System.out.print(“You lose “);
}
System.out.println(“the prize.”);
(Notice that the program has changed from the previous question!)
A. You win
B. You lose
C. You win the prize
D. You lose the prize
.../-
6
String strA;
String strB = new String(“Cheese”);
A. zero
B. one
C. two
D. three
.../-
7
19. What access modifier explicitly says that a method or variable of an object
can be accessed by code outside of the object?
A. private
B. public
C. default
D. static
A. 10 11 12 13 14 15
B. 9 8 7 6 5 4 3 2 1 0
C. 10 9 8 7 6 5
D. 10 9 8 7 6
.../-
8
Part C
Short Questions
(40 marks)
i. Compiler
ii. Class
v. Pseudocode
[5 marks]
[2 marks]
[4 marks]
[3 marks]
b. Write the method header (or signature) for a public class method that
takes as parameters an integer and a String and returns a boolean.
(Note that you DO NOT need to write any code for the class, only give
its header)
[3 marks]
.../-
9
[3 marks]
3. a. Circle the syntax errors in the following code, and state briefly what is
wrong in each case:
int ct;
ct = 0;
while ct < 10 {
ct++;
if (ct % 2 = 0)
System.out.println(ct);
}
[3 marks]
(int)(2 + 4*Math.random())
[3 marks]
class Counter {
public static void main (String[] args) {
int count ;
count =_______ ;
while ( count____ 4 ) {
System.out.println( count );
count = count + ___ ;
}
}
}
[1.5 mark]
...10/-
10
b. The following program is supposed to write out the integers 10, 11, 12,
13, 14, and 15. Decide what should go in the blanks.
class Counter2 {
public static void main (String[] args) {
int j ;
j = ____ ;
while ( j <_____ ) {
System.out.println( j );
j = j + ______ ;
}
}
}
[1.5 marks]
c. The following program is supposed to write out the values 1!, 2!, 3!, 4!,
up to 10!. Fill in the blanks.
class Factorial {
public static void main (String[] args) {
int fact =___ ; // current factorial value
int count = ___ ;// loop control
while ( count __ 10 ) {
fact = fact *_______ ;
System.out.println( count +”! is “ + fact );
count = count + 1 ;
}
}
}
[2 marks]
int count = -2 ;
while ( count < 3 ) {
System.out.print( count + “ “ );
count = count + 1;
}
System.out.println( );
[3 marks]
...11/-
11
[3 marks]
int x = 0;
while ( x < 500 ){
System.out.println( x );
x = x + 5;
}
[3 marks]
...12/-
12
Part D
Long Questions
(30 marks)
[5 marks]
[5 marks]
b. Identify possible attributes of classes and create attribute and class table.
ii. Draw the interactions among the objects and label the operation
involved.
...13/-
13
d. Draw class diagram for the classes with data and operation.
[10 marks]
3. a. Write a complete class definition for a class named Player that meets
the following specifications: An object of type Player represents a player
in a game. The object has private instance variables to represent the
player’s name and score. There is one constructor, with a parameter
that specifies the player’s name. (The player’s score is initially zero.)
The class defines methods for getting the player’s name and score and
for adding a specified number of points to the score.
[5 marks]
b. Write a function
that returns the smallest of all the numbers in the array. You may assume
that the array is non-empty.
[5 marks]
4. Implement the following class into Java codes. The attributes must have
types (int, String and double in this case). You have to write a complete
program without main() method and you are not required to initialise the
class. You should define the class and declare the data variables and
contents for the methods with return statement if required.
Given:
...14/-
14
Telescope
diameter: double
mainLength: double
eyeLength: double
[10 marks ]
...15/-
...16/-