Create a database for their customers, Database Management System

Assignment Help:

The ABC Bank authority now wants to create a database for their customers. So you are requested to modify your program of Assignment A3 as follows.

The main program first displays a menu to a user as follows in order to select an operation from the menu. 
=====================================
Welcome to ABC Back

Please choose an option from the followings.
<A>dd customers to the database
<S>earch the information for a given Customer ID (CID)
<Q>uit
=====================================

If the user chooses the option <A> then the program sets interest rate individually for all three accounts by reading a file, say "rates.txt" that contains interest rates as follows.

Saving(S)     Current (C)           Fixed Term (F)
=======    =========        ============
   0.08             0.05                       0.12


Note that the bonus interest of all customers will be calculated by using the same interest rates. It then asks the user to enter a 4-digit Customer ID (CID) for a customer in the same as it asked in Assignment A3. The program then passes the parameters (interest rates and CID) to a function called "CalculateBonusInterest()" in order to calculate bonus interest for the customer.

In the CalculateBonusInterest() function, the user needs to enter account information for the customer. But here the account information is a string. For example the string value "111" of the variable SCF indicates that a customer has all three accounts whereas "001" indicates that the customer has only Fixed term account. Note that a customer must have at least one account.

The user also needs to enter the balance of each account, that a customer has, in the function for the customer.

The function then calculates the bonus interest by using the interest rates, the account information and the rules mentioned in the table of the Assignment A2. It then stores the CID, account information, the balance of each individual account, the amount of interest of each individual account, the total interest earned from all accounts, bonus interest, and the total amount for all accounts into the customer database, say "Customer.txt".

A sample example of the "Customer.txt" file with two records is as follows.

CID       SCF  S.Bal.   C.Bal.   F.Bal.   S.Int.   C.Int.  F.Int.  Total Int.  Bonus Int.   Total Amount
====    ===   ====   =====  ====    ====  ====  ====   =====    =======    ==========
0001    111      1000     1000   1000        80     50       120     250           28.5           3278.5
0002    100      2000      -          -             160   -         -          160            15             2175.0


After storing account information, account balance and bonus interest of a customer, the program then prompts the user with the following message, "Do you want to calculate bonus interest for another customer (Y/N)? ". If the user enters "Y" then the whole process will be repeated for the new customer. Otherwise the program displays the menu to choose an operation.


Now if the user chooses the option <S> then the program first asks the user to enter a CID for finding information of a customer. Using the CID and the database "Customer.txt", it then displays the information of the customer.

For example, if the user enters a CID, say 0001, the program should display the following output.

CID    SCF     S.Bal.     C.Bal.    F.Bal.    S.Int.    C.Int.    F.Int.    Total Int.    Bonus Int.   Total Amount
====  ===     ====     =====   ====     ====    ====   ===      =====      ======      =========
0001   111     $1000     $1000     $1000     $80       $50     $120       $250         $28.5          $3278.5

After displaying the customer's account and balance information, the program then prompts the user with the following message, "Do you want to search information for another customer (Y/N)? ". If the user enters "Y" then the program asks the user to enter CID for the next customer. Otherwise the program displays the menu to choose an operation.

Finally, the program quits if the user chooses the option <Q>.

Use multiple functions, instead of using only one function to do everything. Make a good design of the functions to make the best use of the code and avoid duplicate calculations. You also need to design your program so that it has components that can be reused in another program, if needed.


Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified.

Implement your program in Python.

Comment your code as necessary to explain it clearly.

Use 1 set of test data that will demonstrate the correct normal operation of your program.

Run your program using the test data you have selected and save the output it produces in a text file.

Submit:
          1. Your algorithm.
          2. The table recording your chosen test data.
          3. Source code for your Python implementation.
          4. Output listings demonstrating the results of using the test data.

It is important that the output listings are not edited in any way.


Related Discussions:- Create a database for their customers

Super keys, A super key is an attribute or set of attributes used to recogn...

A super key is an attribute or set of attributes used to recognize the records uniquely in a relation. For instance, in the Relation PERSON defines earlier PERSON_ID is a super

Differentiate between a unique key and a primary key, Differentiate between...

Differentiate between a unique key and a primary key. - By default, clustered index on column are created by primary key while nonclustered index are created by unique key.

What is outer join, What is Outer join?  They can be employed while we ...

What is Outer join?  They can be employed while we want to keep all the tuples in R, or all those in S or all those in both relations in the result of the JOIN in spite of of w

Oracle, I have 10+ yrs exp in oracle Sql ,Pl/SQl,Forms ,Reports. I am exper...

I have 10+ yrs exp in oracle Sql ,Pl/SQl,Forms ,Reports. I am expert in assignements & Online tutoring so i want to join you. Please guide me. Thanks Brajesh Shukla +91 9899641535

Entity integrity, Before defines the second type of integrity constraint, v...

Before defines the second type of integrity constraint, viz., Entity Integrity, we should be well-known with the concept of NULL. Mostly, NULL is intended as a basis for dealing

Deadlock and its prevention, Deadlock And Its Prevention: As seen earlier,...

Deadlock And Its Prevention: As seen earlier, though two phase locking protocol handles the trouble of serialisability, but it causes some troubles also. For instance, consider th

Explain the 10 reasons to use mysql, Question 1 Explain the 10 reasons to ...

Question 1 Explain the 10 reasons to use MySQL Question 2 Write the SQL statements to demonstrate the following using SELECT command Expression Evaluation ORDER BY

Normalization, Consider a bank that has a collection of sites, each running...

Consider a bank that has a collection of sites, each running a database system. Suppose the only way the databases interact is by electronic transfer of money between one another,

Erd, Table_Name( attribute_1, attribute_2, attribute_3, ….. ,attribute_x) ...

Table_Name( attribute_1, attribute_2, attribute_3, ….. ,attribute_x) Primary Key ( attribute_1, attribute_2) Foreign Key attribute_4 References Table_Name_2 (repeat for each fore

What are the different integrity constraints in rdbms, What are the differe...

What are the different integrity constraints in RDBMS? The various integrity constraints in RDBMS are as: Primary Key: primary key is a grouping of one or more attributes

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd