Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

ISBN: 3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago