SEC: S20W6: Basic Programming Course; Lesson #6: FUNCTIONS

in #devjr-s20w6last month (edited)
Black Gold Elegant Jewelry Logo_20241017_211106_0000.png
edited with canva

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.


Tell us about your experience with programming was it your first time? Did you find it complicated? What as your favorite part of the course?

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.


Add the function to multiply and divide to the course calculator. Explain how I did it?

Screenshot_20241017-080753.pngexpress image of the original code

Screenshot_20241017-081350.pngScreenshot_20241017-081429.png

Updated code with multiplication and division result


CHANGES OBSERVED

  • 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.

Screenshot_20241017-082101.pngScreenshot_20241017-082124.png
Screenshot_20241017-082200.pngScreenshot_20241017-082215.png
Screenshot_20241017-082350.pngScreenshot_20241017-082328.png
Screenshot_20241017-082303.pngScreenshot_20241017-082243.png

FINAL PROJECT; Create an ATM Simulator, it should initially prompt an access pin to the user, this pin should be 1,2,3,4,5,6,7,8. Once the pin is successfully validated, it will show a menu that allows 1. View balance 2. Deposit money 3. Withdraw money 4. Exit. The cashier must not allow more balance to be withdrawn than it's initial liquidity. Use all structures I learned and functions.

ATM SIMULATOR

Screenshot_20241017-083406.pngScreenshot_20241017-083514.png
EXPLANATION OF CODE
ATM MENU:

The display menu present various options for user which comprises of view balance, Deposit money, withdraw money and exit

Screenshot_20241017-220555.png
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.

Screenshot_20241017-221009.png
DEPOSITING MONEY:

The deposit function allows user to enter amount, which gets coded to the initial balance of the account.

Screenshot_20241017-221208.png
BALANCE CHECK:

This function displays current balance to the user using view balance

Screenshot_20241017-220555.png
WITHDRAWING:

Withdraw function allows user enter an amount to withdraw making sure user cannot withdraw more than their account existing balance.

Screenshot_20241017-222313.png
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.

Screenshot_20241017-083725.png

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


I have concluded this article and invite @simonnwigwe @chant @josepha @pelon53 to join challenge

Sort:  
Loading...

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.

image.png

Thanks so much for the support my dear friend.

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 97950.42
ETH 3343.35
USDT 1.00
SBD 3.04