0% found this document useful (0 votes)
71 views4 pages

Chapter 3 EOC Problems

The document contains 6 diagrams that describe solutions to different problems. Each diagram shows the input, processing, and output for the problem. The processing section describes the algorithm used to calculate the output from the input. The algorithms prompt for input values, perform calculations on the values, and display the output.

Uploaded by

SUM ONE
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
0% found this document useful (0 votes)
71 views4 pages

Chapter 3 EOC Problems

The document contains 6 diagrams that describe solutions to different problems. Each diagram shows the input, processing, and output for the problem. The processing section describes the algorithm used to calculate the output from the input. The algorithms prompt for input values, perform calculations on the values, and display the output.

Uploaded by

SUM ONE
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/ 4

1.

Defining Diagram

Input Processing Output


Char_1 Prompt for Char_1, Char_2, Wel_msg
Char_3
Get Char_1, Char_2, Char_2

Char_2
Char_3
Solution Algorithm

Compute_Wel_msg

Prompt operator for Char_1, Char_2, Char_3

Read Char_1, Char_2, Char_3

Wel_msg = Char_1 + Char_2 + Char_3

Display ‘Hello’

Display wel_msg

Display ‘We hope you have a nice day. ‘

End

2.

Input Processing Output


Integer_1 Prompt for integer_1, integer_2 Sum
Get integer_1, integer_2 Difference
Calculate sum, difference, Product
product, and quotient Quotient
Integer_2

Solution Algorithm

Calculate_sum_difference_ product_quotient

PROMPT for integer_1, integer_2

GET integer_1, integer_2

sum= integer_1 + integer_2

difference= integer_1 – integer_2

product= integer_1 * integer_@

quotient= integer_1 / integer_2

DISPLAY sum, difference, product, quotient to screen


END

3.

Input Processing Output


Integer Prompt for integer final_number
Get integer
Calculate_final_number Add 5,
Double integer, Subtract 7 from
integer
Display final_number

Solution Algorithm

Calculate_final_number

PROMPT for integer

GET integer

Calculate_final_number= [(integer +5) *2]-7

DISPLAY final_number to the screen

END

4.

Input Processing Output


Tax_rate Read tax_rate total_price
price_1 Read five prices tax_payable
price_2 Calculate total_price
price_3 Calculate tax_payable
price_4 Print total_price, tax_payable
price_5
Solution algorithm

Five_Item_Price_And_Tax

PROMPT FOR tax_rate

GET tax_rate

PROMPT FOR price_1, price_2, price_3, price_4, price_5


GET price_1, price_2, price_3, price_4, price_5

total_price = price1 + price2 + price3 + price4 + price5

taxPayable = total_price * (tax_rate/100)

DISPLAY tax_payable , total_price

END

5.

Input Processing Output


account_balance Read account_balance, New_balance
total_withdrawls,
total_deposits
Calculate New_balance
Print New_account_balance
total_withdrawls
total_deposits

Solution Algorithm

Calculate_new_account_balance

Read account_balance

Read total withdrawls

Read total deposits

New balance = account_balance – total withdrawls + total deposits

Federal_tax = .01 * (total_withdrawls + total_deposits

New_account_balance = new_balance – federal_tax

Print New_account_balance

END
6.

Input Processing Output


regular_hrs Read regular_hrs, overtime_hrs, Weekly_payment
wage_rate
calculate regular_hrs,
overtime_hrs, wage_rate
Print weekly_payment
overtime_hrs
wage_rate

Solution algorithm

Calculate weekly_paynment

Read regular_hrs

Read overtime_hrs

Read wage_rate

Regular payments = regular_hrs * wage_rate

Overtime_payment = overtime_hrs * (wage_rate*1.5)

Weekly_payment = overtime_payment + regular_payment

Print weekly_payment

END

You might also like