Skip to content

A Candy Machine program build with Java on jGRAPS. The program act like a vending maching where you can choose whatever you want, put money, and calculate the rest.

Notifications You must be signed in to change notification settings

mrcllou/Candy-Machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Candy-Machine-Java

๐Ÿฌ Candy Machine (Java) A Candy Machine program built using Java in jGRASP.
This program simulates a vending machine where users can:

  • Select a candy item
  • Insert money
  • Calculate the remaining balance
  • Receive change if needed

๐Ÿ›  Using:

  • Scanner Console
  • If - else if - else statement
  • Basic arithmetic calculations like:
   double change = (money - cost);

โ–ถ๏ธ How it works:

The user chooses between 5 sections of candy.
Then the user inserts the money that they have.
If the user has the perfect amount, nothing is returned,
If they insert more, the user takes the change,
and if the user inserts less money,
The program will say:

System.out.println("You're broke. Take your " + money + " and go elsewhere"); 

๐Ÿ“– This is a homework:

/!\ This is a Java program I wrote for a class assignment. /!\

xoxo.

About

A Candy Machine program build with Java on jGRAPS. The program act like a vending maching where you can choose whatever you want, put money, and calculate the rest.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages