NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import java.util.Date;
import java.util.Random;
import java.util.Scanner;
public class Fun {
int Balance, c = 0, d = 0;
Date time = new Date();
Scanner sc = new Scanner(System.in);

void Menu() {
System.out.println(" Enter 1 for Addition ");
System.out.println(" Enter 2 for WithDraw ");
System.out.println(" Enter 3 to Register ");
System.out.println(" Enter 4 to Exit ");
int Modi = sc.nextInt();

switch (Modi) {
case 1:
Add();
Menu();
break;
case 2:
Withdraw();
Menu();
break;
case 3:
Register();
Menu();
break;
case 4:
System.out.println("********************** " + time + " ********************** ");
System.out.println("********************** Thanks for using Mu Bank **********************");
break;
default:
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
break;
}
}

private void Register() {
String strRegEx = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*](?=\S+$).{8,15}$";
Random Generate = new Random();
Balance = Generate.nextInt(5000);
System.out.println("***********************Enter Your ID and Password***********************");
System.out.println("*********** ID is 6 numbers only *********** ");
System.out.println("************* ID : ");

int ID = sc.nextInt();
if (ID <= 999999 && ID > 99999)
System.out.println("************* PassWord : ");
else {
System.out.println("*********** ID is 6 numbers only *********** ");
Register();
}

System.out.println("minimum 8 characters in length and no space and any number and upper case and lower case letters");
String PassWord = sc.next();
if (PassWord.matches(strRegEx))
System.out.println("********* The Password is valid *********");
else {
System.out.println("********* The Password is not valid *********");
System.out.println("min 8 and 15 max characters in length and no space and any number and upper case and lower case letters");
Register();
}
System.out.println("******************* You Have " + Balance + " $ in your ACC******************* ");
}

private void Add() {

if (c == 0)
Register();
System.out.println("*****************You can only Add 10 , 50, 100 , 200 Papers***************** ");
int Addition = sc.nextInt();
if (Addition % 10 == 0 && Addition > 0) {
System.out.println("******************* You Added " + Addition + " L.E *********************");
System.out.println("******************* Your Balance now = " + (Balance + Addition) + "******************* ");
Balance = Addition + Balance;
System.out.println("Enter 1 for another Addtion and 0 to end the Process");
int Operator = sc.nextInt();
if (Operator == 1) {
c = 1;

Add();
}
} else {
System.out.println("!!!!!!!!!!!!!!!!!WRONG PAPER!!!!!!!!!!!!!!!!");
System.out.println("Enter 1 for another Addtion and 0 to end the Process");
int Operator = sc.nextInt();
if (Operator == 1) {
c = 1;
Add();
}
}
}

private void Withdraw() {
if (c== 0)
Register();
System.out.println("********************** Your Balance = " + Balance + " $ **********************");
System.out.println("********************** Enter the amount you want to withdraw : ");
int WithDraw = sc.nextInt();
if (WithDraw > 0 && WithDraw <= Balance && WithDraw % 50 == 0) {
System.out.println(" ******************* Now Your Balnace is " + (Balance - WithDraw) + " $ *******************");
if (Balance == 0) {
System.out.println(" ******************** YOU HAVE NO MONEY BRO ********************");
return;
}
Balance = Balance - WithDraw;
System.out.println(" Enter 1 for another WithDraw and 0 to end the Process ");
int Operator = sc.nextInt();
if (Operator == 1) {
c = 1;
Withdraw();
} else if (Operator == 0) {
System.out.println("********************** Your Balance = " + Balance + " $ **********************");
}
} else if (WithDraw % 50 != 0) {
System.out.println("*****************You can only WithDraw 50, 100 , 200 Papers***************** ");
System.out.println(" Enter 1 for another WithDraw and 0 to end the Process ");
int Operator = sc.nextInt();
if (Operator == 1) {
c = 1;
Withdraw();
} else if (Operator == 0) {
System.out.println("********************** Your Balance = " + Balance + " $ **********************");
}
} else {
System.out.println("************************* You cant WithDraw this amount ************************* ");
System.out.println(" Enter 1 for another WithDraw and 0 to end the Process ");
int Operator = sc.nextInt();
if (Operator == 1) {
c= 1;
Withdraw();
} else if (Operator == 0) {
System.out.println("********************** Your Balance = " + Balance + " $ ********************");

}
}
}
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.