Free Essay

Program

In:

Submitted By emrys
Words 4238
Pages 17
1. Brief Description
This program is designed to allow debit card user which is the students of TARUC to pay fees and buy workbooks using the debit card service that is provided by TARBANK. Hence, as a debit card user, the students will start off with an amount of money in the card. According to this program, the amount of money that is deposited by the students must exceed or equal to a value that is constant which is RM 4000.00. If the balance of the card is less than the amount stated above, this program will keep asking the students to top up the amount until the card balance reaches RM 4000.00 or above.
When the program meets its requirement from the user, it will continue to ask the students to enter year of study, semester and number of workbooks required. The program later will display the total charges by computing the annual fees, semester fees and cost of the workbooks. Furthermore, the program will check the condition of the funds each time after displaying the total charges. For instance, if the fund is sufficient, the payment will be approved and the program will display the remaining card balance after deducting the card balance from total charges whereas the program will only display the card balance without deducting the amount of total charges when the fund is insufficient.
Then, the program will prompt the student on the decision to continue to make more payments. If the student decides to continue to make more payments for the fees and workbooks, the program will check the condition of the remaining of the card balance. As mentioned above, when the card balance is less than RM 4000.00, the program will continue to ask the students to top up the amount until the card balance reaches RM 4000.00 or above before continuing to make more payments for the fees and workbooks. On the other hand, if the card balance is RM 4000.00 or above, the program will allow the students to proceed to the payments making for the fees and workbooks. If the students decide not to make any payment, the program will display the transaction summary.
In transaction summary, the program will show the total top amount topped up by the students, total fees paid, total cost of workbooks and ending balance.
To summarise all, this program is designed to keep track of the student’s card balance after deducting charges for each fees and the cost of workbooks and it will also produce a transaction summary at the end of each session.

Start
Start
2. Method of Solution

Splash screen
Splash screen

Reference table
Reference table

Check balance
Check balance

Payment Screen
Payment Screen

True
True
Decision == ’Y’ || Decision == ’y’
Decision == ’Y’ || Decision == ’y’

False
False

Transaction Summary
Transaction Summary

End
End

Diagram 2.1 shows the flowchart for main function
Diagram 2.1 shows the flowchart for main function

Based on Diagram 2.1, decision is referred to the decision made by the user to make more payments for the fees and workbooks.

Reference Table()
Reference Table()

Splash screen()
Splash screen()

Display Fees Structure Table
Display Fees Structure Table
Display logo
Display logo

Return
Return

Display Workbook Price Table
Display Workbook Price Table

Diagram 2.2 shows the flowchart for splash screen function
Diagram 2.2 shows the flowchart for splash screen function

Return
Return

Diagram 2.3 shows the flowchart for reference table function
Diagram 2.3 shows the flowchart for reference table function

Transaction Summary()
Transaction Summary()

Display Transaction Summary
Display Transaction Summary

Return
Return

Diagram 2.4 shows the flowchart for transaction summary function
Diagram 2.4 shows the flowchart for transaction summary function

Method Used in Creating the Fees Structure Table & Workbook Price Table
Fees Structure Table
Based on the question given, looping concept is preferred to be used in creating the fees structure table. Therefore, I have used for loop to create the table as it is easier to read.
Firstly, I have declared year, annual_fee, long_sem_fee, and short_sem_fee as the variables by using integer as the data type. Then, I have initialized the annual_fee, long_sem_fee and short_sem_fee to appropriate values as shown in the statement below.

Eg: int year, annual_fee, long_sem_fee, short_sem_fee; annual_fee = 200;//the starting value of annual fee long_sem_fee = 1000;//the starting value of long sem fee short_sem_fee = long_sem_fee * SEM_3_FEE;//the starting value of short sem fee

Note:
I have declared SEM_3_FEE as the constant variable which stores the 0.5 as the value to calculate the fees for semester 3 in year 1,2,3 and 4.

After declaring and initializing the variables, I used printf to create and display the title of the table,boxes or headers. Then I have used for loop to create the table. In for loop, I have initialized year to 1. Besides that, the condition of the year must be less than 5 and I have updated the year which increments the value of the year as shown in the statement below.

Eg: printf("Fees Structure Table\n"); printf(" +---------------+----------------+-------------------+--------------------+\n"); printf(" | Year of Study | Annual Fee | Long Semester Fee | Short Semester Fee |\n"); printf(" | | (pay in Sem 1) | (Sem 1 & Sem 2) | (Sem 3) |\n"); printf(" +---------------|----------------|-------------------|--------------------+\n"); //loop fee for(year = 1; year < 5; year++) { printf(" | %d | %d | %d | %d |\n", year, annual_fee, long_sem_fee, short_sem_fee); annual_fee = annual_fee + 100; long_sem_fee = long_sem_fee + 200; short_sem_fee = long_sem_fee * SEM_3_FEE; } printf(" +---------------+----------------+-------------------+--------------------+\n\n");

Workbook Price Table
In designing the workbook price table, I have used for loop to create it. Firstly, I have declared row, no_of_workbook, year12, year12_2, year34, year34_2 as the variables by using the integer data type. Then I have initialized variable year12 and year34 to 0 for calculation purpose as shown in the statement below.
Eg : int row, no_of_workbook, year12, year12_2, year34, year34_2; year12 = 0; year34 = 0;
Note : 1) row – represents the number of rows that is used in looping statement to create and display the workbook prices table 2) no_of_workbook – represents the number of workbooks in the workbook price table 3) year12 – represents the starting value of the workbook price for year 1 and 2 4) year34 – represents the starting value of the workbook price for year 3 and 5) year12_2 – represents the workbook price for year 1 and 2 when the number of workbooks purchased are more than or equal to 5 6) year34_2 – represents the workbook price for year 3 and 4 when the number of workbooks purchased are more than or equal to 5

