1. Define the following terms:
(a) Computer Program
(b) Programmer
(c) Programming
(d) High Level Language
(e) Low Level Language
(f) Computer Bug
(f) Debugging
2. Listed below are correct expressions and incorrect C++
expression corresponding to them. Find the errors and write corrected C++
expressions.
|
Algebra
|
Java Expression
|
Answer
|
(ex)
|
2(3 ÷
a)
|
2(3/a)
|
2*(3/a)
|
(a)
|
(2)(4)+(6)(5)
|
(2)(4)+(6)(5)
|
|
(b)
|
6+18 _____ 2 |
6+18/2
|
|
(c)
|
|
SECTION B
PROBLEM SOLVING
Instructions:
You are required to prepare (i) Pseudocode (ii) Flowchart and (iii) JAVA program for each of the following problems.
1.
Write a program which inputs a length in inches, and outputs its equivalent in centimetres
(1 inch = 2.54 centimetres)
2.
Write a program that calculates mileage reimbursement for a salesperson at a
rate of RM 0.50 per KM. Your program should interact with the user in this
manner:
MILAGE REIMBURSEMENT
CALCULATOR
Enter beginning odometer
reading 13505
Enter ending odometer
reading 13810
You traveled 305 KM
Your reimbursement is RM
152.50
No comments:
Post a Comment