SEC: S20W6: Basic Programming Course; Lesson #6: FUNCTIONS
Hello friends and welcome to SEC: S20/W6 in this great dynamics, I would be actively participating and I do hope we enjoy my article accordingly.
Emphatically, I must stress that I was a newbie to the programming world. I had little or no idea about it. It was quite strange seeing new functions and characters. I developed cold feets at first but after long thoughts, I believed in myself that I can do exactly all that concerns it. Most especially wen it comes to carefulness in creating these beautiful codes.
Moreso, I encountered some difficulties, I must highlight that all the tasks were not so easy but I'm glad I attempted them all in all boldness. Most lessons released in the program were in Spanish so decoding the characters on my screen and encoding them on my interface was consuming and stressful to me. I had to evolve over time and I'm glad that I'm able to perform these individual tasks perfectly now.
Importantly, my favorite part of the course was the practice application. After learning these special pseudo-codes, inputting them in an Online IDE was so beautiful, the mot interesting part would be the execution. Seeing the magical beauty when the codes appear in a beautiful array of program delighted me. It remains my favorite part of the lesson.
express image of the original code |
---|
Updated code with multiplication and division result
FUNCTIONS: I carefully defined multiply and divide function to multiply and divide when seen carefully it would be observed too.
MENU: Option 3 was added for multiplication and Option 4 for division in the show menu function. The obvious difference is spotted in the code.
SWITCH: Cases were Integrated into the switch for multiplication and division. Case 3 has the multiply function. Case 4 has the divide function, check for division by zero.
This special code now performs different operations; sum, subtraction, multiplication and division. I would share the pseudo-code immediately.
ATM MENU:
The display menu
present various options for user which comprises of view balance, Deposit money, withdraw money and exit
PIN VALIDATION:
The validate pin
function demands the user for the pin to check if it matches the correct value 1,2,3,4,5,6,7,8
our default 8 digit pin in the question. The command loops repeated until correct pin is integrated.
DEPOSITING MONEY:
The deposit function allows user to enter amount, which gets coded to the initial balance of the account.
BALANCE CHECK:
This function displays current balance to the user using view balance
WITHDRAWING:
Withdraw function allows user enter an amount to withdraw making sure user cannot withdraw more than their account existing balance.
ATM LOOP;
It runs the ATM simulation, it loops menu until chooses to exit. Its responsible for 'balance checking, Deposit, withdrawal,` while making site correct PIN is integrated, ensure the user cannot withdraw more than balance. This cycle back to more after action is taken, except otherwise.
I'm glad I was a part of this huge lessons too. I have added more value to myself and more creative concepts to my arsenal
Cc;
@alejos7ven
Upvoted. Thank You for sending some of your rewards to @null. It will make Steem stronger.
This post has been upvoted/supported by Team 5 via @httr4life. Our team supports content that adds to the community.
Thanks so much for the support my dear friend.