Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
public class vending {
public static void main(String[] args) {
System.out.println("VENDING MACHINE");
System.out.println("SNICKERS: €0,90");
System.out.println("MILKYWAY: €0,95");
System.out.println("TWIX: €1,00");
System.out.println("KITKAT: €0,85");
int SNICKERS = 90;
int MILKYWAY = 95;
int KITKAT = 85;
int TWIX = 100;
int tien, vijf;
int keuze = 0;
int geld = 0;
int hoeveel = 0;
System.out.println("Selecteer jouw product.");
Scanner input = new Scanner(System.in);
keuze = input.nextInt();
System.out.println("Hoeveel cent heeft u?");
geld = input.nextInt();
if ((geld >= 85) && (geld <= 100)) {
switch (keuze) {
case 1:
System.out.println("Je hebt " + geld + " cent ingeworpen.");
System.out.println("Je hebt SNICKERS gekozen. - .90");
hoeveel = geld - SNICKERS;
System.out.println("Jouw wisselgeld: " + hoeveel + "cent");
System.out.println("Je krijgt dit terug: ");
hoeveel = hoeveel % 25;
tien = hoeveel / 10;
hoeveel = hoeveel % 10;
vijf = hoeveel / 5;
System.out.println(tien + " stuiver(s)");
System.out.println(vijf + " kwartje(s)");
System.out.println("Bedankt! En geniet van jouw product.");
System.out.println(" __________________,............., n" +
" /_/_/_/_/_/_/_/_/,-', ,. -,-,--/|n" +
" /_/_/_/_/_/_/_/,-' // /-| / /--/ /n" +
" /_/_/_/_/_/_/,-' `-''--' `' '--/ /n" +
"/_/_/_/_/_/_,:................../ /n" +
"|________,' |/n" +
" """""""""""""""""""""""'");
break;
case 2:
System.out.println("Je hebt " + geld + " cent ingeworpen.");
System.out.println("Je hebt MILKYWAY gekozen. - .95");
hoeveel = geld - MILKYWAY;
System.out.println("Jouw wisselgeld: " + hoeveel + " cent");
System.out.println("Je krijgt dit terug: ");
hoeveel = hoeveel % 25;
tien = hoeveel / 10;
hoeveel = hoeveel % 10;
vijf = hoeveel / 5;
System.out.println(tien + " stuiver(s)");
System.out.println(vijf + " kwartje(s)");
System.out.println("Bedankt! En geniet van jouw product.");
System.out.println(" __________________,............., n" +
" /_/_/_/_/_/_/_/_/,-', ,. -,-,--/|n" +
" /_/_/_/_/_/_/_/,-' // /-| / /--/ /n" +
" /_/_/_/_/_/_/,-' `-''--' `' '--/ /n" +
"/_/_/_/_/_/_,:................../ /n" +
"|________,' |/n" +
" """""""""""""""""""""""'");
break;
case 3:
System.out.println("je hebt " + geld + " cent ingeworpen.");
System.out.println("Je hebt TWIX gekozen. - 1,00");
hoeveel = geld - TWIX;
System.out.println("Jouw wisselgeld: " + hoeveel + " cent.");
System.out.println("Je krijgt dit terug: ");
hoeveel = hoeveel % 25;
tien = hoeveel / 10;
hoeveel = hoeveel % 10;
vijf = hoeveel / 5;
System.out.println(tien + " stuiver(s)");
System.out.println(vijf + " kwartje(s)");
System.out.println("Bedankt! En geniet van jouw product.");
System.out.println(" __________________,............., n" +
" /_/_/_/_/_/_/_/_/,-', ,. -,-,--/|n" +
" /_/_/_/_/_/_/_/,-' // /-| / /--/ /n" +
" /_/_/_/_/_/_/,-' `-''--' `' '--/ /n" +
"/_/_/_/_/_/_,:................../ /n" +
"|________,' |/n" +
" """""""""""""""""""""""'");
break;
case 4:
System.out.println("Je hebt: " + geld + " cent ingeworpen.");
System.out.println("Je hebt KITKAT gekozen -.85");
hoeveel = geld - KITKAT;
System.out.println("Jouw wisselgeld: " + hoeveel + " cent");
System.out.println("Je krijgt dit terug: ");
hoeveel = hoeveel % 25;
tien = hoeveel / 10;
hoeveel = hoeveel % 10;
vijf = hoeveel / 5;
System.out.println(tien + " stuiver(s)");
System.out.println(vijf + " kwartje(s)");
System.out.println("Bedankt! En geniet van jouw product.");
System.out.println(" __________________,............., n" +
" /_/_/_/_/_/_/_/_/,-', ,. -,-,--/|n" +
" /_/_/_/_/_/_/_/,-' // /-| / /--/ /n" +
" /_/_/_/_/_/_/,-' `-''--' `' '--/ /n" +
"/_/_/_/_/_/_,:................../ /n" +
"|________,' |/n" +
" """""""""""""""""""""""'");
break;
default:
System.out.println("Je moet een keuze maken tussen 1 en 4.");
}
} else {
if (geld < 85) {
System.out.println("Je moet boven de 85 cent invullen.");
}
if (geld > 100) {
System.out.println("Je moet onder de 100 cent invullen.");
}
}
}
}
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team