Skip to content

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

 
 
 

Contributors

Languages