Вы находитесь на странице: 1из 3

Py008

Python Core

SAP Id: _____________ Name:____________________

Duration: 3 Hours Max. Marks 100

Instructions:
1. Create a workspace and project provided with your paper. Save all your files in this
project only.
After submitting the project folder, delete it from the local machine.
2. Return the test paper to invigilator at the end of the test.
3. Referring Python Documentation is allowed.
4. Do not carry any training material during the assessment.
5. Write your SAP ID in top left corner of the test paper
6. Use of Eclipse/PyCharm is only allowed.
7. Read all the section of paper carefully.
8. Marks will be only awarded to working functionalities
9. Internet access will not be allowed during the assessment

Q. 1 – Section A [Marks:30]

ICICI Bank ltd is one of the leading bank providing different financial services to their
customers. For this they need to maintain the data of their customers. As a HCL
Technologies engineer in Python, develop the application according following
guidelines.

 Design a class Account having following private instance variable and methods
accNo String
accBal double
chequeBook String

 Create parameterized constructor having accNo, accBal and chequeBook as


arguments
 Getter methods for all attributes
 Account number should start with “ACC” as ACC001, ACC002 etc.
 Account balance must be greater than 1000
 Cheque Book should be either Yes or No

 If any of these validations failed throw a User defined Exception


InvalidDataException

 Design a class Customer having following private instance variables and


methods
custNo int
custName String
custAdd String
custPhone String
account List

 Create parameterized constructor having custNo, custName, custAdd and


custPhone as arguments
 Define a method addNewAccount(Account) which will add an account for
customer.
 Define a method List getAccountList ( ) which will return all the accounts for
customer.

Q 1 –A Steps Marks
a) Proper design of the class Account 5
b) Proper design of the class Customer and functionality of 15
addNewAccount, getAccountList
c) Proper design of Exception class 5
d) Proper comments, coding conventions , indentation & 5
implementation of OOP concepts

Q. 1 – Section B [ Marks: 10 ]

Create another Python file in which following functionality needs to be implemented


by importing the above module (Q-1 A)

 Read all customer details from the user


 Ask user how many Accounts for that customer
 Take Input for all accounts
 Add all accounts to List for that customer
 Iterate list to read and store the details into the DB table
 Display all account details for the customer on the console
 Ask user to enter account number and new balance and
update that balance. Update the python list and database
table again.
 Again display all account details for the customer
 Handle all the exceptions properly

Q1- Steps Marks


B
a) Reading the data 10
b) Adding all Accounts to list and table properly 20
c) Display all the Account details 10
d) Updating the balance properly 20
e) Handling Exceptions properly in main method 5
f) Proper comments, coding conventions , indentation & 5
implementation of OOP concepts

Вам также может понравиться