1/30/2011

BCT1113 Test 1 (sample)

1. Respond with the correct answer by marking either True "T" or False "F" for each question.

a) High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java

b) Compiler: translates a program written in a high-level language machine language

c) Preprocessor directives begin with # and are processed by a the preprocessor

d) Use the compiler to: Check that the program obeys the rules

e) Linker: Combines object program with other programs provided by the SDK to create executable code

f) Programming is a process of problem solving

g) Algorithm: Step-by-step problem-solving process

h) Two popular approaches to programming design: - 1) Structured 2) Object-oriented

i) The structured design approach is also called Modular Design


2. Print the output of the following C++ statement. If nothing prints, then answer "nothing". Assume x=3 and y=2.

Example) cout<<x; 2


a) cout<<y;

b) / * cout<<y; */

c) // cout<<x+y;

d) cout<<x<<y;

e) cout<<x<<endl<<y;

f) cout<<x+y;

g) cout<<"x+y="<<x+y;

h) cin>>x%y;

i) cout<<++x;

j) cout<<y++;


3. Print the output of the following C++ statement. If nothing prints, then answer "nothing".


a) if(1<3)

cout<<"Yes";

else

cout<<"No";


b) char race='M';

if ((race=='m') ||( race =='M')) then

cout<<"Malay";

else

cout<<"Others";


c) char race='M';

int age = 21;

if ((race=='m') &&( age <=20)) then

cout<<"MARA LOAN";

else

cout<<"PTPTN LOAN";


4. What is the output of the following C++ code segment:-


char race;

int age;

cin>>race>>age;

if(race='m')

if(age<=20)

cout<<"MARA LOAN";

else

cout<<"PTPTN LOAN";

else

cout<<"OTHER LOAN";


a) When the user inputs "C" for race and 21 for age

b) When the user inputs "C" for race and 18 for age

c) When the user inputs "m" for race and 21 for age

d) When the user inputs "m" for race and 18 for age


5. Prepare an algorithm (pseudo code or flowchart) and write a C++ program for each of the following problem.


a) Write a program to find perimeter and area of a rectangle. The perimeter and area of the rectangle are given by the following formulas:

perimeter = 2 * (length + width)

area = length * width


b) Write a program to read user id and password .if the password is "abubakar" and password is 6855 then print out "Your password is accepted". Otherwise print "Not Accepted".

1/29/2011

Jadual Solat Kemaman dan Dungun

Abu Hurairah menceritakan bahawa beliau mendengar Rasulullah bertanya kepada sahabatnya: "Adakah kamu percaya bahawa kotoran melekat pada tubuh seorang yang mandi lima kali sehari dalam sungai yang mengalir di depan rumahnya?"

Jawab sahabat: "Tidak, kotoran tidak akan melekat pada tubuhnya."

Sabda Rasulullah: "Begitulah umpamanya kesan solat yang dikerjakan lima kali sehari. Dengan limpah rahmat Allah, ia menghapuskan segala dosa."

Jadual solat untuk bagi daerah Kemaman dan Dungun boleh di dapati daripada pautan ini. Manakala bagi tempat-tempat boleh rujuk pada sumber asal iaitu e-solat JAKIM.


* Gambar-gambar yang tertera adalah di Masjid India KL.

1/26/2011

1/24/2011

DCT1063 P2 : Pointer and Array


A pointer is a variable that contains a memory address. An array is a variable that holds multiple values of the same type. In C++, there is a close relationship between pointers and arrays. In fact, frequently a pointer and an array are interchangeable.


What is output of the code above, why?

1/23/2011

BCS1333 ASSIGNMENT 1

--updated 25/jan/11---------------------------------------------

Here are some of the materials for Assignment1

Chapter 1 : INTRODUCTION. Wiley - Operating Systems Concepts

Chapter 2 : OS STRUCTURES. Wiley - Operating Systems Concepts

Chapter 3 : PROCESSES . Wiley - Operating Systems Concepts

------------------------------------------------------------------

1. In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in carious security problems. [chapter 1]

  1. What are two such problems?
  2. Can we ensure the same degree in a time-shared machine as in a dedicated machine? Explain your answer.

