debug the following
1)
// The main program calls a method that
// prompts for and returns a name
start
Declarations
string usersName
name = askUserForName()
output "Your name is ", usersName
stop
string askUserForName()
Declarations
string name
output "Please type your name "
input usersName
return
2)
// The main program passes a user’s entry to
// a method that displays a multiplication table
// using the entered value. The table includes the
// value multiplied by every factor from 2 through 10.
start
Declarations
num usersChoice
output "Enter a number "
input usersChoice
multiplicationTable(choice)
stop
void multiplicationTable(num value)
Declarations
num LOW = 2
num HIGH = 10
num x
num answer
x = LOW
while x <= HIGH
answer = value * num
output value, " times ", x, " is ", answer
x = answer + 1
endwhile
return answer
3)
// The main program prompts a user for a Social
// Security number, name, and income, and then
// computes tax. The tax calculation and the output
// of the taxpayer’s report are in separate modules.
// Tax rates are based on the following table:
// Income ($) Tax rate (%)
// 0–14,999 0
// 15,000–21,999 15
// 22,000–39,999 18
// 40,000–69,999 22
// 70,000–99,999 28
// 100,000 and up 30
start
Declarations
string socSecNum
string name
num income
num taxDue
output "Enter Social Security number "
input socSecNum
while socSec <> "0"
output "Enter name "
input name
output "Enter annual income "
input income
taxDue = taxCalculations()
output taxReport(socSecNum, name, taxDue)
output "Enter Social Security number or 0 to quit "
input socSecNum
endwhile
stop
Get Answers For Free
Most questions answered within 1 hours.