7/24/2013

DCT1083 Programming Fundamentals : Chapter 1 Exercise

A. State whether the following are valid identifiers or invalid identifier. If the identifier names are valid, state why.

(example) 1m234 - invalid: begins with a number

power                          Valid; mnemonic
add_5                          Valid; mnemonic
a2b3c4d5                    Valid; not mnemonic
abcd                            Valid; not mnemonic                 
return                                Invalid; C++ keyword
123435                        Invalid; begins with a number
amount                        Valid; mnemonic
1A2345                        Invalid; begins with a number
while                          Invalid; C++ keyword
int                              Invalid; C++ keyword
$taxes                        Invalid; begins with a special character



contoh jawapan untuk soalan 2 (b).
#include
using namespace std;

int main()
{
  cout << "The time has come.";
  return 0;
}



7/22/2013

DCT1043 COA Exercise Chapter 1 & 2



CHAPTER 1 & 2

1. In your own words, describe what software is, supporting your answer with appropriate example. (3 marks).


2.The history of computers can be divided into generations, with each generation defined by a technological breakthrough. List 6 generations of computers. (6 marks).



3.List 3 Input/ Output Devices (3 marks).
 

4. Convert these binary values to decimals (4 marks).



i.1010101
ii. 100111

5.Convert these decimal values to binary (4 marks).

i.    82
ii.    175

7/16/2013

DCT 2112 Programming Practical. Flowchart Exercise 17/7/13


An electric supply company charges the following rates for its customers:-

No. of unit consumed                              Charges/unit (RM)
1-200                                                           2.50
201 - 500                                                     3.50                                                  
over 501                                                       5.00

If the consumer pays his bill within 15 days from the bill date, 10% discount is given
. If he makes the payment after 15 days from the bill date, 5% surcharge is levied. Draw a flowchart to calculated the net amount of the bill for each consumer and print it.

the above flowchart not considered the calculation of discount and levied

7/15/2013

DCT 2112 Programming Practical. Flowchart Exercise

Write an algorithm  for a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values, not counting zeros. Your program ends with the input 0. Display the average as a floating-point number. (For example, if you entered 1, 2, and 0, the average should be 1.5.)


*Flowchart di atas masih lagi belum memenuhi  kehendak soalan supaya cetak "average" bagi semua nilai yang di masukkan.

7/14/2013

7/11/2013

DCT 2112 Programming Practical - LAB 10/7/13 (solution)

Solution for DCT 2112 Programming Practical - LAB 10/7/13


Question 1
Question 3
 


Question 4

Write a program that read length and width of a rectangle and output it perimeter and area


7/10/2013

DCT1083 Programming Fundamentals : LAB 1

  •  Programming is a process of problem solving
  •  Problem solving techniques:-
    • Analyze the problem & Outline the problem requirenment
    • Design steps (algorithm) to solve the problem
    • Write a program 
 Exercise 1


Exercise 2
Write a program to find the area of a rectangle. The area of the rectangle is given by the following formula:
area = length x width

 














Exercise 3
Write program that calculates mileage reimbursement for a salesperson at a rate of RM 0.65 per kilometer. 

Your program should interact with the user in this manner :
Enter beginning odometer reading : 13505.5
Enter ending odometer reading :13810.6
You traveled 305.4 km 
Your reimbursement is RM 198.51 

7/09/2013

DCT 2112 Programming Practical - LAB 10/7/13

Write an algorithm (Flowchart) for the following problems:-

1. Write program that calculates mileage reimbursement for a salesperson at a rate of RM 0.65 per kilometer. Your program should interact with the user in this manner :












7/08/2013

DCT 2112 Programming Practical

DCT 2112 Programming Practical ialah subjek yang akan mengasah kemahiran pelajar dalam pengaturcaraan. Berdasarkan suatu masalah - pelajar di kehendaki membina algorithma dan seterusnya menulis aturcara java. 


Dalam subjek ini - pelajar akan di minta membuat persembahan (presentation) terhadap algorithma dan aturcara yang telah di bina (secara berkumpulan). 

Pelajar di minta memberi perhatian yang lebih pada subjek  DCT 1093 Object Oriented Programming (oleh Puan Izzah Inani) kerana bahasa java akan di ajar di sana.

Bahan-bahan pengajaran adalah seperti berikut:-


2. Nota Kuliah (slide power point)
Sila guna bahan rujukan bagi subjek DCT 1093 Object Oriented Programming atau buku berikut :-
Y. Daniel Liang, Introduction to Java™ Programming, Brief Version, 8 Edition. 2011. Pearson Education. 
Chapter 1 Introduction to Computers, Programs, and Java (download)
Chapter 2 Elementary Programming (download)
Chapter 3 Selections (download)
Chapter 4 Loops (download)
Chapter 5 Methods (download)
Chapter 6 Arrays (download)

3. Perisian
Bagi menulis pseudocode - pelajar boleh menggunakan mana-mana word processing seperti microsoft, manakala untuk membina flowchart - microsoft visio adalah di cadangkan.

Bagi menulis aturcara java - pelajar boleh menggunakan dua software iaitu: 1) JDK (java development Kit)  2) Editor seperti jcreator atau Netbeans. Jcreator Version standard boleh di download dari link berikut, manakala untuk version professional boleh di dapati dari saya.

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...