3/28/2011

DCT1063 Exercise file

Assume that each of the following statements applies to the same program.

Write a statement that opens file oldmast.dat for input; use an ifstream object called inOldMaster.

Write a statement that opens file trans.dat for input; use an ifstream object called inTransaction.

Write a statement that opens file newmast.dat for output , use ofstream object outNewMaster.

Write a statement that reads a record from the file oldmast.dat. The record consists of integer accountNumber, string name and floating-point currentBalance; use ifstream object inOldMaster.

3/27/2011

BCT1333 Markah-markah OS

Markah untuk Quiz 1, Quiz 2 dan test 1. Kertas boleh ambil di bilik saya. TQ.

No.

Matric No.

Course

Quiz 1 10/1/11 (8 marks)

Quiz 2 (15 marks) + 1 for bonus

test 1 (100)

1

10B04002

BCBM

8

15

73.8

2

10B04005

BCBM

8

16

73.8

3

10B04007

BCBM

8

15

82.1

4

10B04009

BCBM

8

16

91.7

5

10B04010

BCBM

7

15

92.9

6

10B04015

BCBM

8

16

97.6

7

10B04016

BCBM

8

15

83.3

8

10B04020

BCBM

7

16

92.9

9

10B04021

BCBM

6

16

70.2

10

10B04023

BCBM

8

15

84.5

11

10B04024

BCBM

8

15

82.1

12

10B04030

BCBM

8

16

85.7

13

10B04031

BCBM

8

15

86.9

14

10B04032

BCBM

8

16

79.8

15

10B04033

BCBM

8

15

89.3

16

10B04034

BCBM

8

15

100.0

17

10B04035

BCBM

8

15

83.3

18

10B04036

BCBM

7

15

88.1

19

10B04037

BCBM

8

15

76.2

20

10B04041

BCBM

8

15

88.1

21

10B04042

BCBM

8

15

90.5

22

10B04044

BCBM

6

15

73.8

23

10B04046

BCBM

t.h

t.h

#VALUE!

24

10B04048

BCBM

7

15

65.5

25

10B04049

BCBM

8

15

94.0

26

10B04050

BCBM

8

15

92.9

27

10B04055

BCBM

7

15

54.8

28

10B04056

BCBM

8

15

65.5

29

10B04701

BCBM

6

15

86.9

30

10B04704

BCBM

8

15

86.9

31

10B04757

BCBM

8

15

77.4

31

10B04038

BCBM

8

15

70.2

BCS1333 ASSIGNMENT 3

ASSIGNMENT 3 (chapter 10)

1. A file attribute is metadata that describes or is associated with a computer file. Typically there are 7 common file's attributes. Briefly explain each of them.


2. There are four (4) pieces of information are associates with an open file. Explain each of them.




3. Consider a file system where a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occurs if a new file is created in the same storage area. How can these problems be avoided?




3/23/2011

INSEP: Computer Technology and CCTV


Program : INSEP : Computer Technology and CCTV
Subjek : PC Maintenance
Perkara : Perubahan Jadual waktu No 2 INSEP


Perubahan jadual waktu adalah bagi subjek TECH. COMM.
Jadual asal ISNIN : 11:00 - 1:00 , RABU : 2:00 - 5:00 dan KHAMIS : 8:00 - 1:00 adalah
di tukar kepada tarikh dan masa seperti berikut:-

27/3 8-11am (3 jam)
6/4 2 - 6.30pm (4 jam 30 min)
10/4 8-11 am (3 jam)
13/4 2-6.30pm (4 jam 30 min)
14/4 8-1pm (5 jam)

Segala kesulitan atas perkara di atas amat di kesali.



BCT1113 QUIZ2#2

QUIZ 2#2 - FUNCTION

Write a prototype for the following functions:


Example : Computing an average of three integers.

double Tambah (int, int, int)

1. Computing an average of two integers. double average (int ,int );

2. Computing a sales commission, given the sales amount and the commission rate. double comm (double , double)

3. Computing a revised salary, given the current salary and percentage of increment. double gajibaru (double, double);

4.Printing the calendar for a month, given the month and year. void cetakbulan(int, int);

5.Computing a square root. double sqrt(double)

6.Testing whether a number is even, and returning true if it is. bool ujiNoGenap (int);

7.Testing whether a score is passed and returning trure if it is. bool ujimarkah (double);

8. Printing a message a specified number of times. void cetakmsg(string,int);

9. Computing the monthly payment, given the loan amount, number of years, and annual interest rate. double bayaran(double, int, double);

10.Finding the corresponding uppercase letter, given a lowercase letter. char hurufbesar(char);

void hurufbesar(char);


3/20/2011

DCT1063 QUIZ

QUIZ – ADVANCED DATA TYPE

Write a single statement or a set of statement to accomplish each of the following.


  1. Define a structure called Komputer containing double variable harga and char array model whose values may be as long as 25 characters.

    [3 marks]

struct komputer {

double harga;

char model[25];

};


  1. Declare variable ACER to be of type Komputer and array HP[10] to be of type Komputer.

[3 marks]

