Question
Instructions: Find the error in each problem below. Explain what the error is as well as how to fix it. Indicate what will happen (if
Instructions: Find the error in each problem below. Explain what the error is as well as how to fix it. Indicate what will happen (if anything) if the error is not corrected.
Problem 1
Module main()
Declare real otRate
Call getRate(otRate)
Display The overtime pay rate is , otRate, "."
End Module
Module getRate()
Display "Enter the rate for working over 40 hours"
Input overtimeRate
End Module
Problem 2
Module main()
Call showNumberOfPeople(8)
End Module
Module showNumberOfPeople(Integer Ref num)
Display "The number of people attending is ", num, "."
End Module
Problem 3
Module main()
Call raiseToPower(7, 2.3)
End Module
Module raiseToPower(Real value, Integer power)
Declare Real result
Set result = value^power
Display result
End Module
Problem 4
Module getContestantNumber()
Declare integer entryNumber
Display "What is the entry number of contestant Number 1?"
Input entryNumber
Declare integer entryNumber2
Display "What is the entry number of contestant Number 2?"
Input entryNumber
End Module
Problem 5
Module main()
Declare real age, dogYears
Display "Enter the age of your dog"
Input age
Call computeDogYears(age, dogYears)
Call displayDogYears(age, dogYears)
End Module
Module computeAge(real dogAge, real ref dogYears)
Set dogYears = dogAge * 7
End Module
Module displayDogYears(real dogAge, real dogYears)
Display "Your dog is ", dogAge " years in age."
Display "Your dog is ", dogYears, " years in dogYears."
End Module
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started