ANALYSIS TUTORIAL: BASICS OF ANALYSIS AND DESIGN
1. A Parallelogram is a four sided geometric figure in which two of the opposite
sides are equal and parallel. The area (A) of the parallelogram is given as the
product of the base (b) and height (h). Note that:
• A = b * h (NB: * implies multiplication)
• The height h is the distance between the two parallel lines.
2. Write a program that adds two numbers entered by the user and display the
result.
3. You are tasked with writing a program that will calculate the area of a square
using the formula Area = length2. The length of one side of the square is
provided by the user.
4. To calculate the total retail price of a product in a supermarket, the retail price
of the item being purchased and the VAT (value added tax) rate must be
provided to the person in charge of determining the total retail price. Once these
items have been provided, the person calculates the VAT ratio, VAT amount
and Total retail price as:
- VAT ratio is the VAT rate divided by 100
- VAT amount is the retail price multiplied by the VAT ratio
- Total retail price is the sum of the retail price and the VAT amount.
5. Write a program that asks the user for four numbers and outputs the average
of the four numbers.
6. You are tasked with writing a program that calculate the area of a circle using
the formula Area = PI * radius2. Where PI is given to you as 3.14159 and the
radius of the circle is provided by the user.
7. You are at a restaurant and need to calculate the total cost of your meal. Write
a program that will calculate the tip amount and the total cost and display it to
the user. The bill amount and the tip percentage are provided by you the user.
Note that:
- The tip percentage will have to be converted to a ratio before it can
be used
- The tip is the tip percentage of the bill amount
- Total cost is the tip plus the bill amount
8. Write a program that will be used to display the body mass index (BMI) of a
user. The user will be asked to provide their weight and height. The program
will then calculate the BMI as: weight divided by the square of the height.
9. A human resource officer is required to submit NHIMA returns for an employee.
The required employee information is the name, NRC and salary. Each return
has two contributions: an employee contribution and employer contribution,
both of which are 1% of the salary. Your task is to write a program that will help
the human resource officer calculate these returns. Your program should
display the Name, employee contribution and the employer contribution at the
end.