Fundamentals of Computing
C program
#include<stdio.h>
C introduction , Selection Structures , Loop , While Loop, Flow Chart.









Scenario 1 You were hired as a Junior Software engineer at a local bank as one of their software operation team. Your manager called for a meeting and he asked you to attend. In the meeting, the manger discussed some issues with their current ATM software. In the same meeting, the manager asked the system architect to present the current problems with the software and how the system should be modified. The following are the new requirements that you were asked to develop. Task 1 Design your system by drawing a flowchart diagram showing the logical sequences of the proposed system. You will use the diagram as a visual representation to document the financial system for developing purposes in the future. To create the flowchart diagram, you must understand task 2 to 5. Task 2 The financial system must be user friendly, which allows the user to choose the option for the required operation from a menu list, this menu list must contain the following options, and as shown in the sample figure 1: • Login • Register New User Rate Us • Exit Welcome to our HTU Banking Application ******Main Menu*** 1- Login to your account 2- Register new account in the Bank 3- Rate Us 4. Exit Enter your choice Figure 1
Use a function to print out this menu, and this function should return the selected choice. Be aware that if the user input invalid choice you should warn him, and the menu should be shown again as showing in Figure 2 Welcome to our HT Banking Application ******Matn Menu******** 1. Login to your account 2. Register new account in the Bank 4. Exit Enter your choice 3- Rate Us 5 ***you enter wrong choice ... please enter a valid choice******** welcome to our HTu Banking Application ********Main Menu ****** 1 - Login to your account 2- Register new account in the Bank 3. Rate us 4. Exit Enter your choice Figure 2
Task 3 The first option is to log in to your account, use a function to accomplish this option. Based on the current user, ask them to input the password, compare the entered password with saved in the system. (the saved password must be read from password file provided by us). If the user not allowed into the system, it means either the user not registered or they input a worng password. this case you will show another menu with the following options: Welcone to our HU Banking Application ******Main Menu****** 1 - Login to your account 2- Register new account in the Bank 3. Rate Us 4. Exit Enter your chotce ... Login to HTU Bank.. ---Enter your password-> 1478523 ****the password ts not found***** 1- Return to the natn nenu to try togtn again Register new account Figure 3 You entered a worng password return to the main menu to try login again. ***the password ts not found**** 1- Return to the main menu to try login again Register new account Welcome to our HU Banking Application ******Matn Menu******* 1- Login to your account 2- Register new account in the Bank 4. Exit Enter your chotce 3- Rate Us Figure 4
You are not register please register a new user. **** Login to HTU Bank**** ...Enter your password-> 528963 ******the password is not found***** 1. Return to the natn menu to try login again 2. Register new account ---Regtster new account in_HTU Bank- Enter your first nane Figure 5 If the entered password was matched, then the user is allowed into the system. When users entered into the system User will be prompted with another menu which includes the following options: 1 - Login to your account 2- Register new account in the Bank 3- Rate Us 4. Exit Enter your choice 1 **** Login to HTU Bank**** *****Enter your password-> 9999 --you enter correct passord... - Account List ... -1- Check your account ----- -2. Withdrawal from your account --3- Deposit Enter your choice from Account List -> 1 Figure 6
Check your account balance. Read the matching record from the file (account.txt) and print to the screen. Enter your choice from Account List -> 1 Nane: MMMM Total Balance: 858.200012 Welcone to our HTU Banking Application ******Main Menu*** 1 - Login to your account 2- Register new account in the Bank 3- Rate Us 4. Exit Figure 7 Withdrawal The system will prompt the user to enter the amount (float) to be withdrawn from the account, amount checked against current balance, reduce the balance by the same amount requested, and then print new balance to screen, then go back to main Menu. Login to HTU Bank**** *******Enter your password-> 9999 --you enter correct passord... eeeee - Account Listen -1. Check your account --- -2- withdrawal from your account -----3Deposit Enter your chotce from Account List -> 2 How much money do want to withdraw from your account? new balance: 658.20 Welcone to our HTu Banking Application Main Menu*** 200 1 - Login to your account 2- Register new account in the Bank 3- Rate Us 4- Exit Enter your choice Figure 8
Deposit The system will prompt the user to enter the amount (float) to be deposited to the account, amount checked against current balance, increase balance by the same amount added and then print new balance to screen, then go back to main Menu. 1 - Login to your account 2- Register new account in the Bank 3. Rate Us 4. Exit Enter your choice 1 **** Login to HTu Bank **** ....***Enter your password-> 9999 ----you enter correct passord-n. -Account Listen -1- Check your account -2. withdrawal from your account - -3. Deposit Enter your chotce fron Account List -> 3 How much money do want to Deposit to your account? new balance: 1058.199951 200 Welcome to our HTU Banking Application **********Main Menu******* 1. Login to your account 2- Register new account in the Bank 3. Rate Us 4. Exit Figure 9
Exit to the main menu If the user selects any other opetion, she will be routed back to the main menu. Login to your account - Register new account in the Bank 3. Rate Us 4- Exit Enter your choice *** Login to HTU Bank ***Enter your password-> 2999 -you enter correct passord Account List - 1 - Check your account ---- .-2-withdrawal from your account - -3. Deposit Enter your choice fron Account List -> 8 reuten to the matn menu Welcone to our HTU Banking Application ********Matn Menu *** 1. Login to your account 2. Register new account in the Bank 3- Rate Us 1- Exit Figure 10 Task 4 When a new user needs to register, the program will ask them to . Enter their Name. Enter a new Password, and ask for Password confirmation, if the password and confirmation are ok allow them to proceed by entering Initial Balance for thier account, then you will need to instruct to update the file by adding the new record in a file called "account.txt".
Welcone to our HTU Banking Application *******Main Menu********* 1 - Login to your account 2- Register new account in the Bank 3- Rate Us 4- Exit Enter your choice **Register new account in HTU Banks ---Register new account in HTU Bank.. Enter your first nane > Ahmad Enter your password. 2546 Enter your confirm password => 2546 Enter your intttal balance -> 900.40 New account is added Welcone to our HTU Banking Application ***Main Menu 1 - Login to your account 2- Regtster new account in the Bank 3- Rate Us 4- Exit Figure 11 In case your password was not confirmed inform the user of the proplem and return to main menu Welcome to our HU Banking Application ********Matn Menu*** 1- Login to your account 2- Register new account in the Bank 3. Rate Us 4. Exit Enter your choice 2 **Register new account in HTU Bank Register new account in HTU Bank Enter your first name -> Mohammad Enter your password -> 6663 Enter your confirm password -> 6666 You password is not equal to the confirmed one Welcome to our HU Banking Application *******Main Menu******** 1 - Login to your account 2. Register new account in the Bank 3- Rate us 4- Exit Enter your choice Figure 12
Task 5 When the user selects to Rate Us from the main menu, they will be prompted to enter a value from 0 to 10. Welcome to our HU Banking Application ******Matn Menu******* 1 - Login to your account 2- Register new account in the Bank 3 - Rate Us 4- Exit Enter your choice 3 ***Rate Us*** enter number between 0 and 10 Figure 13 Based on this number system will draw an image representing the satisfaction rate (image library will be provided). Figures below shows an example when user rating are 3, 5 and on scale of 10 Image Magick: image.ppm Image Magick: image.ppm Figure 14