Question
ABC Financing company is providing credit card services to all the customers who fulfilled the requirement that is a minimum monthly salary of RM5000 and
ABC Financing company is providing credit card services to all the customers who fulfilled the requirement that is a minimum monthly salary of RM5000 and which has one financing loan which the amount of payment is less than or equal 25% from the monthly salary. The customer's data is stored in the input file that's shown in Figure 1. For the eligible customers, there are three types of cards offered; Platinum, Gold, and Silver. Table 1 shows the minimum requirement and total credit that is allowed for each card.
851205-07-6734 Afrina 17000 1 2000 851207-02-7762 Ali 40000 1 10000 801112-02-3421 Syakila 4000 1 1000 :
|
Figure 1 : Contain of input file
Table 1: Requirement for credit card application
Type of Card | Requirement: Minimum Monthly Salary | Credit Limit |
Platinum(P) | RM 40,000 | RM25,000 |
Gold (G) | RM 15,000 | RM10,000 |
Silver(S) | RM 5,000 | RM 3,000 |
- Write a function to read data from the input file and store that information in the arrays. List of arrays are as shown below.
- Array to store IC number
- Array to store nickname of the customer
- Array to store monthly salary
- Array to store number of loan
- Array to store monthly loan payment
eg: contain of arrays
IC number | 851205-07-6734 | 851207-02-7762 | 801112-02-3421 | |
|
|
|
|
|
Customer nickname | Afrina | Ali | Syakila | |
|
|
|
|
|
Monthly salary | 17000 | 40000 | 4000 | |
|
|
|
|
|
Number of loan | 1 | 1 | 1 | |
|
|
|
|
|
Monthly loan payment | 2000 | 10000 | 1000 |
- Write a function to determine the eligibility of each customer and store their eligibility in an array.
- Write a function to display a menu as shown in Figure 2 and allow a user to choose from the menu. A user may repeat this process more than once. An example of the display is shown below:
ABC Financing Company MENU
Please enter your choice : Continue [Y/N] : |
Figure 2 : Menu
Note: you may use switch statement or if else if statement to create a menu
The menu works as bellow:
- If the user choose 1 from the menu, then name list of Platinum card holder will be displayed. An example of display is shown below.
Nickname IC Number Balance from salary
Ali 851207-02-7762 RM30000
:
- If the user choose 2 from menu, then name list of Golden card holder will be displayed.
- If the user choose 3 from menu, then name list of Silver card holder will be displayed.
- If the user choose 4 from menu, the program will exit from this function.
- Write a function to store information in a file as shown in Figure 3 before end the execution of the program. (Note: N represents not eligible)
851205-07-6734 G 851207-02-7762 P 801112-02-3421 N :
|
Figure 3 : Contain of output file
- Finally call all the above functions from function main( ).
- Complete C++ Program listing with comments.
- Input and output file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started