Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exiting a program through a switch

 
Chris Buskulic
Greenhorn
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));
break;
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
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic