Complete the function get_bank_data(). The function reads tot_customers and an array to store customer details(cust_id, cust_acc_num, cust_name, amount_in_account) in a struture for each customer at runtime. Read the customer details at runtime and store it in the array and return the array . The structure to store cust_id,cust_acc_num,cust_name,amount_in_account is predefined, refer it for your task completion.Input Format:Accept the count of total customers - which is provided inside main()Read customer id, customer account number , customer name and amount in account as line separatedand repeat it for total count of customers.Output Format:Returning the the read input from the function to main i
Question
Complete the function get_bank_data(). The function reads tot_customers and an array to store customer details(cust_id, cust_acc_num, cust_name, amount_in_account) in a struture for each customer at runtime. Read the customer details at runtime and store it in the array and return the array . The structure to store cust_id,cust_acc_num,cust_name,amount_in_account is predefined, refer it for your task completion.Input Format:Accept the count of total customers - which is provided inside main()Read customer id, customer account number , customer name and amount in account as line separatedand repeat it for total count of customers.Output Format:Returning the the read input from the function to main i
Solution
Here is a Python solution for the problem:
class Customer:
def __init__(self, cust_id, cust_acc_num, cust_name, amount_in_account):
self.cust_id = cust_id
self.cust_acc_num = cust_acc_num
self.cust_name = cust_name
self.amount_in_account = amount_in_account
def get_bank_data(tot_customers):
customers = []
for _ in range(tot_customers):
cust_id = input("Enter customer id: ")
cust_acc_num = input("Enter customer account number: ")
cust_name = input("Enter customer name: ")
amount_in_account = input("Enter amount in account: ")
customers.append(Customer(cust_id, cust_acc_num, cust_name, amount_in_account))
return customers
This solution defines a class Customer to hold the customer details. The get_bank_data function then creates a new Customer object for each customer, reading the details from the user. These Customer objects are stored in a list, which is returned at the end of the function.
Similar Questions
Write a program to create a bank customer information using array of structures, nested structures and functions.First structure should hold the following information: Customer personal details: Name, Gender, Account Number, DOB; Second structure should hold the following information: Customer account details: Type of account, opening balance, closing balance
Write a java program to create a bank account with Name of the account holder, type of account(savings or current), Account number and Balance amount in the account. Also, create 5 customers for the class Bank_account using array of objects. Access the customers to perform credit, debit and display of balance.Input 1:Enter the customers:ReenaSavings1231000RobinCurrent4562000PraveenSavings7893000SherinCurrent2342500DeenaSavings5672000Enter choice:1. Credit2. Debit Output :ReenaSavings1232000
Input 1 bala balaji 5000 2 arun arunbalaji 5000 3 raj raja 3000 4 raj rajkumar 5000 5 ramesh rameshbabu 6000 Expected output Customer Information: Customer 1: Customer ID: 1 Last Name: bala First Name: balaji Credit Limit: $5000 Customer 2: Customer ID: 2 Last Name: arun First Name: arunbalaji Credit Limit: $5000 Customer 3: Customer ID: 3 Last Name: raj First Name: raja Credit Limit: $3000 Customer 4: Customer ID: 4 Last Name: raj First Name: rajkumar Credit Limit: $5000 Customer 5: Customer ID: 5 Last Name: ramesh First Name: rameshbabu Credit Limit: $6000 Your Program Output 1 Doe John 8000 1 2 3 4 5 1 bala balaji 5000 2 arun arunbalaji 5000 3 raj raja 3000 4 raj rajkumar 5000 5 ramesh rameshbabu 6000
Write a query to retrieve the names of customers who have made multiple purchases and the count of their purchases.
Write a Java program to manage billing information for customers. The program should allow the user to input details for multiple customers and bills. For each customer, the program should prompt the user to enter a customer ID and name. For each bill, the program should prompt the user to enter a bill number, amount, date, and the corresponding customer ID. Once the user has input all the necessary information, the program should allow the user to search for bills by customer ID. Upon entering a customer ID, the program should display all bill amounts, dates, and numbers associated with that customer ID. Frame the program using classes for Customer and Bill, and implement methods to retrieve customer and bill details. Sample Input 3 // Number of Customers 1 // Customer IDJai // Customer Name 2Sakthi 3John 5 // Number of Bills 11 // Bill Number45663 // Bill Amount02/12/2023 // Bill Date2 // Customer ID 4489609/12/20232 77896509/04/20231 99675404/11/20221 33876511/11/202332 Sample Output 1145663.002/12/202344896.009/12/2023
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.