ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 11.00

Part 1 - Review the following pseudo code

d

Part 1 - Review the following pseudo code and answer the question below.

void main()

                  Integer num = 0

printWelcome ()  

num = num + 1

printAnswer(num) 

num = num + 1

printAnswer()  

                  printClosingMessage()  

end module

void printAnswer(Integer answer)     

                  output “The answer is “ + answer

end module

void printWelcomeMessage()             

                  String welcome = “Welcome to my program”

output welcome

end module

void printClosingMessage()

output “Thank you for using my program”

end module

output “Thank you for using my program” 

Part 1 Questions:

What are the problems with this code?  Mark each line that is a problem and make corrections to fix the problem.  You may need to strike through code, change code, or add code.Mark each line of code above where module calls are made.Are there any parameters in this code?  If so, complete the table:

Parameter Name

Data Type

Scope - Module

Corresponding Argument

       
       

Are there any local variables in this code?  If so, complete the table:

Local Variable Name

Data Type

Scope – Module

     
     

 

Part 2 - Review the following pseudo code and answer the question below.

void main()

                  Real celsius = 0.0

                  Real fahrenheit = 0.0

                  fahrenheit = celsiusTofahrenheit(celsius)

                  output “The Fahrenheit is “ + Fahrenheit

                  displayClosingMessage()

end module

void displayWelcomeMessage()       

                  output “Welcome to my program”

end module

void displayClosingMessage()            

                  output “”

                  output “Thank you for using my program”

end module

Real celsiusToFahrenheit(Real cTemp)

                  Real fTemp

                   fTemp = (cTemp * (9 / 5)) + 32          

                  return fTemp

end module

Real fahrenheitToCelsius(Real fTemp)

                  Real cTemp

                  cTemp = (fTemp – 32) * (5 / 9)           

                  return cTemp

end module

Part 2 Questions:

You can assume that there are no problems in the pseudo code above.

  • Mark each line of code above where module calls are made.
  • Are there any parameters in this code?  If so, complete the table:

Parameter Name

Data Type

Scope - Module

Corresponding Argument

       
       
  • Are there any local variables in this code?  If so, complete the table:

Local Variable Name

Data Type

Scope - Module

     
     
     
     
  • What is the output from the program?
 

 

 

Homework Assignment #4 – Questions about Modules in Pseudo Code
Part 1 - Review the following pseudo code and answer the question below.
void main()
Integer num = 0
printWelcome ()
num = num + 1
printAnswer(num)
num = num + 1
printAnswer()
printClosingMessage()
end module
void printAnswer(Integer answer)
output “The answer is “ + answer
end module
void printWelcomeMessage()
String welcome = “Welcome to my program”
output welcome
end module
void printClosingMessage()
output “Thank you for using my program”
end module
output “Thank you for using my program” Part 1 Questions:
1. What are the problems with this code? Mark each line that is a problem and make corrections to fix the
problem. You may need to strike through code, change code, or add code. 2. Mark each line of code above where module calls are made. 3. Are there any parameters in this code? If so, complete the table: Parameter Name 4. Data Type Scope - Module Corresponding Argument Are there any local variables in this code? If so, complete the table:
Local Variable Name Data Type Scope – Module Part 2 - Review the following pseudo code and answer the question below.
void main()
Real celsius = 0.0
Real fahrenheit = 0.0
fahrenheit = celsiusTofahrenheit(celsius)
output “The Fahrenheit is “ + Fahrenheit
displayClosingMessage()
end module
void displayWelcomeMessage()
output “Welcome to my program”
end module
void displayClosingMessage()
output “”
output “Thank you for using my program”
end module
Real celsiusToFahrenheit(Real cTemp)
Real fTemp
fTemp = (cTemp * (9 / 5)) + 32
return fTemp
end module
Real fahrenheitToCelsius(Real fTemp)
Real cTemp
cTemp = (fTemp – 32) * (5 / 9)
return cTemp
end module Part 2 Questions:
You can assume that there are no problems in the pseudo code above.
5. Mark each line of code above where module calls are made.
6. Are there any parameters in this code? If so, complete the table:
Parameter Name
Data Type
Scope - Module 7. 8. Are there any local variables in this code? If so, complete the table:
Local Variable Name
Data Type What is the output from the program? Corresponding Argument Scope - Module

 

Attachments:

Answers

(11)
Status NEW Posted 02 May 2017 07:05 AM My Price 11.00

-----------

Attachments

file 1493708972-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)