Basic programming course: Lesson #6 Functions.

in #devjr-s20w610 hours ago

steemit-engagement-challenge-cover.jpeg

Greetings Steemit friends

Tell us about your experience with programming, was it your first time? Did you find it complicated? What was your favorite part of the course? (2 points)

Programming has been a great experience for me, as I have been able to have more understanding of some coding concepts. I feel I have had the opportunity to discuss and understand some best practices in programming.

Programming was not my first time, but programming is about practicing. This has given me the chance to do some practice in the past couple of weeks. I did come across some very challenging tasks during the course. I will not want to say I found it complicated, because it was an opportunity for me to learn.

My best part was the session on developing a small program to handle an average of four subjects. I was so excited about that project, which pushed me to put more as a personal project and not just about the course.

Add the functions to multiply and divide to the course calculator. Explain how you did it. (3 points)

To create a Course calculator. As required in the project, the user needs to be able to multiply or divide two numbers.

So I started by creating the functions to handle these operations, that is multiplying two numbers and dividing two numbers. So I will need to make use of operators for the different respective functions. Each function will have two parameters to hold the two numbers which will be input.

Next, I declare the variables which I will make use of in the course of the program data type. Following the concept of the last class (cycles) I make use of the Do-while loop to present the option to select. This way, the user has to perform the task before the program is exited.

Next, I make use of the switch loop case. The variable option holds the value of the selected option. Each case will require the user to input two numbers.

Case 1: After the user has inputted the two numbers as required. Next, I have to call the function multiplication to handle the logic.

Case 2: After the user has inputted the two numbers as required. Next, I have to call the function divide to handle the logic.

Default: It is not compulsory but required in case an input used is an invalid option.

I will do a short video, placing the codes step by step before running a test. If you had the chance to go through the last session, you have a better understanding.

FINAL PROJECT: Create an ATM simulator. It must initially request an access pin to the user, this pin is 12345678. Once the pin is successfully validated, it must show a menu that allows: 1. view balance, 2. deposit money, 3. withdraw money, 4. exit. The cashier should not allow more balance to be withdrawn than is possessed. Use all the structures you learned, and functions. (5 points)

ATM simulator is a program to help users have access to their balance, make a deposit, and can also do a withdrawal. It is not as simple as it looks, I can bet.

I try to make use of all the structures I have come across during this course. The video has a step-by-step build-up after testing.



Cheers
Thanks for dropping by
@fombae

Sort:  

Congratulations! - Your post has been upvoted through steemcurator06

6VvuHGsoU2QBt9MXeXNdDuyd4Bmd63j7zJymDTWgdcJjnznJFhDarJ9fLxNdiYx8HVPoEzcEA7kPcfbq7RG3ttNdbik32xD2rDTJzjDaPuWexei3DJmoHSkkXh7z9c.jpeg

Curated by : @rosselena - Selective Team

Congratulations, your post was upvoted by @supportive.

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 68425.65
ETH 2646.01
USDT 1.00
SBD 2.68