Professional Documents
Culture Documents
10 11 12 13 14
20 21 22 23 24
30 31 32 33 34
a. Write an appropriate selection statement based on the table 1 below. The selection of grade
based on the input of mark.
Mark Grade
89.5-100 A
74.5-89.4 B
64.5-74.4 C
< 64.4 F
Table 1
Write a program using for and while loop to generate the following outputs
Write a program base on the pseudocode given below. Your program must use string function such as
strlen,strcpy and strcat.
Begin
Display Please enter username
Accepts username
Display Please enter password
Accepts password
Display length for username
Display length for password
Identify the username similar with “Default”
• If similar
o Indentify the password similar with “123456”
▪ If similar display “Authorize User”
• Else display “Unauthorized user”
End
You are required to write a program to calculate the marks and give the grade based on the table below and print the
result slip for each student. This program should have a main() function, grade() function , average() function and a
display() function. All functions must be called from the main() function. You are required to use if..else statements
for this question.
Grade table
Marks Grade
80<=marks<=100 A
70<=marks<=79 B
65<=marks<=69 B-
60<=marks<=64 C
Marks>59 F
The screen shot of the program is as below
Write a program that request the user to enter eight numbers. The program will then determine whether the numbers
entered can be divided by 3 or not. The program must be able to keep a list for those numbers that can be divided by
3 and another list for those numbers that cannot be divided by 3. You have to use arrays to help you keep a list of
numbers. Finally display which numbers that can be divided by 3 and which numbers that cannot be divided by 3
Enter Number 1: 8
Enter Number 2: 15
Enter Number 3: 5
Enter Number 4: 3
Enter Number 5: 9
Enter Number 6: 13
Enter Number 7: 12
Enter Number 8: 18
Destination
Enter Destination :1
Enter quantity :3
Bill
Destination :1
Price :RM 100.00
Quantity :3
Payment :RM 300.00