struct komputer ACER, HP[10];


  1. Read a PC Price and a PC model from the keyboard into the individual members of variable ACER.

[2 marks]

cin>>ACER.harga;

cin>>ACER.model;



  1. Assign the member values of variable ACER to element 3 of array HP.

[2 marks]

HP[2].harga = ACER.harga;

HP[2].model = ACER.model; //strcpy(HP[2].model, ACER.model);

3/19/2011

INSEP: Computer Technology and CCTV

Program : INSEP : Computer Technology and CCTV
Subjek : PC Maintenance
Perkara : Jadual waktu No 2 (20/3/11 HINGGA 21/4/2011 (4 MINGGU))


3/15/2011

DCT1063 p2 Array of structures

#include<iostream>

using namespace std;


 

struct pelajar

{

    double CPA,CGPA;

    char Nama[40];


 

};


 

int main(void)

{

int i;

pelajar DEIS[5];

// --------------baca data----------------


 

for(i=0;i<=4;i++)

{

    cout<<" Sila masukkan nama pelajar ";

    cin>>DEIS[i].Nama;


 

    cout<<" Sila masukkan CPA dan CGPA Pelajar ";

    cin>>DEIS[i].CPA>>DEIS[i].CGPA;


 

}

//-------------cetak data-----------------


 

for(i=0;i<=4;i++)

{

    cout<<"Nama :"<<DEIS[i].Nama<<endl;

    cout<<"CPA :"<<DEIS[i].CPA<<endl;

    cout<<"CGPA :"<<DEIS[i].CGPA<<endl;

}

return 0;


 

}

3/01/2011

BCS1333 OS

ASSIGNMENT 2

TRUE/FALSE

Chapter 4: Multithreading

  1. A thread is a flow of control within a process. [ T / F ]
  2. A multithreaded process contains several different flows within the same address space.[ T / F ]
  3. The benefits of multithreading include decreased responsiveness to the user.[ T / F ]
  4. User-level threads are threads that are visible to the programmer and are unknown to the kernel.[ T / F ]
  5. In general, user-level threads are faster to create and manage than are kernel threads.[ T / F ]

Chapter 5: CPU Scheduling

  1. * some questions missing here

SHORT ANSWER

Chapter 4: Multithreading

  1. Briefly explain single-threaded process and a multithreaded process and how they are differs.


     

  2. The benefits of multithreaded programming can be broken down into four major categories (Responsiveness, Resources Sharing, Economy, utilization of multiprocessor): Briefly explain each of them.
  3. Explain the three models of multithreading

Chapter 5: CPU Scheduling

  1. There a re five (5) criterion that have been suggested for comparing CPU scheduling algorithms. List and briefly explain each of them.


     

  2. Consider the following set of processes that arrive at time 0, with the length of the CPU burst given in milliseconds:


 

Process        Burst Time         Priority

P1            15            3

P2            10            1

P3            3            3

P4            5            2

P5            9            4

The processes are assumed to have arrives in order P1,P2,P3,P4,P5 all at time 0.

  1. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms : FCFS, SJF, nonpreemptive priority ( a smaller priority number implies a higher priority), and RR (quantum = 5).


     

  2. What is the average waiting time of each process of the scheduling algorithms in part a?


     

  3. What is the turnaround time of each process of the scheduling algorithms in part a?


     

  4. Which of the algorithms in part a results in the minimum average waiting time (over all processes)?


 

Due date 14/3/2011

BCT1113 C.P. ASSIGNMENT 2

PART A

1. Fill in the blanks in each of the following statements:


 

  1. Typically, ______
    statements are used for counter-controlled repetition and _____
    statements are used for sentinel-controlled repetition.


 

  1. The ________repetition statement tests the loop-continuation condition at the end of the loop.


 


 

  1. The ______
    statement can be used only for testing constant integral expressions.


 


 

  1. When used as a condition, any nonzero value implicitly converts to _____; 0 (zero) implicitly converts to ________.


 


 

  1. In addition to selection and repetition statements, the ________
    and _________statements are used with control statements to alter the flow of control.


 

 

for

while

do…while

switch

true

break

continue

false

 


 

2. Fill in the third column in the following tables:

expression1

expression2

expression1 || expression2

false

false

 

false

true

 

true

false

 

true

true

 


 

expression1

expression2

expression1 && expression2

false

false

 

false

true

 

true

false

 

true

true

 


 


 


 

PART B

1. Write a program to output even numbers 1 to 20 using three types of loop statement (while, do-while and for).


 

  1. C++ program using 'while'
  2. C++ program using 'do-while'
  3. C++ program using 'for'


 


 

2. Write a program that input a grade. If the grade is less than 0 or greater than 100, your program should print the appropriate message informing the user that an invalid grade has been entered. Start with a pseudocode and flowchart.


 


 

  1. PSEUDOCODE


 

  1. FLOWCHART


 

2.3    C++ PROGRAM


 

  1. Write a program that input ten (15) integers. Print out the sum of those integers.


     

    1. PSEUDOCODE


 

  1. FLOWCHART


 

3.3    C++ PROGRAM


 


 

Due date : / 03 /2011

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