Salvationproject's Posts
Nairaland Forum › Salvationproject's Profile › Salvationproject's Posts
1 2 3 4 5 6 7 8 9 10 (of 18 pages)
logicDcoder:tnk u sir Never really used methods cuz it was no real reusability of codes needed but just as u said, the code would have been neater |
jesmond3945:tnk u |
Juliusmomoh:what could that be please? |
Recently started working on adding Java to my list of languages and my first class was to work on an ATM machine algorithm. For beginners, this will definitely be great while for our professionals, it may be foolish but all the same, it is just for fun. YOU CAN COPY CODE, RUN AND SEE THE FUN AM TALKING ABOUT. To read code without nairaland replacement or more readability, click link: https://wazobiatalk.com/viewthread.php?a=1219&x=check+created //package package com.example.pke; //Importing necessary classes that will foster the successful implementing of the code import java.util.Scanner; import java.util.HashMap; import java.util.ArrayList; public class packard { public static void main(String [] args){ //Scanner obj to get input from ATM user Scanner cin = new Scanner(System.in); //Our accounts ArrayList<String> accounts = new ArrayList<String>(); accounts.add("Joseph Omamode" ;accounts.add("Glory Oko" ;accounts.add("Prince Oghenovo" ;accounts.add("Godfrey Zoe" ;//Our accounts' pins database in form of user full names and PIN HashMap<String, Integer> pins = new HashMap<String, Integer>(); pins.put("Joseph Omamode",4080); pins.put("Glory Oko",1997); pins.put("Prince Oghenovo",2080); pins.put("Godfrey Zoe",1331); //Our users account type HashMap<String, String> types = new HashMap<String, String>(); types.put("Joseph Omamode","Savings" ;types.put("Glory Oko","Savings" ;types.put("Prince Oghenovo","Current" ;types.put("Godfrey Zoe","Savings" ;//Our users account numbers HashMap<String, Integer> act_nums = new HashMap<String, Integer>(); act_nums.put("Joseph Omamode",4080152); act_nums.put("Glory Oko",1521997); act_nums.put("Prince Oghenovo",2080152); act_nums.put("Godfrey Zoe",1521331); //Our accounts' balances database in the form of user full names and balance HashMap<String, Integer> bals = new HashMap<String, Integer>(); bals.put("Joseph Omamode",100000); bals.put("Glory Oko",90000); bals.put("Prince Oghenovo",800000); bals.put("Godfrey Zoe",120000); //Welcome Msg System.out.println("KARDLESS ATM MACHINE...\n\nNote:This ATM contains the Naira denomination of N1,000 and can only permit a maximum withdrawal of N20,000 at a time.\n\n" ;//Random number to help select a random user's account int num = (int) (Math.random() * accounts.size()); //Card Detected - Process a transaction String account = accounts.get(num); //What happened above was that with the help of the random number earlier generated, we were able to select as a particular from our account array //Check if the account really exists if (accounts.contains(account)) { //Print Welcome Message System.out.println("Welcome "+account+"\n\nPLEASE WAIT...\n\nEnter your personal identification number(PIN):" ;//Take pin from user for this particular account int pin = cin.nextInt(); //check if pin is correct if (pins.get(account) == pin) { //Pin is correct //Prompting user to select action to perform e.g withdrawal System.out.println("\nSELECT AN OPTION:\n1 => Withdrawal\n2 => Account Balance Enquiry\n3 => Transfers\n4 => Account Enquiry" ;//Action feedback int op = cin.nextInt(); //Let's get user account balance int act_bal = bals.get(account); //Let's get user account number int act_num = act_nums.get(account); //Let's get user account type String type = types.get(account); //Prompt user to confirm his/her account type System.out.println("\nSELECT YOUR ACCOUNT TYPE\n\n1 => Current\n2 => Savings\n3 => Domicilliary" ;//Account type feedback int a_type = cin.nextInt(); //Remember the account type feedback is an int. The below switch statement helps to know the account type in words in a string(s_type) so as to help compare and confirm with the real account type String s_type = ""; switch (a_type) { case 1: s_type = "Current"; break; case 2: s_type = "Savings"; break; case 3: s_type = "Domicilliary"; break; } //Confirming account type if (s_type == type) { //Account type confirmed //This switch is to start processing the user wanted action/transaction/operation e.g withdrawal since account type and pins have been verified. switch (op){ case 1: //User wants to withdraw System.out.println("\nWITHDRAWAL REQUEST\n\nSELECT AMOUNT:\n1 => 500\n2 => 1000\n3 => 5000\n4=> 10000\n5 => Others" ;int amt = 0; //Get the amount option from options given e.g 5000 or Others int ao = cin.nextInt(); //Switch to process the option switch (ao) { case 1: //User wants to withdraw 500 amt = 500; break; case 2: //User wants to withdraw 1000 amt = 1000; break; case 3: //User wants to withdraw 5000 amt = 5000; break; case 4: //User wants to withdraw 10000 amt = 10000; break; case 5: //User wants to manually enter amount System.out.println("\nEnter Amount:" ;amt = cin.nextInt(); break; } //Check if amount requested is less than or equal to users account balance if (amt <= act_bal && amt <= 20000) { //Yes, User is eligible to withdraw... PROCESS WITHDRAWAL and give feedback System.out.println("\nPlease Wait While Cash Is Being Dispense:\n..................\n.................. \n..................\nTRANSACTION COMPLETE!!! Please take your cash.\nDETAILS\nAcc: "+account+"\nAmt: N"+amt+"\nBal: N"+(act_bal - amt)); } else { if (amt > act_bal) { //Insufficient balance System.out.println("\nTRANSACTION FAILED!!! Insufficient Balance..." ;} else { //Requested amount exceeded the amount allowable for withdrawal in this ATM which is N20000 System.out.println("\nWithdrawal limit exceeded.\nTRANSACTION FAILED..." ;} } break; case 2: //User wants account balance enquiry System.out.println("\nACCOUNT BALANCE ENQUIRY!!!\n\nAcc: "+account+"\nAcc. Type: "+type+"\nBalance: N"+act_bal); break; case 3: //User wants to transfer //User should enter destination account type System.out.println("\nSELECT DESTINATION ACCOUNT TYPE:\n\n1 => Current\n2 => Savings\n3 => Domicilliary" ;int da_type = cin.nextInt(); //Switch to convert the enter destination account type to string String d_type = ""; switch (da_type) { case 1: d_type = "Current"; break; case 2: d_type = "Savings"; break; case 3: d_type = "Domicilliary"; break; } //Prompting to enter destination account number System.out.println("\nENTER DESTINATION ACCOUNT NUMBER:" ;int d_acc = cin.nextInt(); //The boolean and the following foreach statement will check to know if an account number with the specified type really exists among our account records boolean a_ex = false; for (String j : act_nums.keySet()) { if (act_nums.get(j) == d_acc && types.get(j) == d_type) { //it exists //Checking whether the destination account is same as user's account number if (act_num == d_acc) { //It is... Therefore, transaction failed... Don't tell him/her much cause he/she knows what he/she is doing i.e it is insane wanting to transfer money from ur account to ur account System.out.println("\nTRANSFER FAILED!!!" ;} else { //It is not... Let's proceed by requesting amount to transfer from user System.out.println("\nENTER AMOUNT:" ;int d_amt = cin.nextInt(); //Prompting to enable user confirm he/she understands what is going on and to either terminate transfer or proceed System.out.println("\nTRANSFER "+d_amt+" To "+j+"\n1 => YES\n0 => NO" ;int t = cin.nextInt(); if (t == 0) { //User don't want to proceed with transfer System.out.println("TRANSFER CANCELLED!!!" ;} else { //User want to proceed but let's confirm if he/she has real amount in account to proceed. if (d_amt <= act_bal) { //Yes... PROCESS TRANSFER and give feedback System.out.println("\nPlease Wait While Transfer Is Processing:\n..................\n.................. \n..................\nTRANSFER SUCCESSFUL!!! Please take your card.\nDETAILS\nAcc: "+account+"\nAmt: N"+d_amt+"\nBal: N"+(act_bal - d_amt)); } else { //Insufficient balance System.out.println("Insufficient Balance." ;} } } a_ex = true; break; } } if (a_ex == false) { //Account does not exists System.out.println("FAILED!!!This is because the account number is invalid or account type is not correct...Please try again." ;} break; case 4: //User wants to know account details System.out.println("\nACCOUNT ENQUIRY - DETAILS!!!\n\nAcc Num: "+act_num+"\nAcc: "+account+"\nAcc. Type: "+type+"\nBalance: N"+act_bal); break; default: //We couldn't recognize what user wants System.out.println("Entry Not Recognize." ;break; } //Further communication with user after transaction System.out.println("\n\nWANT TO PERFORM ANOTHER TRANSACTION?\n1 => YES\n2 => NO" ;int z = cin.nextInt(); switch (z){ case 1: System.out.println("Please take your card and re - insert." ;break; default: System.out.println("Please take your card." ;break; } } else { //User entered account type didn't match with the account type associated with this account... So, transaction failed System.out.println("TRANSACTION FAILED!!! Please take your card..." ;} } else { //Incorrect PIN detected System.out.println("\nIncorrect PIN. Please take your card." ;} } } } |
ghettochild4u:why I nor go fight back. shey bcus u dey claim manhood 4 nairaland ni wen be say 4 real life, na u be real simp |
I was reading a thread where a nairalander was narrating that his mother no longer believes in him and uses to use words like "at 20 and you are still broke" on him and I was like WTF. I am 22 and I don't feel any pressure at all. I believe there is still time but reading that, I was like am I deceiving myself or what? I am small in stature n kept wondering if that is what is deceiving me? I am in school and hoping to start the race of life when I grad but that thread was thought provoking to me. Check it out guys, is a 22years old man suppose to be independent already? are there no longer procedures n stages in life? |
Powerfly:Hahahahahaha but d oda lady also have those features as well na... I mean d boobs, pu*sy, lips & ass. as such, notin new but anyways, that is sexual preference for u |
ghettochild4u:stop the insult bro... because no girl or beta girl never look ur direction nor mean say make u call pesin simp. b4 every every, I was actually tough on this babe... I nor dey tolerate nonsense from her even as this stuff happen sef, this babe don call my attention face to face like 4 times kneel down dey beg 4 forgiveness say she nor go try again... I nor gree... what about continuous disturbance for phone yet I nor gree Na because of her disturbance too sef wen I dey consider to play card 4 her head. so, how am I a simp with ur useless ideologies. |
MrHighSea:23 |
damilola4515:OK... now I understand ur point i.e not all ladies enjoy via penetration... I was only thinking what is only natural but then, best of luck... on a second thought while keeping penetration aside, is dere really anything a lady can offer her fellow lady DAT a man cannot offer? |
damilola4515:sorry for the choice of word I used but all the same, I used the 'drilling' stuff to emphasize the power in a man to naturally make a woman happy not these weird lesbianism of a tin u crave for - all fake |
Abouwaza:u are a mumu boy |
damilola4515:This is not wat u need babe... allow a guy like me but not me to drill u wella n u will be forever grateful to d almighty for opening ur eyes. |
luminouz:Hmmmnnn... u don't really understand what am saying here. why should I be afraid of her curses wen she was the one, who did wrong. wat I said is, I understand DAT wen a girl cheats, u should dump her immediately which is what I have done but then, I am having issues getting her off my head. so, I am planning to go back, cruise with her and finally dump her for good but am afraid DAT by the time I do all this, I would have switch myself to the wrong side by going back n breaking her heart which will not end well n definitely lead to her cursing me |
luminouz:Hahahaha, no be anoda one bro these are normal tins DAT happen in life but we usually claim James bond wen e never reach us I was once like u |
Sonoyom:True... when we broke up, I was engage in one project n totally forgot about her but immediately I finish, it has not been easy n reading is not really helping. I was hoping ASUU will call off yesterday so DAT I can return to skul, see oda faces n have fun to forget but unfortunately, ASUU lose am |
Pierocash:I don't want to return for true love... just want to go back to catch cruise n finally dump her... the result of the final dump is wat I said I am afraid of n not this present break up of ours |
Righteousness89:Thank u man of God but unfortunately, I am still a sinner 4 now... we will get to ur stage soon |
I have heard all ur opinions on this and have decided to follow my heart... Get her back and after the fun, and when in a right state of mind, I will let her go for good. THANKS GUYS I recently broke up with the girl I cherish in my life the most. Yes, she cheated on me and I don't want her back cause I won't be able to trust her nor forget the fact that she was screaming under another man while still seriously dating me. |
Happy birthday broda... WULLNP |
check out the site below and contact if you are interested in owning it;
wazobiatalk.com 0_9_0_6_0_9_4_3_9_2_4 Features, 1. amazing web forum 2. cool direct chat system 3. And more... |
Sorry, this is a bit long though. Okay, so i once created a thread where I talked about how I am suspecting my girlfriend is cheating on me. What actually led to that was when she visited and she handed me her phone. I went to her gallery and from there to WhatsApp. Immediately I opened the app, I noticed she suddenly became uncomfortable and started nagging to leave but I insisted she waits and not too long, I saw the love chats with a suppose state house of assembly legislator. The chats were talks about love, meeting up for sex and included nude videos being shared by both parties. Going through the chats, I could feel the words as if she was actually chatting with me meaning she was the one chatting but when I confronted her with same, she denied saying it was her elder sister, who was chatting with her phone. The funny thing is that I never knew neither have I heard of this her sister before but she insisted that she just came from Lagos and all that... The next proof I needed was to watch the nude videos sent but she kept pestering me as to why I would want to watch her elder sister's nude and see her unclothedness. Feeling that it would be bad, I decided to leave my suspicion in suspense. Fast forward to last week, I invited her to a mini restaurant so that we can chat and get to know ourselves more since the thing is moving like it's gonna lead to marriage. There, discussion about how my phone memory is full came up and she offered to give me her SD card which she did. After that meeting, I was just relaxing one evening and going through her stuffs on the SD card when I stumbled upon a screenshot of a chat that took place on her phone. She was like calling someone, "Baby, please my data just got finished. can u help with card so that I can renew my sub n check up some stuffs" The receiver sent the card and she replied asap with still the use of "baby" stuffs. From there, I knew this was an intimate something. Further findings reveals the chats was with that same legislator, she previously denied. I can see the same "PDP" logo used as profile picture. I immediately cropped out the number part and invited her over for a confrontation the next day so that she will tell it was her friend this time around. When she came over the next day, I showed her the screenshot and she wanted to laugh over it telling me 'it is a normal thing na'. I was like this is normal to you and she said the person was just a friend. I told her not to play with my intelligence for no lady will just be calling a man "baby" just like that and in case she don't know, she would notice the number part is not in the screenshot because I never wanted her to know it was that same man and then, maybe she can deny that it was a friend this time around. She was dumb founded. That simply meant she has been cheating, sending nudes, sleeping with other men. This was a girl I trusted o and do use to go raw with her cause I trusted so much and do use to boast with her not knowing that I was fooling myself. Long story short, I ended the about 6years relationship yesterday, advised her and escorted her to take a ride home. She later called pleading to meet with me today. We met where she explained she did all that just to get some stuffs she was lacking and because I don't use to give her listening ears and that it was not recent stuff rather it was during a period when we had an issue. I countered her lies/excuses in the best way possible and insisted I can't go back on my decision for us to part ways as I will continue to see every act of hers even when genuine as pretence. But since we departed, I have been thinking if I really did the right thing. Like she was loving and nice during the period with her, cares and constantly communicates with my family members even I am uncomfortable with dat and do use to support me in various ways but then, are all these enough reasons to pardon a cheating girlfriend? :PSorry, this is a bit long though. Okay, so i once created a thread where I talked about how I am suspecting my girlfriend is cheating on me. What actually led to that was when she visited and she handed me her phone. I went to her gallery and from there to WhatsApp. Immediately I opened the app, I noticed she suddenly became uncomfortable and started nagging to leave but I insisted she waits and not too long, I saw the love chats with a suppose state house of assembly legislator. The chats were talks about love, meeting up for sex and included nude videos being shared by both parties. Going through the chats, I could feel the words as if she was actually chatting with me meaning she was the one chatting but when I confronted her with same, she denied saying it was her elder sister, who was chatting with her phone. The funny thing is that I never knew neither have I heard of this her sister before but she insisted that she just came from Lagos and all that... The next proof I needed was to watch the nude videos sent but she kept pestering me as to why I would want to watch her elder sister's nude and see her unclothedness. Feeling that it would be bad, I decided to leave my suspicion in suspense. Fast forward to last week, I invited her to a mini restaurant so that we can chat and get to know ourselves more since the thing is moving like it's gonna lead to marriage. There, discussion about how my phone memory is full came up and she offered to give me her SD card which she did. After that meeting, I was just relaxing one evening and going through her stuffs on the SD card when I stumbled upon a screenshot of a chat that took place on her phone. She was like calling someone, "Baby, please my data just got finished. can u help with card so that I can renew my sub n check up some stuffs" The receiver sent the card and she replied asap with still the use of "baby" stuffs. From there, I knew this was an intimate something. Further findings reveals the chats was with that same legislator, she previously denied. I can see the same "PDP" logo used as profile picture. I immediately cropped out the number part and invited her over for a confrontation the next day so that she will tell it was her friend this time around. When she came over the next day, I showed her the screenshot and she wanted to laugh over it telling me 'it is a normal thing na'. I was like this is normal to you and she said the person was just a friend. I told her not to play with my intelligence for no lady will just be calling a man "baby" just like that and in case she don't know, she would notice the number part is not in the screenshot because I never wanted her to know it was that same man and then, maybe she can deny that it was a friend this time around. She was dumb founded. That simply meant she has been cheating, sending nudes, sleeping with other men. This was a girl I trusted o and do use to go raw with her cause I trusted so much and do use to boast with her not knowing that I was fooling myself. Long story short, I ended the about 6years relationship yesterday, advised her and escorted her to take a ride home. She later called pleading to meet with me today. We met where she explained she did all that just to get some stuffs she was lacking and because I don't use to give her listening ears and that it was not recent stuff rather it was during a period when we had an issue. I countered her lies/excuses in the best way possible and insisted I can't go back on my decision for us to part ways as I will continue to see every act of hers even when genuine as pretence. But since we departed, I have been thinking if I really did the right thing. Like she was loving and nice during the period with her, cares and constantly communicates with my family members even I am uncomfortable with dat and do use to support me in various ways. I was even trying to give myself reasons why i should forgive her like almost all women cheat but then, are all these enough reasons to pardon a cheating girlfriend? |
AmgladGodsgee:na website 4 mad people u wone create... one website na market, blog, e-school, fashion place, ad house and oda nonsense. pay me one million and I will not even agree to build it. I don't build nonsense. u beta sit down with ur money and think abt sensible website to create or soon, one scammer go slide into ur DM n help u hold am |
9jaflavers:be careful with nairalanders... criminals everywhere |
available but don't have data for WhatsApp now.
what about PM? |
We all know that all the girls of nowadays have boyfriends and when u approach a babe for love, one of the replies u are likely to get is the "I have a boyfriend" stuff. How do one or you push on in conversing with her afterwards especially if you still want to press on with wanting a relationship? |
imagrg:Try googling |
Electronics:Interested!!! WhatsApp: 090_6094_3924 |
;
.
Face of the week...admin can add face of the week and make a small write up for the personality of the week