1. | Given the following variables and data types:
Write a program based on the following algorithm. Remember to declare the variable first.
| |||||||||||
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:
Post a Comment