So the assignment itself says to-

"User enters student grades.
If the student has passed (score >65%), output a notification message.
Else, if the student has failed, output a notification message.
Write a compound if statement to display the letter grade (A = 90-100%, B = 80-89, C = 70-79, D = 66-69, F = <65) of the student."

-However the teacher, nor the book, has really covered how to do that yet. And after sitting here for 3 hours and being close to just not doing the assignment, I am coming here for help. I can get everything BUT the "compound if statement" part to display letter grades. Pseudo code looks okay (?), flowchart not so much (rather, just plain doesn't work). So I'm probably doing something wrong, again. Any ideas?
Are you using any software to create the flowchart or just doing it in word etc?
I have to create the flowchart using Visio.
What about the compound if statement is catching you up, exactly? For starters, are you clear what a compound if is exactly? If not, that sounds like a good place to start. If you do understand it, how would you explain what one is to us?
I don't know what it is, that is what's tripping me up. The teacher doesn't talk about it, nor does the book. And internet searches...provided no help. So I don't know how to write one or how to chart it.
In short, a compound if statement is one that handles many possible alternatives. All of the alternatives are distinct, so only one of them could be true. Here's a pseudocoded compound If statement for printing out the words for the numbers on a die:
Code:
value = die.roll();
If value == 1
Then
Print "One"
Else If value == 2
Then
Print "Two"
Else If value == 3
Then
Print "Three"
...[omitted because you get the idea]...
Print "Six"
EndIf
As you know, an If can have more than one condition:
Code:
value = die.roll();
If value >= 1 and value <= 3
Then
Print "Low roll"
Else If value >= 4 and value <= 6
Then
Print "High roll"
Else
Print "This should be impossible?"
End
Hope this helps.
That's similar to what I was getting to when I was writing it (I was still wrong though). How would you do that in a flowchart though? Is there some type of visual you know of that would show how?
Reikanobi wrote:
That's similar to what I was getting to when I was writing it (I was still wrong though). How would you do that in a flowchart though? Is there some type of visual you know of that would show how?
If I was writing the flowchart myself, I'd simply do it as a series of connect If (diamond) blocks, where the "no" on each block let to the next condition (they're called conditional statements) in the compound If.
Mmm...I'll try and figure this out and get back to you with what I have. First on the list, pseudo code!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement