Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exiting a program through a switch  RSS feed

Chris Buskulic
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering how I would go about coding an exit for a program in a switch statement. Heres a sample of my code:
switch (option) {
case 'C':
case 'c':
pay *=hours;
System.out.println("Gross pay is" +Utility.moneyFormat(balance));
case 'A':
case 'a':
System.out.println("Chris Buskulic");
case 'E':
case 'e':
E is my exit choice through a menue given to the user.
Jeanne Boyarsky
author & internet detective
Posts: 37180
Eclipse IDE Java VI Editor
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!