DrupalBin
Submit Code
About
Recent Posts
Drupal 5 menu
1 hour 25 min
ago
Views 2 get all field names
2 hours 8 min
ago
Code
2 hours 46 min
ago
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
5 hours 37 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for java
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
public class FrisdrankAutomaat { //attributes private int kostprijs; private int bedrag = 200; //constructors public FrisdrankAutomaat(int kostprijs){ setKostprijs(kostprijs); } //getters public int getKostprijs(){ return kostprijs; } public int getBedrag(){ return bedrag; } //setters public void setKostprijs(int kostprijs){ this.kostprijs=kostprijs; } public void setBedrag(int bedrag){ this.bedrag=bedrag; } //methode //printers public void printWisselgeld(){ int aantal100; int aantal50; int aantal20; int aantal10; int aantal5; int aantal2; int aantal1; if(bedrag >= kostprijs){ int wisselgeld=bedrag-kostprijs; System.out.println("Totaal aantal wisselgeld " + wisselgeld + " Prijs " + kostprijs + " Gegeven bedrag " + bedrag); aantal100=wisselgeld/100; int rest=wisselgeld%100; if(aantal100 !=0){ System.out.println(aantal100 + " munt(en) van 1 euro"); } aantal50 = rest / 50; rest=rest%50; if(aantal50!=0){ System.out.println(aantal50 + " munt(en) van 50 cent"); } aantal20=rest/20; rest=rest%20; if(aantal20!=0){ System.out.println(aantal20 + " munt(en) van 20 cent"); } aantal10=rest/10; rest=rest%10; if(aantal10!=0){ System.out.println(aantal10 + " munt(en) van 10 cent"); } aantal5=rest/5; rest=rest%5; if(aantal5!=0){ System.out.println(aantal5 + " munt(en) van 5 cent"); } aantal2=rest/2; rest=rest%2; if(aantal2!=0){ System.out.println(aantal2 + " munt(en) van 2 cent"); } aantal1=rest/1; rest=rest%1; if(aantal1!=0){ System.out.println(aantal1 + " munt(en) van 1 cent"); } } } }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.