Connecting Tech Pros Worldwide Forums | Help | Site Map

Can someone please convert this pseudo code into Java code? The way I would in Java.

Newbie
 
Join Date: Oct 2009
Posts: 1
#1: 4 Weeks Ago
Expand|Select|Wrap|Line Numbers
  1. Dim MyMoney As Single
  2. Dim DRolls As Integer
  3. Dim NRolls As Integer
  4. Dim PRolls As Integer
  5. Dim QRolls As Integer
  6. Dim RemainingChange As Single
  7. MyMoney = 28.24
  8.  
  9. QRolls = Int(MyMoney / 10)
  10. MyMoney = MyMoney - QRolls * 10
  11. DRolls = Int(MyMoney / 5)
  12. MyMoney = MyMoney - DRolls * 5
  13. NRolls = Int(MyMoney / 2)
  14. MyMoney = MyMoney - NRolls * 2
  15. PRolls = Int(MyMoney / 1)
  16. MyMoney = MyMoney - PRolls * 1
  17. RemainingChange = Int(MyMoney * 10) / 10
  18. MsgBox(QRolls)
  19. MsgBox(DRolls)
  20. MsgBox(NRolls)
  21. MsgBox(PRolls)
  22. MsgBox(RemainingChange)

Expert
 
Join Date: Nov 2007
Location: Germany
Posts: 294
#2: 4 Weeks Ago

re: Can someone please convert this pseudo code into Java code? The way I would in Java.


If you have basic understanding of Java, it should be easy for you. There is nothing difficult inside.
If you have no understanding of Java, you can get the programming basics of java within a few hours to solve this task. What you need here is only the knowledge of chapter 1 of any java beginners tutorial.

So what's the problem?
Why can't you do it yourself?

Please describe where you are stuck.

(Tip: Use the simple System.out.print() here instead of reading about the complex Swing/AWT Messageboxes).
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#3: 3 Weeks Ago

re: Can someone please convert this pseudo code into Java code? The way I would in Java.


Well the above posted code isn't pseudo code.
It is VB code.

It looks pretty straightforward to me...
What do you have converted into Java so far?
What do you not understand how to convert?

-Frinny
Reply