ASSIGNMENT #: ___
METRIC NUMBER : ______________
NAME : ________________________________
TOTAL QUESTIONS ANSWERED: ___
SIGNATURE : __________________ DATE : ______________
|
Date |
Lecture |
Topic |
Quiz |
Assignment |
|
____ |
1 |
Introduction To Computing |
|
|
|
____ |
2 |
Introduction To Programming |
|
|
|
____ |
3 |
Decisions |
1 |
1 |
|
____ |
4 |
Iterations |
|
|
|
____ |
5 |
OOP: Objects (Using Classes) |
2 |
2 |
|
____ |
6 |
OOP: User-defined Classes |
|
|
|
____ |
7 |
OOP: Inheritance and Polymorphism |
3 |
|
|
____ |
8 |
Arrays |
|
3 |
|
____ |
9 |
Data Structures: Lists |
4 |
|
|
____ |
10 |
Data Structures: Stack and Queue |
|
|
|
____ |
11 |
Algorithm Analysis: Sorting and Searching |
5 |
4 |
|
____ |
12 |
Programming Languages I |
|
|
|
____ |
13 |
Programming Languages II |
6 |
5 |
|
____ |
14 |
Applets, HTML and other issues |
|
|
Last updated on May 30, 1999
TA5004 : Assessment
Marks dissection:
Quiz: 5 X 3% = 15%
Assignments: 5 X 5% = 25%
Mid semester exam: = 20%
Final exam: = 40%
Total: 100%
Notes in tests:
Tests (both) will be open-note (printed on a page of A4 paper). You should hand-in the note to be taken in the test one week before the test.
Quiz and Assignment:
Every approximately 2 weeks (see Rough Schedule), you'll take a quiz and have to hand-in an assignment. If you solved your assignment questions very well (on your own) you don't have to worry about taking the quiz since the quiz questions are based on the assignment. The quizzes and assignments cover the topics discussed in the previous 2 lectures. Example -- quiz 1 (3rd week) will cover the topics for lessons in week 1 and 2.
Make-up quiz?
There will be no make-up quiz -- if you missed one, you will get zero mark for that particular quiz. However, at the end of the semester, there will be an extra quiz. Your total quiz mark will be the best five from all six.
<<Back.
-- updated: 13-Jun-99 19:29 --
By following the steps on this page, you can create and use an applet.
Create a file named HelloWorld.java with the Java code shown here:
import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); }}
Compile the source file using the Java compiler.
If the compilation succeeds, the compiler creates a file named HelloWorld.class in the same directory (folder) as the Java source file (HelloWorld.java). This class file contains Java bytecodes.
If the compilation fails, make sure you typed in and named the program exactly as shown above.
Using a text editor, create a file named Hello.html in the same directory that contains HelloWorld.class. This HTML file should contain the following text:
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="HelloWorld.class" WIDTH=400 HEIGHT=300>
</APPLET>
</BODY>
</HTML>
To run the applet, you need to load the HTML file into an application that can run Java applets. This application might be a Java-compatible browser or another Java applet viewing program, such as the Applet Viewer provided in the JDK. To load the HTML file, you usually need to tell the application the URL of the HTML file you've created. For example, you might enter something like the following into a browser's URL or Location field:
d:\javaccj\Hello.html
Once you've successfully completed these steps, you should see something like this in the browser window:

