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);

No comments:

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