pseudo code questions, Exercises of Computer Science

pseudo code questions and exercises .

Typology: Exercises

2019/2020

Uploaded on 11/06/2020

aya-abdelnaem
aya-abdelnaem 🇪🇬

5

(1)

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithm Sheet
Show the Analysis Requirements before the each of the following Questions:
1. Draw a flowchart and write pseudocode to represent the logic of a program that
allows the user to enter a value. The program divides the value by 2 and outputs
the result.
2. Draw a flowchart or write pseudocode to represent the logic of a program that
allows the user to enter two values. The program outputs the product of the
two values.
3. Draw a flowchart or write pseudocode to represent the logic of a program that
allows get the salesperson’s base salary, total sales, and commission rate. The
program shows the salesperson’s pay by adding the base salary to the extra
incentive calculated form the commission rate.
4. If you walk into a bank and open up a savings account, you will earn interest on the money
you deposit in the bank. If the interest is calculated once a year then the interest is called
“simple interest”. If the interest is calculated more than once per year, then it is called
“compound interest”.
Compound Interest Formula
The mathematical formula for calculating compound interest depends on several factors. These
factors include the amount of money deposited called the principal, the annual interest rate (in
decimal form), the number of times the money is compounded per year, and the number of years
the money is left in the bank.
These factors lead to the formula
FV = future value of the deposit
P = principal or amount of money deposited
r = annual interest rate (in decimal form)
n = number of times compounded per year
t = time in years.
Write a flowchart that show the future value of the deposit, if other values are given.
5. Write a flowchart that find the sum of 5 numbers
6. Write a flowchart that shows your age in years, months, weeks, days, hours, minutes, and
seconds.

Partial preview of the text

Download pseudo code questions and more Exercises Computer Science in PDF only on Docsity!

Algorithm Sheet

Show the Analysis Requirements before the each of the following Questions:

1. Draw a flowchart and write pseudocode to represent the logic of a program that

allows the user to enter a value. The program divides the value by 2 and outputs

the result.

2. Draw a flowchart or write pseudocode to represent the logic of a program that

allows the user to enter two values. The program outputs the product of the

two values.

3. Draw a flowchart or write pseudocode to represent the logic of a program that

allows get the salesperson’s base salary, total sales, and commission rate. The

program shows the salesperson’s pay by adding the base salary to the extra

incentive calculated form the commission rate.

  1. If you walk into a bank and open up a savings account, you will earn interest on the money you deposit in the bank. If the interest is calculated once a year then the interest is called “simple interest”. If the interest is calculated more than once per year, then it is called “compound interest”. Compound Interest Formula The mathematical formula for calculating compound interest depends on several factors. These factors include the amount of money deposited called the principal, the annual interest rate (in decimal form), the number of times the money is compounded per year, and the number of years the money is left in the bank. These factors lead to the formula FV = future value of the deposit P = principal or amount of money deposited r = annual interest rate (in decimal form) n = number of times compounded per year t = time in years. Write a flowchart that show the future value of the deposit, if other values are given.
  2. Write a flowchart that find the sum of 5 numbers
    1. Write a flowchart that shows your age in years, months, weeks, days, hours, minutes, and seconds.