Likewise, I used printf to create and display the title of the table and lines. In order to create the table, for loop is used whereby the no_of_workbook is initialized to 1, the condition of the loop is the no_of_workbook must be less than 11 and the no_of_workbook is incremented as shown in the statement below.
Eg:
printf("Workbook Prices Table\n"); printf("\t\t\tNumber of Workbooks\n"); printf("+-------+------+------+------+------+------+------+------+------+------+------+\n"); printf("| |"); for(no_of_workbook=1 ; no_of_workbook<11 ; no_of_workbook++){ printf("%4d |", no_of_workbook); } printf(" +-------+------+------+------+------+------+------+------+------+------+------+\n"); printf("|Yr 1,2 |"); for(row=1 ; row<11 ; row++){ if(row<5){ year12 += BOOK_FEE_12;
If else statement is used inside the for loop to calculate the price of the workbook for year 1,2,3 and 4
If else statement is used inside the for loop to calculate the price of the workbook for year 1,2,3 and 4 printf("%4d |", year12); } else{ year12 += BOOK_FEE_12; year12_2 = year12*BOOK_DISCOUNT; printf("%4d |", year12_2); }
}
printf(" |Yr 3,4 |"); for(row=1 ; row<11 ;row++){ if(row<5){ year34 += BOOK_FEE_34; printf("%4d |", year34); } else{ year34 += BOOK_FEE_34; year34_2 = year34*BOOK_DISCOUNT; printf("%4d |", year34_2); } } printf(" +-------+------+------+------+------+------+------+------+------+------+------+\n");
Check balance()
Check balance()

Display card balance
Display card balance

No
No

Payment screen
Payment screen
Card balance<4000
Card balance<4000

Yes
Yes

Read top up amount
Read top up amount

Card balance = card balance + top up amount
Card balance = card balance + top up amount

Diagram 2.5 shows the flowchart for check balance function
Using while loop instead of do while loop
In check balance function, user is required to enter the top up amount when the initial card balance is less than RM 4000.00. The program will display the updated card balance after adding the top up amount with the initial amount of card balance. In addition to that, the program will continue to ask the user to top up the amount if the amount of the updated card balance is still below RM 4000.00. Therefore, it is wise to use looping method such as while loop or do while loop to make the program repeats a segment of code.
In this case, while loop is the most suitable looping method to be used in this check balance function compared to do while loop. This is because do while loop is a post test loop meaning it will execute the actions first before checking the condition. For example, if the user’s initial card balance is RM 5000.00 which is above RM 4000.00, the program will continue to prompt the user to top up the amount even though the initial card balance is already enough to continue to make payments for fees and workbooks. Therefore, it is wise to use a pre test loop which is while loop. For example, when the user’s initial card balance is RM 5000.00, the program will not prompt the user to top up the amount because the condition of the while loop is false and unmatched. When the condition is not matched, the program will direct the user to payment screen function to make payments for fees and workbooks.
Payment screen()
Payment screen()

Read year of study
Read year of study

Read semester
Read semester

Read number of workbooks
Read number of workbooks

Total charges = annual fee +semester fee + workbook price
Total charges = annual fee +semester fee + workbook price

Display total charges
Display total charges

Card balance > total charges
Card balance > total charges
No
No

Display insufficient funds
Display insufficient funds

Display card balance
Display card balance
Yes
Yes

Display payment approved
Display payment approved

Display remaining card balance
Display remaining card balance

Diagram 2.6 shows the flowchart for payment screen function
Diagram 2.6 shows the flowchart for payment screen function
Return
Return

3. Constants & Variables
Declarations from the program : int year, semester, num_of_books, book_no, annual_fee, long_sem_fee, short_sem_fee, row, no_of_workbook, year12, year12_2, year34, year34_2; double CARD_BALANCE, MIN_CARDBALANCE, BOOK_DISCOUNT, BOOK_FEE_12, BOOK_FEE_34, SEM_3_FEE, top_up_amount, start_balance = CARD_BALANCE, annual_fee, semester_fee, workbook_price, total_charges, book_price, book_price2, total_topup, total_fees_paid, fees_paid, total_workbook_paid; char decision;

Constant | Description | Data Type | Value | CARD_BALANCE | To store the starting debit card balance | double | 1000.00 | MIN_CARDBALANCE | To store the minimum value of the card balance that is already fixed | double | 4000.00 | BOOK_FEE_12 | To store the starting value of the workbook price for year 1 and 2 | double | 100.00 | BOOK_FEE_34 | To store the starting value of the workbook price for year 3 and 4 | double | 150.00 | BOOK_DISCOUNT | To store the value of the discount given to the students who purchase 5 workbooks and above for year 1,2,3 and 4. | double | 0.9 | SEM_3_FEE | To store the value that is used to calculate the fees for semester 3 in year 1,2,3 and 4 | double | 0.5 |

