473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

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)
Oct 28 '09 #1
2 3381
chaarmann
785 Expert 512MB
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).
Oct 30 '09 #2
Frinavale
9,735 Expert Mod 8TB
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
Nov 4 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Michael Lauzon | last post by:
A while back, I had a program that I was working on, while taking Java in a Web Design & Development course -- this was back in 1999 -- not having the mindset of a programmer I failed that part of...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
11
by: Lues | last post by:
Hi, I'm trying to protect some data in tables with encription (you know why, don't you ;)) I must confess that I'm not very expirienced in writing code, especially encription code. Can any...
2
by: Barney | last post by:
I have to convert a Java app to .NET, i found and used the conversion tool which converts java to C#, but it only converted about 10% of it, how hard would it be to re-write the java app and keep...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
17
by: Terry Jolly | last post by:
New to C# ---- How do I convert a Date to int? In VB6: Dim lDate as long lDate = CLng(Date) In C#
4
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Hello all, I'm trying to convert a Java Genetic Programming program to C#. I don't know how to convert the following Java code: Object choice = functionSet.getSelectedItem(choice)).value();...
3
by: Ethan Furman | last post by:
len wrote: I've never had the (mis?)fortune to work with COBOL -- what are the files like? Fixed format, or something like a dBase III style? I
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.