Jump to content

Desperate help needed!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Encryption

Encryption

    Newbie

  • Members
  • Pip
  • 1 posts
Hello all,

I am making a simple "printer" with my college for a project using the BlueJ environment, however, i am getting stuck with the last part.

declare a local boolean
assume false
if (there is paper left)
  make copy
  make boolean true
endif
return boolean

This means that i have to check if there is paper left, print the text etc. Could anyone help me with this process? If more data is needed, please let me know but if not, an outline on what to do would be appreciated. Thank you.

Edited by Encryption, 09 November 2008 - 06:24 AM.


#2
JGRobinson

JGRobinson

    Newbie

  • Members
  • PipPip
  • 22 posts

Encryption said:

Hello all,


declare a local boolean

assume false

if (there is paper left)

  make copy

  make boolean true

endif

return boolean


Working directly from the pseudo code - declare the boolean and make it false

Check that the paper is left and copy if so


boolean isCopyMade = false;

if (isPaperLeft) // another boolean which is false if there is no paper left

{

     makeCopy(); // calling a function to make the copy

     isCopyMade = true;

}

return (isCopyMade)


Hope this helps
Graham - http://programmingtips.co.uk

#3
lucuis

lucuis

    Newbie

  • Members
  • PipPip
  • 21 posts
Should you make a real printing stuff or just a concept?