6/10/2014

FEP 1023 Intro. to Programming. Contoh Test 1.

Ujian 1 akan di adakan pada ketetapan berikut:-
Tarikh : 19/6/2014
Masa: : 2.30 pm (masa lab)

Contoh soalan adalah seperti berikut:-

1. Respond with the correct answer by marking either True “T” or False “F” for each question.
        I.            High-level languages include C, C++ and C#.                                                                    ( T / F )
  1.  “analyze the problem” means determine the input, process and output.           ( T / F )
    III.            The equation area = length x width can be written in C as:
wages = length x width;                                                                                             ( T / F )
    IV.            Algorithm  is a step-by-step problem-solving process.                                                 ( T / F )
      V.            guarantee that the program will run correctly.                                                                                ( T / F )
    VI.            Semantic rule: rules that specify which statements (instructions)
are legal.                                                                                                                                          ( T / F )
  VII.            Identifier (variable name) must begin with a number.                                                 ( T / F )
VIII.            C is NOT case sensitive - NUMBER is the same as number.                                         ( T / F )
    IX.            bool type has two values: true and false.                                                                           ( T / F )
      X.            Order of Precedence - All operations inside of ()
are evaluated first.                                                                                                                      ( T / F )
    XI.            Variable is a memory location whose content may change
during execution.                                                                                                                         ( T / F )

2. Draw flowchart symbols used for the following:- 
         i.            
Start
        ii.          I.  End
  II. Processing
  III.Decision Making
  IV.Branching
 VConnector


3.    Write C statements that declare the following variables

A Student CGPA                   float CGPA;  (example)
i)              A number of student
ii)             The average of marks 


4.            In C, a value can be inputted from keyboard into integer variable number1 and number2.

Write the C statement to read the values.
scanf(“%d%d”, &number1,&number2);     (example)
i)             Write the C statement to display the values.

ii)            Write the C statement to sum number1 and number2 in store in another variable called MySum.


5. Evaluate the following expressions:

                    I.            10 + 2 / 2
                  II.            3 * 3 + 3 % 2
                III.            3 + 2 / 5 + -2 * 4
                IV.            2 * (1 + -(3/4) / 2) * (2 - 6 % 3)

For each of the following, write a flowchart and a C Program.

6. Write a program that reads the user’s age and then prints “you are a child” if the age <18 18="" adult="" age="" an="" and="" are="" citizen.="" if="" ou="" senior="" you="">=65. (10M)

7. Write a  program that print integer 1 to 50. (10M)

***Mohon Maaf - textnya agak bercelaru

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