Variable Name | Description | Data Type | year | To read the year entered by student | int | semester | To read the semester entered by student | int | num_of_books | To read the number of books entered by student | int | book_no | To store the number of workbooks in the workbook price table and it is used to determine the price of the workbooks depending on the number of workbooks that is purchased by the student | int | annual_fee | To store and calculate the values of annual fee based on the fees structure table | int | long_sem_fee | To store the values of long semester fee based on the fees structure table | int | short_sem_fee | To store the values of short semester fee based on the fees structure table | int | row | To store the number of rows that is used in looping statement to create and display the workbook prices table | int | no_of_workbook | To store the number of workbooks in the workbook price table and it is used in looping statement to determine the price of workbooks for year 1,2,3 and 4 | int | year12 | To store the starting value of the workbook price for year 1 and 2 | int | year12_2 | To store the workbook price for year 1 and 2 when the number of workbooks purchased are more than or equal to 5 | int | year34 | To store the starting value of the workbook price for year 3 and 4 | int | year34_2 | To store the workbook price for year 3 and 4 when the number of workbooks purchased are more than or equal to 5 | int | top_up_amount | To read the top up amount entered by user. | double | start_balance = CARD_BALANCE | To store the CARD_BALANCE and the value is used to calculate the total card balance after adding the value of top up amount to it | double | semester_fee | To calculate the semester fee for year 1,2,3 and 4 based on the fees structure table | double | workbook_price | To calculate the payment for workbooks based on the workbook prices table | double | total_charges | To sum up the annual fee, semester fee and workbook price | double | book_price | To store the starting value of workbook price for year 1,2,3 and 4 based on the workbook prices table and it is used in the calculation of workbook price | double | total_topup | To calculate the total top up amount that is entered by the student | double | fees_paid | To sum up the annual fee and semester fee | double | total_fees_paid | Another variable that has been initialized to zero and it is used to calculate the total fees by adding the fees paid to it | double | total_workbook_paid | To calculate the total cost of the workbooks by adding the workbook price to it | double | decision | To read the decision of the students by asking them whether they want to continue for more payments. | character |

4. Overall Program Design
Debit Card Balance Program
Debit Card Balance Program

Main function
Main function

Transaction Summary function
Transaction Summary function
Payment Screen Function
Payment Screen Function
Check balance function
Check balance function
Splash screen function
Splash screen function

Display transaction summary
Display transaction summary
Display logo
Display logo

Display card balance
Display card balance
Get top up amount
Get top up amount

Calculate card balance
Calculate card balance
Reference Table Function
Reference Table Function

Display total charges
Display total charges
Get year of study, semester, number of workbooks
Get year of study, semester, number of workbooks
Display Fees Structure Table
Display Fees Structure Table

Calculate total charges
Calculate total charges
Display Workbook Price Table
Display Workbook Price Table

Diagram 4.1 shows the structure chart for overall program design

5. Program Outputs Screenshots for splash screen Screenshot for logo

Screenshot for Fees Structure Table & Workbook Price Table

Test Data & Expected Outputs – Run 1 | Test Data | Expected Results/ Outputs | Sequence of Actions/Scenarios | Year | Sem | #work books | Top Up amount | Calculation/Payment details | Total Payment | Balance | Starting | | | | | | | Starting balance = 1000 | Top Up, but not reach minimum | | | | 2500 | | | 3500 | Top Up, still not reach minimum | | | | 300 | | | 3800 | Top Up, reach minimum | | | | 700 | | | 4500 | Pay Fees & buy books – no discount, enough funds | 1 | 1 | 3 | | Annual = 200 Sem = 1000 Books = 300 | 1500 | 3000 | Top up is required | | | | 4000 | | | 7000 | Pay Fees & buy books –got discount, not enough funds | 1 | 2 | 200 | | Annual = 200 Sem = 1000 Books = 18000 | 19200 | 7000 | Pay Fees & buy books – got discount, enough funds | 1 | 3 | 10 | | Annual = 200 Sem = 500 Books = 900 | 1600 | 5400 | Validation | -2 | | | | | | 5400(no change) | Pay Fees & buy books – got discount, enough funds | 2 | 1 | 5 | | Annual = 300 Sem = 1200 Books = 450 | 1950 | 3450 | End of Payment | | | | Total = 7500 | Total fees = 3400 Total cost of books = 1650 | | Ending balance= 3450 |

Screenshots – Run 1

Test Data & Expected Outputs – Run 2 | Test Data | Expected Results/ Outputs | Sequence of Actions/Scenarios | Year | Sem | #work books | Top Up amount | Calculation/Payment details | Total Payment | Balance | Starting | | | | | | | Starting balance = 1000 | Top Up, but not reach minimum | | | | 200 | | | 1200 | Top Up, still not reach minimum | | | | 1000 | | | 2200 | Top Up, reach minimum | | | | 3000 | | | 5200 | Pay Fees & buy books – no discount, enough funds | 3 | 1 | 8 | | Annual = 400 Sem = 1400 Books = 1080 | 2880 | 2320 | Top up is required | | | | 5000 | | | 7320 | Pay Fees & buy books – got discount, enough funds | 3 | 3 | 30 | | Annual = 400 Sem = 700 Books = 4050 | 5150 | 2170 | Top up is required | | | | 2000 | | | 4170 | Validation | 4 | 0 | | | | | 4170(no change) | Pay Fees & buy books – no discount, enough funds | 4 | 1 | 1 | | Annual = 500 Sem = 1600 Books = 150 | 2250 | 1920 | Top up is required | | | | 3000 | | | 4920 | Validation | 4 | 3 | -9 | | | | 4920(nochange) | Pay Fees & buy books – no discount, enough funds | 4 | 3 | 4 | | Annual = 500 Sem = 800 Books = 600 | 1900 | 3020 | End of Payment | | | | Total = 14200 | Total fees = 6300 Total cost of books = 5880 | | Ending balance= 3020 |

Screenshots – Run 2

