You are on page 1of 3

CMPE 102 PROGRAMMING LOGIC AND DESIGN

Assignment No. 1 – Module 2 – Program Logic Formulation


Due Date: November 15, 2022 - 7:30AM

Use FLOWGORITHM with captured OUTPUT SCREEN of the CONSOLE and


follow the sample documentation as shown in the Short Notes on Program Logic
Formulation hand-out. Note: Provide comment on all your FCD – Name, Purpose of
the FCD, Date of Creation)

PART I.

1. Given three numbers A, B, and C. Construct the algorithm (flowchart and


pseudocodes) to compute and print out the sum, the average, and the product of these
values.

2. Construct an algorithm that will compute for the midterm grade of a student. The
midterm grade is equal to one-third of the minor A exam and two-thirds of the midterm
exam. Print the midterm grade.

3. Construct an algorithm that will input values for A and B. Compare the two values
inputted and print which of the values is higher including the remark “Higher”.

4. Write an algorithm that will input a grade of student and determine whether the grade
is passed or failed. The passing grade is 75. Print the name, grade and remarks of student.

5. Write an algorithm that will display if the inputted age is qualified to vote or not. The
qualifying age is 18 and above.

6.Write an algorithm to read in name and age of student. Display the inputted values.

7. Celsius (centigrade) temperature C can be converted to an equivalent Fahrenheit


temperature F according to the following formula:

F = (9/5)C + 32

Write the algorithm that will read in a Celsius temperature and then output the
equivalent Fahrenheit temperature.

8. The straight-line method for computing the yearly depreciation in value D for an item
is given by the formula

D=P–S

Y
where P is the purchase price, S is the salvage value, and Y is the number of years the
item is used. Write an algorithm that takes as input the purchase price of an item, its
expected number of years of service, and its expected salvage value, and then outputs the
yearly depreciation for the item.

PART II.

1. Draw a flowchart and display the output using FLOWGORITHM apps that
determines if the employee has to be paid of overtime pay (OT). They will be paid
an OT if they exceed 40 hours work in a week, regular pay (RP) if less than or equal
to 40 hours only. Display “OT Pay” or “RP Pay”, based on this condition.

2. Draw a flowchart that determines if the input number is even or odd. Display error
message if an entry is not a number.

3. The initial value of the radius of a circle is equal to one unit and each succeeding
radius is one unit greater than the value before it. Give the algorithm and draw a
flowchart to compute the area of the circle starting with R = 1.0 up to R = 5.0, then
print out each radius and the corresponding area of the circle. Use the formula
Area =∏ r 2 to get the area of the circle. PI has a value of 3.1416.

4. The AXIES Manufacturing Company plans to give a year-end bonus to each of its
employees. Give the algorithm then draw the flowchart which will compute the
bonus of an employee. Consider the following criteria: If the employee’s monthly
salary is less than 1,000.00 pesos, the bonus is 50% of the salary; for employees
with salaries greater than or equal to 1,000.00 pesos, the bonus is 1,000.00. Print
out the name and corresponding bonus of the employee.

5. Draw a flowchart that will display the corresponding remark of a given input
grade. The range of grades and its corresponding remark are given below:

Range of Grades Colors


90 - 100 Excellent
80 -89 Good
75 - 79 Fair
50 - 74 Poor
Other grades Out-of-range
6. Draw a flowchart that will display the corresponding college level of a given
input year level. The year and the college levels are given below:

Year Level College Level


1 Freshmen
2 Sophomore
3 Junior
4 Senior
Other years Unlisted Level

7. Draw the flowchart to read in the age of an individual and determine if it is


qualified to vote or not. The qualifying age to vote is 18 and above. If the age is 18
below, display “Too young!”. Note that there are no such ages as 0 or negative
however display “Invalid age” and if age is above 100 displays “Out of range”.

8. Write the algorithm and draw a flowchart that will calculate the sum of the given
sequence numbers: 1 2 3 4 5. (Show all looping methods – while loop, for loop and
do loop)

That is,
1 + 2 + 3 + 4 + 5
The sum is: 15

9. Given two numbers X and Y, draw a flowchart to determine the difference


between X and Y. If X – Y is negative, compute R = X + Y ; if X – Y is positive,
compute R = X * Y. Print the value of X, Y and R. Assume that X – Y is not equal to
zero.

***** END OF ASSIGNMENT 1 ******

You might also like