Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

is this two programs gonna give same result?which one is better and why? program one ------------------------ // Global constant for contribution Rate constant Real CONTRIBUTION_RATE

is this two programs gonna give same result?which one is better and why? program one ------------------------ // Global constant for contribution Rate constant Real CONTRIBUTION_RATE = 0.05 Module main() // display an intro about the program call intro() // local variables decalre Real annualGrossPay declare Real totalBonuses //get employee's gross pay call getGrossPay(annualGrossPay) // get employee's total bonuses call getBonuses(totalBonuses) //calculate and show gross pay contribution call showGrossPayContrib (annualGrossPay) // calcuate and show bonuses contribution call showBonusesContribution(totalBonuses) End Module Module intro() display " this program will show gross display " pay and bonuses contribution display " for the retirement account" End Module // the grossPay Module gets // the gross pay and stores it // in the reference variable Module getGrossPay(Real Ref grossPay) display "enter the annual gross pay" input grossPay End Module //getBonuses Module gets the total bonuses // and stores it in bonus reference variable Module getBonuses(Real Ref bonus) display"enter the total bonuses" input bonus End module //the showGrossPayContrib accepts //grossPay as an argument and shows // gross pay contribution Module showGrossPayContribution(Real grossPay) declare Real grossPayContrib set grossPayContrib= CONTRIBUTION_RATE * grossPay display" the gross pay contribution is $",grossPayContrib End Module // the showBonusContrib accepts bonus variable // as an argument and shows total bonus contribution Module showBonusContrib(Real bonus) declare Real bonusContrib set bonusContrib = CONTRIBUTION_RATE * bonus display " the total bonus contribution is $",bonusContribution End Module program two ------------------------- // this program to calculate //gross pay and bonus //contribution to Retirement plan constant Real CONTRIBUTION_RATE = 0.05 Module main() call intro() call getGrossPay() call getBonus() End Module //show intro about what the program will do Module intro() display"this program will show" display "grosspay contribution" display"and bonus contribution display"toward Retirment plan" End Module //get the annual gross pay Module getGrossPay() declare Real gross display "enter annual gross pay amount" input gross call showGrossPayContrib(gross) End Module //show gross pay contribution Module showGrossPayContrib(Real gross) declare Real grossContrib set grossContrib = gross * CONTRIBUTION_RATE display"gross pay contribution: $",grossContrib End Module // get the Total Bonus amount Module getBonus() declare Real bonus display "enter total bonus amount" input bonus call showBonusContrib(bonus) End Module // show bonus contribution Module showBonusContrib(Real bonus) declare Real bonusContrib set bonusContrib= bonus * CONTRIBUTION_RATE display "Total Bonus contributionL: $",bonusContrib End Module

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Find the value of permutation. 8P3

Answered: 1 week ago