0% found this document useful (0 votes)
6 views2 pages

Chapter 7

The document outlines various programming concepts, including the distinction between variables and constants, data types, and pseudocode for algorithms related to membership details, weight limits, age restrictions, and discount calculations. It includes tasks such as linking data types to samples, writing pseudocode for specific scenarios, and creating algorithms to find the smallest or largest numbers. Additionally, it discusses employee discounts based on tenure and product type.

Uploaded by

Hasin Eshrak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Chapter 7

The document outlines various programming concepts, including the distinction between variables and constants, data types, and pseudocode for algorithms related to membership details, weight limits, age restrictions, and discount calculations. It includes tasks such as linking data types to samples, writing pseudocode for specific scenarios, and creating algorithms to find the smallest or largest numbers. Additionally, it discusses employee discounts based on tenure and product type.

Uploaded by

Hasin Eshrak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. Explain the difference between a variable and a constat in a program.

2. Five data types and five data samples are shown below. Draw a line to link each data type to
the correct data sample

3. A program will be written to store information about members of a swimming club.


The following membership details will be recorded:

a) Name
b) Gender
c) Status (Either SENIOR or JUNIOR)
d) Fee
e) Team Member (YES or NO)

Choose a suitable data type for each of the membership details to be recorded.

4. A program contains the following code to calculate the circumference of a bicycle wheel,
using the wheel size (diameter).

CONSTANT Pi = 3.14
INPUT WheelSize
Circumference = Pi * WheelSize
OUTPUT Circumference

The code uses one constant and two variables. State the names of the constant and the
variables.
5. Write pseudocode for the following problem.

(a) Input total weight of passengers in a lift output "Overloaded, step out" if Total Weight is
above 600 otherwise output "Ready to go".

(b) Input age of candidates for driving license, output "Not allowed to drive" or "Kindly fill
in the form". The minimum allowed age for driving is 18 years.

(c) Input age of candidate in an employment center, output "You are not eligible due to age".
Allowed age is between 18 and 60 both inclusive.

(d) Which inputs price and quantity calculate amount and if billing amount is above 5000
then allows a 5% discount on the billing amount. Output billing amount, discount and
amount after discount.

6. Using pseudo code & flowchart, write an algorithm which will input any three numbers and
then print the smallest number.

7. Write an algorithm to input three different numbers and then output the largest number. Use
either pseudo code or a flow chart.

8. Write an algorithm using pseudocode to input three different numbers, Multiply the two
larger numbers together and output the result. Use the variables: Number1, Number2 and
Number3 for your numbers and Answer for your result.

9. Write an algorithm using pseudocode to input a number between 0 and 100 inclusive. The
algorithm should prompt for the input and output an error message if the number is outside
this range

10. Input price and quantity, Calculate amount and if billing amount is above 5000 then allow a
5% discount on the billing amount.

Output the billing amount, The discount and the amount after the discount.

11. Employees of a shop are entitled to a discount of 10% on the value of goods bought from the
shop. However, if an employee has worked at the shop for 5 or more years they are entitled
to a discount of 20%. Only employees are allowed discounts. The discount on electrical
goods is fixed at only 10%.

Using pseudocode or otherwise write an algorithm which will determine what discount
applies when any person buys an item.

You might also like