2. Describe the differences between symmetric and asymmetric multiprocessing. What are three advantages and one disadvantage of multiprocessor systems? [Chapter 1]

3. Distinguish between the client-server and peer-to-peer models of distributed systems. [chapter 1]

4. Direct memory access is used for high-speed I/O devices in order to avoid increasing the CPU's execution load. [chapter 1]

  1. How does the CPU interface with the device to coordinate the transfer?
  2. How does the CPU know when the memory operations are complete?

5. Give two reasons why caches are useful. What problems do they solve? What problems do they cause? [chapter 1]

6. What are the two models of interprocess communication? What are the strengths and weakness of the two approaches? [Chapter 2]

7. What is mechanism? What is policy? Why is the separation of both desirable? [Chapter 2]

8. What is the main advantage for an operating-system designer of using a virtual-machine architecture? What is the main advantage for the user? [Chapter 2]

9. Describe the differences among short-term and long-term scheduling. [Chapter 3]

10. Describe the actions taken by a kernel to context-switch between processes. [Chapter 3]

11. What are the benefits and disadvantages of each of the following? Consider both the system level and programmer level. [Chapter 3]

  1. Synchronous and asynchronous communication
  2. Send by copy and explicit buffering
  3. Fixed-sized and variable-sized messages



1/22/2011

DCT 1063 ASSIGNMENT 1

1. Answer each of the following. Assume that integer numbers are stored in 4 bytes, and that starting address of the array is at location 1000 in memory. Each part of question should use the result of previous part where appropriate. [20 marks]


  1. Declare an array of type integer called numbers with 10 elements, and initialize the element to the values 1,2,3,4,5,6,7,8,9,10,

[2 marks]

  1. Declare a pointer Ptr that points to an object of type integer.

[2 marks]

  1. Print the element of array numbers using array subscript notation. Use looping structure (for/while/do..while) and assume the integer control variable i has been declared.

[5 marks]

  1. Assign the starting address of array numbers to the pointer variable Ptr.

[2 marks]

  1. Print the element of array numbers using pointer with the pointer
    Ptr. Use looping structure (for/while/do..while) and assume the integer control variable i has been declared.

[5 marks]

  1. Assuming that Ptr points to the beginning of array numbers, what address is referenced by nPtr + 9? What value is stored at that location?

[2 marks]

  1. Assuming that Ptr points to the numbers[8], what address is referenced by nPtr -= 4? What value is stored at that location?

[2 marks]

2. Assume that each of the following statements applies to the same program. ( 10 marks)


a) Write a program that prompts user to enter:-


  1. Name
  2. Matric
  3. Course
  4. CPA


b) Read the data above (a) and write into a file named student.txt as follows.


Name : Ahmad Ashraaf

Matric: 09A04035

Course: CIS

CPA: 3.6


3. Write a program that reads student.txt (as created in 3 b), display its content to screen. (10 Marks)

1/19/2011

BCT1113 Computer Programming ASSIGNMENT 1

Assignment 1 BCT 1113. Sila download di sini.

Tugasan pertama ini akan menguji kemahiran ' problem solving ' pelajar dalam menyelesaikan masalah seharian.

Pelajar di minta menyediakan Algorithma (flowchart dan pesudoce) serta program C++ bagi setiap masalah yang di berikan.

Tarikh Hantar ialah pada : 17/2/2011.

'Viva' untuk setiap pelajar akan di buat selepas semua tugsan di terima.

1/17/2011

Update Blog melalui MS WORD

Anda boleh membuat posting blog melalui MS Word 2007 / 2010. Klik Menu "File" pilih "New" dan pilih " Blog Post".


Selepas itu anda anda di minta memasukkan beberapa maklumat seperti :-

  1. Username dan Password (akaun blog anda)
  2. Blog provider
  3. Image provider

Dengan menekan button "publish" pada aplikasi MS Word. Posting anda akan di hantar terus ke Blog yang di daftarkan. Selamat mencuba.

Virtual Machine


Virtual Machine (VM) membolehkan lebih dari satu Sistem Pengoperasian (Operating System (OS)) beroperasi serentak pada satu sistem komputer (pada masa yang sama).

