Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
2.C
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' //Name:A.Razak_reg.no:191FA07051; import java.util.*; import java.lang.*; class Rextester { static Scanner sc = new Scanner(System.in); static int option; public static void main(String args[]) { System.out.println("Welcome to Powered Air Service. What would like to do?"); while(true) { System.out.println(" 1.Know my balance.\n 2.Know my validity date.\n 3.Know number of free calls available.\n 4.More\n 5.Exit"); option = sc.nextInt(); switch(option) { case 1: balance(); break; case 2: validity(); break; case 3: free_calls(); break; case 4: more(); break; case 5: exit(); break; default: System.out.println("Invalid Option.");break; } } } public static void balance() { // code to check balance System.out.println("Your current balance is \"Balance\".\n"); } public static void validity() { // code to check validity System.out.println("Your current package expires on \"Date\".\n"); } public static void free_calls() { // code to check free calls System.out.println("You have \"FreeCalls\" left.\n"); } public static void more() { more: while(true)//labeling the loop { System.out.println(" 1.Prepaid Bill Request.\n 2.Customer Preference.\n 3.GPRS activation.\n 4.Special Message Offer\n 5.Special GPRS offer.\n 6.3G Activation. \n 7.back <-"); option = sc.nextInt(); switch(option) { case 1: System.out.println("This is option 1 in more\n"); break; case 2: System.out.println("This is option 2 in more\n"); break; case 3: System.out.println("This is option 3 in more\n"); break; case 4: System.out.println("This is option 4 in more\n"); break; case 5: System.out.println("This is option 5 in more\n"); break; case 6: System.out.println("This is option 6 in more\n"); break; case 7: break more; default: System.out.println("Invalid Option.");break; } } } public static void exit() { // code to know balance System.out.println("Thank You!"); System.exit(0); } }
run
|
edit
|
history
|
help
0
test1
BST
Abhay
2
Edna Garcia
1 to 100 except 30 to40
Leetcode 937. Reorder Log Files🇮🇳🇮🇳🇮🇳
massive
JAVA # DÄ°ZÄ° Ä°LE EN BÜYÜK BULMA
on_off