TA5004 - COMPUTER PROGRAMMING
(MSc-IT)
ASSIGNMENT 1 QUESTIONS : INTRODUCTION
TO COMPUTING AND PROGRAMING
There are 5 questions for this assignment.
Email your answer for question 1.
For questions 2 to 5, hand in the hard-copy.
For questions 4 and 5, hand in:
5. Type in the string: >prasyarat6. How many first characters to cut?: >37.
The original, the excerpt and the remaining string: prasyarat, pra, syarat
Sample Run II:
Type in the string: >biadab
How many first characters to cut?: >2
The original, the excerpt and the remaining string: biadab, bi, adab
For some hints, see: a demo of substring().
Due date: 13-June-1999
<<Back to assessment page.
Updated : 06-Jun-99 19:06
TA5004 - COMPUTER PROGRAMMING
(MSc-IT)
ASSIGNMENT 2 QUESTIONS : Decisions
and Loops
There are 3 questions for this assignment. You must answer just 2
questions: question 1 and (question 2 or question 3). Hand in:
2. Type in the string: >kipasThe double: kipas-mengipas
The following samples in the table should make things clear.
|
Input |
Output |
|
tambah |
tambah-menambah |
|
sapu |
sapu-menyapu |
|
kata |
kata-mengata |
|
picit |
picit-memicit |
|
rosak |
Sorry...word did not start with t/s/k/p |
Make a program that ask for some background data of a candidate, and determine whether or not he/she is qualified.
Sample interaction for input:
1. Age? > 25
2. Business experience (years)? > 2
3. Own a registered company (y/n)? > y
4. Is your main job doing business (y/n)? > y
5. Education (1:primary school, 2:LCE, 3:MCE)? > 2
6. Business progress level (1/2/3/4/5)? > 3
7. Passed the pre-interview exam (y/n)? > y
To qualify, a candidate has to satisfy either one of these conditions:
|
|
Condition |
Question # |
|
OR |
Age: between 17 and 50 years old, inclusive AND |
1 |
|
OR |
Age: between 17 and 50 years old, inclusive AND |
1 |
|
OR |
Age: between 17 and 50 years old, inclusive AND |
1 |
|
OR |
Age: between 17 and 50 years old, inclusive AND |
1 |
(Do not try to care about what is "business progress level 2 or 3 or 4"
means. Just program it.)
Output is just one line: whether the candidate is qualified or not.
Note:
i. Total number of vowels (a/e/i/o/u) in the string.
ii.
Total number of words in the string. Assume words are
separated by these separators: either a space, a comma (,), a
fullstop(.)
or an exclamation mark(!).
Note:
c. For simplicity, assume that the string does not start with a separator. It starts with a letter.
d. Your program must be able to handle strings that:
a". I
am strong enough!". one, two".
Sample input and output:
|
Input string |
Output |
|
|
|
|
|
|
|
|
|
Due date: 4/July/1999 -- extended to 7/July/1999
<<Back to assessment page.
Updated : 29-Jun-99 15:26
TA5004 - COMPUTER PROGRAMMING
(MSc-IT)
ASSIGNMENT 3 QUESTIONS : OOP
There are 2 questions for this assignment. For each question, hand
in:
2. PLAYER 1 -- input the phrase and letters to hide
3. input the phrase
4.
5. do
6. read letter to hide
7. hide it (replace the letter with the '-' )
8. while player 2 does not type '.'
9.
10. clear screen: (print 25 empty lines)11.
12. PLAYER 2 -- guessing13. do 14. input a letter to guess15. if hit: 16. replace the '-' with the letter 17. else:18. increment and print out the number of misses so far19.
20. check for settled: is there any '-' left?21.
22. while puzzle is not settled and number of guess not exceeded 10
23.
24. LAST OUTPUT25. if settled26. print "congratulations! " + number of missed27. else print "sorry... you failed."
Sample interaction:
***PLAYER 1***:
Input a phrase > kebersihan jiwa
Phrase input is: kebersihan jiwa
Letter to hide? (. to end)> e
Phrase now: k-b-rsihan jiwa
Letter to hide? (. to end)> i
Phrase now: k-b-rs-han j-wa
Letter to hide? (. to end)> a
Phrase now: k-b-rs-h-n j-w-
Letter to hide? (. to end)> r
Phrase now: k-b--s-h-n j-w-
Letter to hide? (. to end)> s
Phrase now: k-b----h-n j-w-
Letter to hide? (. to end)>
When player 1 type fullstop, the screen clears (by scrolling up) and display this at the bottom:
***PLAYER 2***:
Phrase now: k-b----h-n j-w-
Letter to guess? >
Now player 2 start guessing by typing a letter at the prompt. This is continued until the phrase is completed.
***PLAYER 2***:
Phrase now: k-b----h-n j-w-
Letter to guess? > a
Phrase now: k-b----han j-wa
Letter to guess? > o
No --> 1 misses.
Phrase now: k-b----han j-wa
Letter to guess? > u
No --> 2 misses.
Phrase now: k-b----han j-wa
Letter to guess? > e
Phrase now: kebe---han j-wa
Letter to guess? > r
Phrase now: keber--han j-wa
Letter to guess? > i
Phrase now: keber-ihan jiwa
Letter to guess? > t
No --> 3 misses.
Phrase now: keber-ihan jiwa
Letter to guess? > s
Phrase now: kebersihan jiwa
Congratulations! 3 misses.
Print out this information:
Sample algorithm:
start program
ask for name
while name not equal to "zzz"
ask for scores for sect 1, 2 and 3 create a new object, ex: TestScore st = new TestScore(name, sect1, sect2, sect3); get the total number of students, ex: numOfStudents = st.getStudentNumber(); // or numOfStudents++; if highest score sect1 < sect1 score for the current student then let highest score sect1 be the sect1 score for current student let name of student whose sect1 is highest be the current name. -- the same (if) goes with sect2, 3 and total score sum the sect1 score: use getScore(1) -- the same goes with sect2 and 3 ask for next nameend of while
calculate average
print all output
end program
Due date: 8/Aug/1999
Updated : 20-Jul-99 11:42
TA5004 - COMPUTER PROGRAMMING
(MSc-IT)
ASSIGNMENT 4 QUESTIONS : Arrays
There are 2 questions for this assignment, but you are required to answer
only 1 question. Hand-in: :
Choose only 1 from these 2 questions:
Sample run and output:
> java FindLoopWinner 4 3
start counting from 4,
1 2 3 4 5 6 7 8 9 10
6 is out, start counting from 7,
1 2 3 4 5 7 8 9 10
9 is out, start counting from 10,
1 2 3 4 5 7 8 10
2 is out, start counting from 3,
1 3 4 5 7 8 10
5 is out, start counting from 7,
1 3 4 7 8 10
10 is out, start counting from 1,
1 3 4 7 8
4 is out, start counting from 7,
1 3 7 8
1 is out, start counting from 3,
3 7 8
8 is out, start counting from 3,
3 7
3 is out, 7 is the winner!
Due date: 29/Aug/1999.
Updated : 09-Aug-99 14:28
TA5004 - COMPUTER PROGRAMMING
(MSc-IT)
ASSIGNMENT 5 QUESTIONS : Programming
Languages
There are only 1 question for this assignment.
Specification of document:
Due date: 19-Sep-99
Updated : 01-Sep-99 11:51