COMP 200 assignment 3

5 Oct No Comments

Assignment 1

A normal resting heart rate for an adult usually ranges from 60 to 100 beats a minute. Generally, a lower heart rate at rest implies more efficient heart function and better cardiovascular fitness.

Write a program that displays “Heart rate is normal” if the heart rate variable a user enters is within the “normal” range. If the heart rate is outside this range, then display “Heart rate is abnormal.”

Pseudo code

Flow chart

  • Initialize heart rate =0,
  • If heart rate >=60 and heart rate =<100 then
  • Heart rate is abnormal
  • Else
  • Heart rate is normal

Assignment 2

To test more than one condition, you can nest a decision structure inside another decision structure.

Write a program in pseudocode that will allow the user to enter their annual income and then display the tax percentage for that income level.

Income Tax
Below $5000 0%
$5000 – 10,000 2%
$10,001 – 15,000 5%
$15,001 – 20,000 7%

Your document must include:

Pseudo code for the entire program.

Flow chart

  • Initialize income,
  • Initialize tax rate,
  • ‘please enter your income’
  • Display income
  • If income <=500 then
    • Tax rate=0%
    • Ifelse income >500 and <= 1000 then
    • Tax rate=2% ifelse
    • Income>10000 and <=15000 then
    • Tax rate=5 % else
    • Tax rate= 7%

Assignment 3

Based on the scenario you selected in the Module 01 Course Project, you should expand on your documentation by adding If-Then-Else or at least 1 series of conditions to your program. Your documentation of this addition should include the following:

Internal documentation, using block and/or line comments.

You must declare all variables before using them in your pseudo code.

Your pseudo code must illustrate all calculations.

Your flowchart must depict each step in the program.

Your flowchart must use 3 types of symbols: ovals (start and end terminal symbols), parallelograms (input and output symbols), and rectangles (processing symbols).

All symbols must be connected by arrows that represent the flow of the program. The flow must make logical sense.




Click following link to download this document

COMP 200 assignment 3.docx