cikqied's: TAK RETI NAK BUAT... ESAIMENKU.. T_T

TAK RETI NAK BUAT... ESAIMENKU.. T_T

1.
Given the following variables and data types:
Variable
Data type
num1, num2
integer
alpha1, alpha2
character
item1, item2
string

Write a program based on the following algorithm. Remember to declare the variable first.
Begin
            input alpha1
            input num1
            input item1
            num2 = 89
            alpha2 = B
            item2 = book
            display num1, num2
            display alpha1, alpha2
            display item1, item2
end.
 












2. 
A manager of a car dealer wants to know statistic about all cars in his premise. As a programmer you are assigned to write a program which will input N information of cars such as price. The program will then display the following information.

a)         The average price;
b)         The highest price;
c)         The number of cheap cars (price below RM30,000.00)
·         Using selection and repetition structure





3.
Write a program to read N data items into two arrays, X and Y, of size 10. Store the product of corresponding elements of X and Y in a third array, Z, also size of 10. Print a three-column table displaying the arrays X, Y, and Z, then compute and print the square of the sum of the items in Z.

Problem solving:

You have to define 3 functions to solve the above problem:

1.    Function INPUT() to read N data and store in array X and Y each.
2.    Function PRODUCT() to store the product of 2 elements in array X and Y and store in array Z. Print a three-column table displaying the arrays X, Y, and Z.

For example: Z[0] = X[0] * Y[0], Z[1] = X[1] * Y[1]…………… Z[9] = X[9] * Y[9].

3.    Function DISPLAY() to compute and print the square of the sum of the items  in Z.



OKAY,, ESAIMEN YANG MUNGKIN XSIAP ESOK..
BNYAK KALI TRY BUAT TP XMENJADI.. T_T



No comments: