Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!