You are on page 1of 2

PORTMORE COMMUNITY COLLEGE 

Department of Computer Studies

Intro to Programming Worksheet #1

1. Write a pseudocode that will compute and print the area and perimeter of a
rectangle. The input will contain the length and the width of the rectangle. The
output will contain the length, width, area and the perimeter of the rectangle.

2. Write a pseudocode that reads the radius of a circle and calculates and prints the
circle’s diameter, circumference and area. Use the constant 3.14159 for “pi”.

3. Write a pseudocode that reads three different integers from user and then calculate
and print the sum, average and product.

4. Write a pseudocode that prompts the user to enter two integers, obtain the
numbers from the user and then print the larger number followed by the words “is
larger”. If the numbers are equal, print the message “The numbers are equal”.

5. Write a pseudocode that accepts one number as input from a user and then output
the number and a message indicating whether the number is negative, positive or
zero.

6. Write a pseudocode that takes three different integers from three different users,
and then determine and prints the smallest and largest.

7. Design a pseudocode that will read two numbers and an integer code. The value
of the integer code should be 1,2,3 or 4. If the value of the code is one, then
compute the sum of the two numbers. If the code is two compute the difference
(first minus second). If the code is three compute the product of the two numbers.
If the code is four and the second number is not zero compute the quotient (first
divide by second). If the code is not equal to 1,2,3 or 4 display an error message.
The program is then to display the two numbers, the integer code and the
computed result to the screen.

8. Design a pseudocode that will prompt an operator for a student’s I.D# and exam
score out of 100. Your program is then to match the exam score to a letter grade
and print the grade to the screen. Calculate the letter grade as follows:

Exam score Assigned Grade


90 and above A
80 – 89 B
70 – 79 C
60 – 69 D
below 60 F

9. Design a pseudocode that will receive the weight of a parcel and determine the
delivery charge for that parcel. Calculate the charges as follows:
Parcel Weight Cost per kg($)
<2.5 kg $3.50 per kg
2.5 – 5 kg $2.85 per kg
>5 kg $2.45 per kg
10. Design a pseudocode that will prompt a terminal operator for the price of an
article and a pricing code. Your program is then to calculate the discount
according to the price code and print to the screen the original price of the article,
the discount and the new discounted price. The pricing code and accompanying
discount are as follows:

Pricing Code Discount Rate


H 50%
F 40%
T 33%
Q 25%
Z 0%

If the pricing code is Z, the words “No Discount” are to be printed on the screen.
If the pricing code is not H,T,F,Q or Z the words “invalid pricing code” is to be
printed.

11. A home mortgage authority requires a deposit on home loan according to the
following schedule:

Loan Amount($) Deposits


Less than 25,000 5% of loan value
25,000 – 49,999 $1250 plus 10% of loan over 25,000
50,000 – 100,000 $5000 plus 25% of loan over 50,000

Loans in excess of $100,000 are not allowed. Design a pseudocode that will read
a loan amount and compute and print the required deposit.

12. The tax payable on taxable incomes for employees in a certain country is set out
as follows:
Taxable Income Tax Payable
From $1 to $4461.99 nil
From $4462 to $10000 20%
From $10001 to $25000 25%
over $25000 30%
Design a pseudocode that will read a salary amount and compute and print the
amount of tax to be paid by the employee.

You might also like