6. Discussion & Evaluation Enhancements In designing this program, there are two enhancements that are used in this program in order to make it work efficiently and logically. Usage of call function The first enhancement of this program is the usage of call function. When call function is used, the whole program is more efficient and easier to understand as the parts of program are not scattered and are more organized. Thus, it provides more flexibility and modularity meaning each function only perform or focus on one task. Data validation on range checking Data validation is applied in this program to restrict the user to input correct data. It is necessary for the program to get correct and required data so that it is logical. For example, in this program there is only year 1 to 4 of study given. If the student keys in a number which is more than 4 or less than 1, the program will display an error message like “Invalid year!” and it will continue to ask the student to enter the year of study until it meets its requirement. Better ways to improve the program
Data validation on data type
There should have a data validation on the data type. For example, if user keys in non-numbers, such as ‘a’,’+’, and ‘#’, error message should be displayed because the program only requires user to key in integer and double data type.
Error counting
Error count should also be included in the program so that user is only allowed to key in the wrong or unrelated data for a certain number of times.

Evaluation
Program Evaluation
The outputs are accurate and all scenarios are considered. All requirements in the questions have been solved. Therefore, the program is efficient and well-organized.
Personal Evaluation
The program has been very challenging because all situations have to be considered. It is also very time-consuming as one small mistake will lead to the wrong or unexpected outcome and this will require time to re-plan the solutions.
Personal Reflection
I have learnt that it is important to consider all kinds of situation in order to make the program work efficiently. Through this assignment, I gained a better understanding on how the loops work in the program.

Appendix Program Listing
/****************************************************************************
* Name : Adelina Tang Chooi Li *
* Programme : DIA1 *
* Tutorial Group : F1 *
* Course Code Year : AACS1074 *
* Program : Debit Card Balance Program.c *
* Purpose : To keep track of student's balance after deducting *
* Charges for each fees or workbooks and produce a *
* Transaction summary for it *
* *
* Submission date : 25 July 2014 *
* Date completed : 20 July 2014 *
******************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#define CARD_BALANCE 1000.00
#define MIN_CARDBALANCE 4000.00
#define BOOK_DISCOUNT 0.9
#define BOOK_FEE_12 100.00
#define BOOK_FEE_34 150.00
#define SEM_3_FEE 0.5

/******************** Function Prototypes ************************************/ void splash_screen(); void display_ref_table(); void check_balance(); void payment_screen(); void display_summary();

/******************** Global Variables ***************************************/

double top_up_amount, start_balance = CARD_BALANCE, annual_fee, semester_fee, workbook_price, total_charges; double book_price,total_topup, total_fees_paid, fees_paid, total_workbook_paid; int year, semester, num_of_books, book_no; char decision;

int main()
{
splash_screen(); display_ref_table(); do { check_balance(); payment_screen(); }while(decision == 'Y' || decision == 'y'); display_summary();

system("pause"); return 0;
}

/******************** Splash Screen Function **************************************/ void splash_screen()
{
//logo printf("\n\n\n\n\t ======================================================\n"); printf("\t + +\n"); printf("\t + ##### # ### ### # ## # # # # # # # +\n"); printf("\t + # ### # ## # ## ### ## # # # ##### # # +\n"); printf("\t + # # # ### ### # # ### # ## ##### # # +\n"); printf("\t + # ### # # # ## ### # ### # # ### # # +\n"); printf("\t + # # # # # ### # # # ## # # # ## +\n"); printf("\t + +\n"); printf("\t ======================================================\n\n"); //splash screen duration _sleep(5000); system("cls");
}

void display_ref_table(){ int year, annual_fee, long_sem_fee, short_sem_fee; int row, no_of_workbook, year12, year12_2, year34, year34_2;

annual_fee = 200; long_sem_fee = 1000; short_sem_fee = long_sem_fee * SEM_3_FEE;

year12 = 0; year34 = 0; //fees table printf("Fees Structure Table\n"); printf(" +---------------+----------------+-------------------+--------------------+\n"); printf(" | Year of Study | Annual Fee | Long Semester Fee | Short Semester Fee |\n"); printf(" | | (pay in Sem 1) | (Sem 1 & Sem 2) | (Sem 3) |\n"); printf(" +---------------|----------------|-------------------|--------------------+\n"); //loop fee for(year = 1; year < 5; year++) { printf(" | %d | %d | %d | %d |\n", year, annual_fee, long_sem_fee, short_sem_fee); annual_fee = annual_fee + 100; long_sem_fee = long_sem_fee + 200; short_sem_fee = long_sem_fee * SEM_3_FEE; } printf(" +---------------+----------------+-------------------+--------------------+\n\n");

//workbook table printf("Workbook Prices Table\n"); printf("\t\t\tNumber of Workbooks\n"); printf("+-------+------+------+------+------+------+------+------+------+------+------+\n"); printf("| |"); for(no_of_workbook=1 ; no_of_workbook<11 ; no_of_workbook++){ printf("%4d |", no_of_workbook); } printf(" +-------+------+------+------+------+------+------+------+------+------+------+\n"); printf("|Yr 1,2 |"); for(row=1 ; row<11 ; row++){ if(row<5){ year12 += BOOK_FEE_12; printf("%4d |", year12); } else{ year12 += BOOK_FEE_12; year12_2 = year12*BOOK_DISCOUNT; printf("%4d |", year12_2); } } printf(" |Yr 3,4 |"); for(row=1 ; row<11 ;row++){ if(row<5){ year34 += BOOK_FEE_34; printf("%4d |", year34); } else{ year34 += BOOK_FEE_34; year34_2 = year34*BOOK_DISCOUNT; printf("%4d |", year34_2); } } printf(" +-------+------+------+------+------+------+------+------+------+------+------+\n");

system("pause"); system("cls");

}

