100% found this document useful (1 vote)
120 views2 pages

Problem Solving Using Programmed Solutions

The document provides 6 problems to design algorithms and programs for using pseudocode and flowcharts. The problems include: 1) performing mathematical operations on an integer, 2) calculating mortgage deposits based on loan amounts, 3) generating tables of square and cube values within a range, 4) counting even numbers in an array of integers, 5) calculating the product of integers in an array, and 6) counting occurrences of vowels in a character array.

Uploaded by

Ayu Wulandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
120 views2 pages

Problem Solving Using Programmed Solutions

The document provides 6 problems to design algorithms and programs for using pseudocode and flowcharts. The problems include: 1) performing mathematical operations on an integer, 2) calculating mortgage deposits based on loan amounts, 3) generating tables of square and cube values within a range, 4) counting even numbers in an array of integers, 5) calculating the product of integers in an array, and 6) counting occurrences of vowels in a character array.

Uploaded by

Ayu Wulandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Problem Solving Using Programmed Solutions

For each of the following problems, design the solution using pseudocode and flowcharts:

1. You are to design an algorithm that will receive an integer from the screen, add 5 to it,
double it, subtract 7 from it, and display the final number to the screen.

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

Loan amount $ Deposit


less than 25,000 5% of loan value
25,000 - 49,999 $1250 + 10% of loan
50,000 - 100,000 $5000 + 25% of loan

Loans in excess of $100,000 are not allowed. Design a program, which will read a loan
amount and compute and print the required deposit. The program should terminate when an
invalid loan amount is entered by the user.

Sample input-output:
Enter loan amount (Key in –999 to end) : 10000
The deposit is : $500.00

Enter loan amount (Key in –999 to end) : 25000


The deposit is : $3750.00

Enter loan amount (Key in –999 to end) : -999

3. Design in pseudocode or flowchart an interactive program that reads a low value, a high
value, and an increment value, ensures that the low value is less than or equal to the high
value, and computes and prints a table of square and cube values from low to high at
increments of increment.

Sample input-output :

Low value : 1
High value : 5
Increment : 1

Value Square Cube


1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
4. Design a program that will read 10 integers from the user and store them in an array called
val[]. The program should then determine how many of the numbers entered by the user are
even.
Sample input-output :
Key in 10 numbers : 1 2 3 4 5 6 7 8 9 10
The total number of even numbers entered are : 5

5. Design a program that will read a series of integers from the user and store them in an array
called num[]. The program should then calculate and display the product of all integers
entered by the user.

Sample input-output :
Enter total numbers to read : 5
Key in 5 numbers :
365 47

The product : 2520

6. Design an algorithm that will read an array of 200 characters and display to the screen a
count of the occurrences of each of the five vowels (a, e, i, o, u) in the array.

You might also like