Ianya berbeza dengan sistem 'dual boot' yang membenarkan pengguna memilih satu OS semasa 'startup'.








OS yang berada dalam VM di panggil "guest OS". OS ini berkomunikasi dengan perkakasan komputer melalui sistem pengurusan yang di panggil "virtual machine monitor (VMM)".


Di antara perisian VM yang ada ialah:-

1. VirtualBox
2. VMWare Workstation
3. VirtualPC
















Sun VirtualBox








VM Ware Workstation 7









Microsoft Virtual PC

1/11/2011

Pen Drive Data Recovary


Saya pernah mengalami 2 kes di mana usb drive yang di gunakan menunjukkan status.

used space=0 bytes
free space = 0 bytes

Sistem komputer akan mengeluarkan option untuk format drive tersebut.

Dalam sesetengah keadaan - fail-fail dalam drive tersebut masih boleh di selamatkan. Fail tersebut masih berada di situ (usb drive) cuma File Allocation Table (FAT)nya terpadam atau rosak. FAT seumpama rekod inventory bagi fail.

Terdapat banyak aplikasi yang boleh di gunakan untuk "USB DRIVE RECOVARY". Salah satunya ialah Data Docter Recovary.


Proses "recovary"nya amat mudah - selepas beberapa "click" pasti membuatkan anda tersenyum bila fail-fail penting dapat di selamatkan. Namun aplikasi ini adalah berbayar. Saya cuba mencari aplikasi yang percuma - tapi masih belum jumpa. Jika anda tahu mengenainya (aplikasi percuma drive recovary) mohon berkongsi maklumat.

1/10/2011

DCT1063 PROGRAMMING 2 Quiz 1

1. Show output of the following C++ program.














Output
A 0x000123C12 // given
B 3
C 0x000123C12
D 3


2. Write a C++ code that declares two pointers to integers. Initialize one to NULL, another to point to the address of int variable x.

int *P1 = NULL;
int *P2 = &n;

20 shortcuts keys


Mengguna 'shortcuts key' memang membantu mempercepatkan proses kerja. Antara shortcuts keys yang biasa kita guna adalah utk copy dan paste iaitu ctrl+C dan ctrl +V.

Di senaraikan 20 shortcuts keys yang boleh membantu memudahkan kerja di komputer :-



  1. Windows key + E = Explorer
  2. Windows key + Break = System properties
  3. Windows key + F = Search
  4. Windows key + D = Hide/Display all windows
  5. ALT + Tab = Switch between windows
  6. ALT, Space, X = Maximize window
  7. CTRL + Shift + Esc = Task Manager
  8. CTRL + C = Copy
  9. CTRL + X = Cut
  10. CTRL + V = Paste
  11. CTRL + Z = Undo an action
  12. CTRL + Y = Redo an action
  13. CTRL + A =Select all items in a document or window
  14. F1 = Display Help
  15. F2 = Rename the selected item
  16. F3 = Search for a file or folder
  17. F4 = Display the Address bar list in Windows Explorer
  18. F5 = Refresh the active window
  19. F6 = Cycle through screen elements in a window or on the desktop
  20. F10 = Activate the menu bar in the active program

1/09/2011

BCS1333 Operating System LAB

LAB 10/01/2010
Chapter 2 - OS Structure

What is the purpose of system calls?

. 2. What are the five major activities of an Operating System with regards to process management?

. 3. What are the three major activities of an Operating System with regards to memory management?

. 4. What are the three major activities of an Operating System with regards to secondary-storage management?

. 5. What is booting? Explain the process completely by using your own idea of illustration. You can use any picture or diagram to support the explanations.

. 6. What is Virtual Machine? Explain it completely by using your own idea of illustration. You can use any picture or diagram to support the explanations.

. 7. What is VMWare? Explain it completely by using your own idea of illustration. You can use any picture or diagram to support the explanations.


1/02/2011

BCS1333 Operating System

Berikut adalah senarai bahan-bahan kuliah untuk BCS 1333 Operating System
Semester 2010-2011 II.

Chapter 1 : Introduction to OS
Chapter 2: OS_Structures-2


buku: OS_Concepts_by Abraham_Silberschatz_2009 (8ed)

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.  ...