/***********************Check Balance Function ************************/ void check_balance()
{
printf("Your card balance is RM%.2f\n\n",start_balance);

while(start_balance<MIN_CARDBALANCE) { printf("You must have at least %.2f to continue.\n", MIN_CARDBALANCE); printf("Top Up Amount? RM "); scanf("%lf", &top_up_amount); start_balance += top_up_amount; total_topup += top_up_amount;//calculation for transaction summary printf("Your balance is now RM %.2f\n\n",start_balance); }
}

/**********************Payment Screen Function*************************/ void payment_screen()
{
printf("Please enter Year of Study\t:"); scanf("%d",&year); while(year<=0 || year>4){ printf("Invalid year!\n"); printf("Please enter Year of Study\t:"); scanf("%d",&year);
}
printf("Please enter the Semester\t:"); scanf("%d",&semester); while(semester<=0 || semester>3){ printf("Invalid semester!\n"); printf("Please enter the Semester\t:"); scanf("%d",&semester); } printf("Number of workbooks required\t:"); scanf("%d",&num_of_books); while(num_of_books<0){ printf("Invalid number of workbooks!\n"); printf("Please enter the number of workbooks required\t:"); scanf("%d",&num_of_books); }

if(year == 1) //Year 1's Annual fee, Semester fee & Calculations for Workbook fees { if(semester == 1) { annual_fee = 200; semester_fee = 1000; } else if(semester == 2) { semester_fee = 1000; } else { semester_fee = 1000 * SEM_3_FEE; } book_price = 0.00; for(book_no = 1; book_no <= num_of_books; book_no++) { book_price += BOOK_FEE_12; if (book_no >= 5) { workbook_price = book_price * BOOK_DISCOUNT; } else { workbook_price = book_price; } } } else if(year == 2) //Year 2's Annual fee, Semester fee & Calculations for Workbook fees { if(semester == 1) { annual_fee = 300; semester_fee = 1200; } else if(semester == 2) { semester_fee = 1200; } else { semester_fee = 1200 * SEM_3_FEE; } book_price = 0.00; for(book_no = 1; book_no <= num_of_books; book_no++) { book_price += BOOK_FEE_12; if (book_no >= 5) { workbook_price = book_price * BOOK_DISCOUNT; } else { workbook_price = book_price; } } } else if(year == 3) //Year 3's Annual fee, Semester fee & Calculations for Workbook fees { if(semester == 1) { annual_fee = 400; semester_fee = 1400; } else if(semester == 2) { semester_fee = 1400; } else { semester_fee = 1400 * SEM_3_FEE; } book_price = 0.00; for(book_no = 1; book_no <= num_of_books; book_no++) { book_price += BOOK_FEE_34; if (book_no >= 5) { workbook_price = book_price * BOOK_DISCOUNT; } else { workbook_price = book_price; } } } else if(year == 4) //Year 4's Annual fee, Semester fee & Calculations for Workbook fees { if(semester == 1) { annual_fee = 500; semester_fee = 1600; } else if(semester == 2) { semester_fee = 1600; } else if(semester == 3) { semester_fee = 1600 * SEM_3_FEE; } book_price = 0.00; for(book_no = 1; book_no <= num_of_books; book_no++) { book_price += BOOK_FEE_34; if (book_no >= 5) { workbook_price = book_price * BOOK_DISCOUNT; } else { workbook_price = book_price; } } }

total_charges = annual_fee + semester_fee + workbook_price; // calculations for total charge

printf("\nAnnual Fee\t\t RM %8.2f\n", annual_fee); printf("Semester Fee\t\t RM %8.2f\n", semester_fee); printf("Payment for Workbooks RM %8.2f\n", workbook_price); printf("\t\t\t--------------\n"); printf("\tTOTAL CHARGES \t RM %8.2f\n", total_charges); printf("\t\t\t==============\n");

fees_paid = annual_fee + semester_fee; // calculations for transaction summary total_fees_paid += fees_paid; // calculations for transaction summary total_workbook_paid += workbook_price; // calculations for transaction summary

if(start_balance >= total_charges) { printf("\t---> Payment Approved."); start_balance -= total_charges; printf("\n\nYour Card Balance = RM %8.2f\n", start_balance); } else { printf("\t---> Insufficient Funds!"); printf("\nYour Card Balance = RM %8.2f\n", start_balance); total_fees_paid -= annual_fee + semester_fee; //subtract unwanted total fees, so that it won't add into the transaction summary total_workbook_paid -= workbook_price; //subtract unwanted total cost of workbooks so that it won't add into the transaction summary } printf("Continue with more Payments (Y for yes)? "); fflush(stdin); scanf("%c", &decision);
}

/**********************Display Summary Function********************/ void display_summary()
{
printf("\n\n\n\t\tTRANSACTIONS SUMMARY\n\n"); printf("Starting Balance \t\t\t\t RM %8.2f\n", CARD_BALANCE); printf("Total Amount Topped Up \t\t\t\t RM %8.2f\n", total_topup); printf("Total Fees Paid \t\t\t\t RM %8.2f\n", total_fees_paid); printf("Total Cost of Workbooks \t\t\t RM %8.2f\n", total_workbook_paid); printf("Ending Balance\t \t\t\t\t RM %8.2f\n", start_balance); printf("\n\nHAVE A NICE DAY!"); printf("\t\t\t\tProgrammed by:\n"); printf("\t\t\t\t\t\t Adelina Tang\n\n");
}

Similar Documents

Free Essay

Reading Program

...Title: “The Effectiveness of Reading Program on the Reading Comprehension Skills of Grade I Pupils in Sto. Niño ElementarySchool S.Y. 2011-2012 I. SITUATION Many pupils continue to struggle with acquiring the necessary skills to become successful readers. Reading “comprehension is critically important to the development of children’s reading skills and therefore to the ability to obtain an education.” Furthermore, children without high levels of reading comprehension face a difficult and uncertain economic future. Recreational reading programs are designed to encourage the development of the “reading habit.” Reading is a skill that requires much practice to perfect. Activities to practice reading should bring both success and enjoyment to all children in order to foster an ongoing interest in reading. One of the programs of the DepEd regarding reading is the ECARP Every Child A Reader Program under this are the PHILIRI, DEAR and other remedial reading programs. . This study investigated the effectiveness of this program on the reading abilities, skills and comprehension of pupils in Grade One. II. PROBLEM Title: ““The Effectiveness of Reading Program on the Reading Comprehension Skills of Grade I Pupils in Sto. Niño ElementarySchool S.Y. 2011-2012 The study aims to answer the following question: 1. What is the profile of the child in terms of: a. grade level b. sex c. sibling position d. hobby e. educational attainment of parents f...

Words: 758 - Pages: 4

Free Essay

Program

...Abstract: “To solve the problem of time-cost tradeoff in project management with available models, a choice must be made between heuristic approaches and algorithms based upon restrictive assumptions about the shape of the cost-time functions of the activities. The algorithm presented in this article involves a dynamic-programming approach to determine the allocation which minimizes the duration of the project (critical path). The main advantage of this model is its ability to determine the optimum allocation among activities with arbitrary cost-time functions. Also, computational shortcuts for functions with special properties can be used to increase the efficiency of the model” (Don Robinson 158-166). Programming solutions . Developers who program for any project has multiple requirements to be met. The key is understanding the problem to be familiar with the business. A visionary understanding the management of the business. Then a visual plan must be drawn with a step by step process to understand the goals of the company. It is easy to do this if you are the owner of the company and it is difficult to bring it to the IT/developer of the company. I have experienced this personally via my small business even though I tried desperately to bring my ideas, there was always a gap bringing the need and the vision. IF we discuss the need, we had to set multiple meetings where the developer had researched the system and saw the flaws with his own ideas on how to improve it. It was very...

Words: 827 - Pages: 4

Premium Essay

Girls Program

... Focused And Naturally Confident Youth After School Based Program Girls Group Executive Summary The overwhelming need for gender specific youth programs have been recognized across the United States. Gender specific programming goes beyond simply focusing on girls. It represents a concentrated effort to assist all girls (not only those involved in the justice system) in positive female development. It takes into account the developmental needs of girls at adolescence, a critical stage for gender identity formation. It nurtures and reinforces “femaleness” as a positive identity with inherent strengths. The founder of T.E.A.M., Inc. (Teaching Empowering And Motivating), Janaha Ransome has the skills needed to implement a gender specific curriculum that is evidenced based an effective. As a highly skilled Chief Executive Officer, Program Manager and Assistant Director, Janaha Ransome has proven experience in building professional relationships with various community groups and developing and implementing successful community-based programs. With more than 10 years in the non-profit and for-profit arena, Janaha Ransome has developed the skills necessary to design and implement programs that promote and enhance economic self-sufficiency and quality of life. She is also able...

Words: 695 - Pages: 3

Free Essay

Functionality of Programs

...Functionality of Programs University of Phoenix Java Programming IT/215 Functionality of Programs Consider a Java-based application example with file access and file-processing methods appropriate for e-business. Write a 200- to 300-word response that explains why that functionality is valuable for business. One of the biggest benefits of Java is that it facilitates the viewing of information from just about anywhere there is a computer. As long as that computer is compatible with Java that is. A business is able to view inventory, parts, drawings, employee dispatches, and any imaginable number of other desired items. With Java the ability to quickly add, and remove components makes it an extremely valuable tool for business. Java can allow a user to make changes to the data in the program without being physically onsite. Being able to make changes freely without being tied to the office allows for much more flexible work, and saves time and money. With a global economy, the ability to hire, and allows professionals to work in their home country without having to be tied to the office is a major benefit. It allows for companies to find the most experienced, and qualified individuals no matter where they are in the world. Java is amazing with the visuals that it provides a user. A business can use pictures to show products, zoom, rotate, and pan makes for a better user experience. It enhances the overall functionality of a program as well. It presents a professional...

Words: 303 - Pages: 2

Free Essay

Training and Mentoring Program

...Training and Mentoring Program xxxxxxxxxxxxx HRM/531 December 5, 2011 Dr. Penny Wilkins Evaluation Ford provides many kinds of training programs to its employees, dealers and suppliers. For successful training programs it is important to see the reaction, transfer and its effect on the employees and company. Six Sigma is a successful training program Ford started in 1999. The first phase of Six Sigma called for customer satisfaction. "In fact, one and a half points of customer satisfaction drive about one point more loyalty. In North America alone, this translates into more than $2 billion in incremental revenue and roughly $100 million in profit." (http://www.qualitydigest.com). The employees gave a good response to this training and earned green belts, black belts, master black belts. Master black belts helped train senior leaders to apply Six Sigma in their departments. This program was such a success that in 2000, it helped to add $52 million to the bottom line of the company. Ford assembly plant in Chicago underwent a new training program accompanied with new tools and machinery, successfully reinvented Ford Explorer 2011. Ford Explorer 2011 is best in class fuel economic, improved driving dynamics and lightweight in design. ‘The reinvented 2011 Ford Explorer has started rolling off the line at Ford’s Chicago Assembly Plant, marking a new beginning for both the historic factory and the iconic SUV (media.ford.com). Reinforcement and Sustainability Ford reinforce...

Words: 537 - Pages: 3

Premium Essay

Frequent Shopper Program

...Frequent Shopper Program Tonya Freeman-Gely BSA/310 March 25, 2013 Jeffrey Doolin Abstract Kudler Fine Foods has decided that it would be beneficial to the company to create and utilize a Frequent Shopper Program. In order to help make this happen Smith Consulting has been hired to design and develop a Frequent Shopper Program that will be functional and effective. Throughout this paper there will be different concerns discussed in regards to the new program, such as: legal, ethical, and information security. Also discussed within this paper will be the financial costs of acquiring the new program. Frequent Shopper Program Introduction Kudler Fine Foods is a small company that is ever growing and looking for better ways to improve as far as the needs of the customers as well as the company. The current proposal to better benefit these needs is a Frequent Shopper Program. A Frequent-Shopper or Loyalty-Marketing program is an electronic method of identifying customer purchases and translating that information on their shopping habits and preferences (Retailer & FSP, 2012). The program will allow the shoppers at Kudler Fine Foods to earn points based on the purchases they make (Rogers, 2011). However there are certain concerns that could greatly effect the new program. In this paper the concerns will be broken down into sections so that it is easier to understand what they are and how they effect the program. In the first section the financial aspect will...

Words: 1481 - Pages: 6

Premium Essay

Mentoring vs. Induction Programs

...Induction Programs 1 Mentoring versus Induction Program Andrea Tubbs AED/201 Breanna Becker June 13, 2010 Mentoring vs. Induction Programs 2 One of the main factors new teachers leave after a few years of teaching is socialization. With all the training and along with additional tools new teachers get before entering into the classroom. They’re faced with so many obstacles as new teachers, that’s why it’s so good to have programs like mentoring and induction programs to help on this journey during the first couple years of teaching. Mentoring Programs are programs organized by experienced or veteran teachers, whose job is to help the new or beginning teacher. Their responsibility is to offer advice, guidance, and support for them to take back to the classroom. Induction programs are programs that are established to first year teachers that provide workshops, internships and the oppourinty for teachers to observe their future peers in the classroom to see how it’s done. These tools will provide aide to them, to use when facing adversity, challenges or any difficult situation that will arise in the classroom. The purpose of the mentoring program is to give personal and long-term individual support to the new teachers. New teachers are assigned to a mentor who will offer guidance and support to them during their first year experience. Even though mentoring is part of induction process it’s not induction. On the other hand induction programs are designed...

Words: 1076 - Pages: 5

Free Essay

Channeling Students Into a Gifted Program

...Channeling students into a gifted program There is a four step protocol for channeling students into a gifted program. Those steps are; early intervention, identifying students, what the program offers, and what the students will experience. Let’s start with early intervention: Early intervention has the ability to enhance a child’s development, increase the child’s and families benefit to society and receive full support from the staff. Children who come across as gifted are given two tests to determine just how gifted they are. One of those test is based on their academics and the other is based on their creativity. This is way to determine if any intervention needs to put into motion and helps determine just how gifted they are. The second step is identifying just how the students qualify for the program. There is a series of steps that can help determine if a child is gifted. One is a child’s test scores, any child who can score above the 85 percentile can be a candidate for the gifted programs. A teacher nomination is one other way to qualify. Teachers are informed of all students who have received entrances through teacher nominations. Gifted students have to have the ability to excel in their studies, and must remain focused on their school work. The gifted programs can offer full support from their teachers, parental involvement in their education, lessons in self-motivation, grade level advancement, and excellent academic recommendations for future college course...

Words: 311 - Pages: 2

Free Essay

Program Evaluation

...Program evaluation is a systematic method for collecting, analyzing, and using information to answer basic questions about a program. While there are many types of program evaluations, and many terms used to describe them, evaluations are typically divided into two major categories: process evaluations and outcome evaluations. Process evaluations assess whether an intervention or program model was implemented as planned, whether the intended target population was reached, and the major challenges and successful strategies associated with program implementation. Outcome evaluations determine whether, and to what extent, the expected changes in a public health or not-for- profit company’s outcomes occur and whether these changes can be attributed to the program or program activities. Five reason to conduct a program evaluation in the public health and not- for- profits sectors. #1 A program evaluation can find out what works and doesn’t work. A process or outcome evaluation enables program managers to answer basic questions about a program’s effectiveness, including: Are participants benefiting from the program services? Are strategic implementations working? Are employees satisfied with the changes, and so. #2 A program evaluation can showcase the effectiveness of a program to the community and funders. #3 A program evaluation can improve staff’s frontline practice with participants. #4 A program evaluation can increase a program’s capacity to conduct a critical...

Words: 457 - Pages: 2

Premium Essay

Program Evaluation

...Program Planning and Evaluation Paper Kendra Hammond HSM/270 June 16, 2013 William Latta When creating a human services organization, program planning and program evaluation is vital. For a successful organization one can not exist without the other. Program planning entails researching, making goals, setting objectives, and answers who, what, and why questions. The development of program planning helps establish what resources will be needed to achieve the goals and objectives of the human services organization. The finances and budget are also included in program planning. In the program plan it should include what is the problem that is being addressed, why this problem exists, who is the target population, and where the target population is demographically sited. When creating a program plan, it requires logical thinking and a high level of information processing. The plan should be able to provide information on the services that the program wishes to provide to their clients. Throughout the thought process of the plan, the program should consider and include in the plan what obstacles they may encounter and ways to overcome them. The program planning stage in creating a human services organization is essential, because it determines the budget, the timeline, and sets expectations for the entire organization. The heart of this stage is how the organizations product and services will be developed and delivered. Program planning should be done thoroughly and carefully...

Words: 727 - Pages: 3

Free Essay

A Computer Program

...ENGL106-X-1205A-05 A computer program, also software, or just a program or application is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions. The same program in its human-readable source code form, from which executable programs are derived (e.g., compiled), enables a programmer to study and develop its algorithms. Computer source code is often written by computer programmers. Source code is written in a programming language that usually follows one of two main paradigms: imperative or declarative programming. Source code may be converted into an executable file (sometimes called an executable program or a binary) by a compiler and later executed by a central processing unit. Alternatively, computer programs may be executed with the aid of an interpreter, or may be embedded directly into hardware. Computer programs may be categorized along functional lines: system software and application software. Two or more computer programs may run simultaneously on one computer, a process known as multitasking. Computer programming is the iterative process of writing or editing source code. Editing source code involves testing, analyzing, and refining, and sometimes coordinating with other programmers on a jointly developed program. A person who practices...

Words: 983 - Pages: 4

Premium Essay

Creating a Program

...While working in my most recent job, I was in charge of a backroom for a large retail company, and quickly realized that I could solve many issues with just a few simple programs. While I know in the spectrum of business, software or hardware changes are anything but simple, though the idea itself was relatively easy. I quickly realized that while during our inventory process that we would do most mornings, that while there was a system for the corporation to keep track of where and what was being shipped, we as the store did not have much of a hint as to what we were getting or for that matter how much of certain products we had at all. Being an intermediate programmer, I generally think in terms of programs and how I could make things better and easier, not only for myself but for everyone else on my team. The first thing for me is to get a view of the big picture of things, falling in line with the first step of the programming development cycle, Analyze. This gives me a chance to make sure that the ideas that I am coming up with are not just one of those far fetched, well if we had a stick, a match and a kangaroo type of ideas, but actually legitimate ideas that could improve our work flow. It gives me a good idea of what information you would need on both ends, being your inputs and outputs. The next step is designing my personal favorite. This is where you are fixing the problem with an algorithm, or a logical sequence of steps to solve a particular problem. I am very much...

Words: 855 - Pages: 4

Free Essay

Fuctionality of Programs

...Functionality of Programs John Padgett IT 215 Java Programming October 16, 2013 MRUDHULA BALASUBRAMANYAN Functionality of Programs In today’s business world the companies of today need to have the ability to share what seems to be a never ending huge amount of data and information between different organizations with-in the company and other companies, and then there is the most important aspect of doing business and that is sharing information and gathering data on the customers doing business with the companies. The way companies survive in today’s business world they have to be able to store data and one way of storing that data is to create files so that data can be stored and later retrieved whenever that information is needed. Being able to share and exchange those files is available through the use of Java applications, those applications help companies does this easily and productively without many complications. A great example would be an e-business like ITunes, this site lets you download movies, music (albums or single songs). You create an account and have the availability to listen to them from your computer or other devices that you can download whatever music you like or movies you like. The music and movies are files that are stored in a huge database for ITunes. Java applications are used to make the information secure and easily accessible to the customers to listen or watch anytime they wish to use their account...

Words: 339 - Pages: 2

Free Essay

Computrt Program

...UU SOB Business Solution Software Program School of Business A PROJECT OF COMPUTER PROGRAM ON UU SOB BUSINESS SOLUTION SOFTWARE Course Title: Computer Programming Course Code: CSE-212 Submitted To Mamun Abdul Kayeum Coordinator of BBA School of Business Uttara University Submitted By: Business Solution Group Name ID. No Batch Md. Amzad M-20731111025 14th Umme Habiba F-20711111003 12th Md. Ashique Ikbal Rana M-20731111059 14th Morshed Alam Bulbul M-20731111009 14th Newton Mohon Pandit M-20731111044 14th School of Business Uttara University April 24, 2010 To, Mamun Abdul Kayeum Coordinator of BBA, School of Business Uttara University. Subject: UU SOB Business Solution Software Dear Sir, I am very much glad to submit the term paper on Computer Program. The report is required for the completion of BBA program. All the information of this term paper have been presented with sincerely and honesty. I have given my whole hearted effort to this task. But there may be some short comings, I will be grateful to you if I consider these. I tried to my best to present this report enough holistic and informative. Finally, the tasks of Software solution on Computer Program have given us a new experience that is superior asset for us. We stormy beeline this work will helpful in our whole life. Yours Sincerely...

Words: 424 - Pages: 2

Premium Essay

Computer Program

...COMPUTER PROGRAM/CODE Oxford Dictionary: A series of coded software instructions to control the operation of a computer or other machine. Webster’s Dictionary: A sequence of instructions that a computer can interpret and execute; "the program required several hundred lines of code". A program is an intermediate language that helps the user and the machine communicate. The user gives instructions to the machine through the program and the machine sends its output back to the user the same way. A computer program or code, more specifically, is a set of instructions in an intermediate language between the user and a computer. The computer only understands a language called the binary language which is too complex for every user to learn. Hence, we have programming languages, which are basically languages, which convert our instructions in English to instructions in the binary language for the computer to understand and interpret. Computer programmers are those who learn these languages and can create lines of instructions for the computer. These lines put together form a code or program. All the websites, applications, games, security systems, operating systems and possibly everything we use on a computer have a code to them. Whenever we input something from the keyboard or mouse, it is sent to the code of the application and then interpreted by the code. The interpreted message is then processed by the code and a resulting action is output by the code to the...

Words: 349 - Pages: 2