954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pseudocode- module passing

Hello, I am having trouble writing the pseudocode for the following question. Any advice as to what I may be missing or doing wrong would be greatly appreciated.

Question:
Plan the logic for a program that contains two modules. The first module prompts the user for a grade on an exam. Pass the grade to a second module that prints "Pass" if the grade is 60 percent or higher and "Fail" if it is not.

My pseudocode:

start
num grade
print “Enter exam percentage:”
get grade
gradePercent (grade)
print grade
stop

num gradePercent(grade)
if gradePercent < 60 then
print “Fail”
else
print”Pass”
return gradePercent

2fac323
Light Poster
26 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

You can get rid of this: print grade
and change your module to this:

gradePercent(grade){
if gradePercent < 60 then
print “Fail”
else
print”Pass”
}

If you do those two things, you will have fulfilled your requirements. So what's the problem?

BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
 

Well first I found out that I need two modules. And between start and stop there should only be one statement- and it should be a call to a module. So I have one module correct I guess i need to determine the other. Also, in the statement: num gradePercent(grade) I was told I was missing a required word in front of grade.

You can get rid of this: print grade and change your module to this:

gradePercent(grade){ if gradePercent < 60 then print “Fail” else print”Pass” }

If you do those two things, you will have fulfilled your requirements. So what's the problem?

2fac323
Light Poster
26 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You