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

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?

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.