Placement Questions
Placement Questions
Placement Questions
Guidelines:
1. The verify option checks the structural requirements and the logical requirements of the
problem statement given. Hence before submission, please check the code for all the
structural and logical requirements of the problem statement given
2. The evaluate option is not enabled
3. In case of system restart use the back up and retrieve features on the hands on client to
persist your code.
4. YOU WILL BE ALLOWED TO SUBMIT ONLY ONCE
5. Submission on hands on client will be considered as the end of assessment. You will not be
allowed to change code once submitted.
6. System will be restarted on successful submission
7. In case of any issue in submission, contact the invigilator for further steps. Wrong submissions
may lead to code not getting evaluated
NOTE: NOT adhering to the above instructions and guidelines may lead to reduction in your
score even if the code is executing without any errors
Few errors which might result in mark reduction:
1. Removal/modification of package statements
2. Infinite loops/infinite recursive calls in the code
3. Class diagram violation
4. Improper constructor prototype or definition
Question 1: Marks:5
Write your solution in the PF_solution1.py file in the PF package
Description:
Flip Jewellery store sells variety of jewels to its customers.
Write a Python program to calculate the bill_amount for customers based on the list of jewels
(purchased_jewels_list) and quantity purchased (purchased_quatity_in_grams_list).
Any purchase with the bill amount above 20000 is entitled for 3% discount
If any of the jewels required by the customer is not available in the store, then consider
the bill amount to be -1
Jewels available in store with the corresponding price is given below:
Example:
purchased_quatity_in_grams_list = [ 20, 7, 3]
bill_amount= 27354.0
Assumption(s):
Quantity(integer) purchased by the customer for any jewel would be always greater
than 0
purchased_jewels_list & purchased_quatity_in_grams_list would have at least one
element each
purchased_jewels_list & purchased_quatity_in_grams_list have one to one
correspondence. For Eg: Customer has purchased 20 grams [First element in
purchased_quatity_in_grams_list] of Silver [First element in purchased_jewels_list], 7
grams of Gold and 3 grams of Platinum
Number of elements in purchased_jewels_list & purchased_quatity_in_grams_list
would be same
NOTE:
Question 2: Marks:8
Write your solution in the PF_solution2.py file in the PF package
Description:
Write a Python program that takes input_string as a parameter and returns an output_dict
based on the logic given below-
input_string = 'RadeepeekaaRrm'
output_dict = {
“LETTERS” = ['e', 'a', 'R', 'd', 'p', 'k', 'r', 'm'],
“COUNT” = [4, 3, 2, 1, 1, 1, 1, 1]
}
output_list1 = ['e', 'a', 'R', 'd', 'p', 'k', 'r', 'm']
output_list2 = [4, 3, 2, 1, 1, 1, 1, 1]
Assumption:
Note:
Question 3: Marks:12
Write your solution in the OOP_solution.py file in the OOP package
Description:
Notes:
Do not include any extra instance/static variables and instance/static methods in the
given classes
Case in-sensitive comparison is required to be done unless until specified explicitly
Do not change any value or case of the given variables.
Read notes and examples for better understanding of the logic
In the derived classes, the order of passing arguments to the constructor would be the
base class variables followed by the derived class variables
Implementation Details:
Model class:
Constructor:
For Example: if the model_id is 43216 then the first digit, i.e. 4 would be assigned as the
model_grade
Assumption(s):
model_id is a 5 digit positive non zero integer number, not more than 59999
Note: No need to validate assumption(s)
validate_remuneration_per_day() :
AdMovies class:
validate_no_of_days_of_shooting() :
validate_type_of_ad_movie():
calculate_quotation_amount():
This method calculates and returns the quotation_amount as per the logic given below
Invoke validate_type_of_ad_movie(), validate_no_of_days_of_shooting() and
validate_remuneration_per_day ()
If all the above methods return true,
Identify budget and service_charge (in percentage) based on type_of_ad_movie
as provided in the below Table
Identify tax based on customer_type as provided in the below Table
Note: You may use ceil() and floor() methods of Math library to implement
ceil and floor mathematical functions
For details on methods which are implemented and provided go to Section 1.3 in the document
below
Section 1.1
Example:
purchased_quatity_in_grams_list = [ 20, 7, 3]
bill_amount= 27354.0
Example Explanation:
Consider the first item purchased by the customer i.e "Silver”. Jewel “Silver” is available
in store and the corresponding price per gram is 50 Rs. Purchased quantity is 20 grams
and hence the price for “Silver” would be 1000 Rs.
Similarly, “Gold” & “Platinum” are available and the corresponding purchased quantities
in grams are 7 & 3 respectively. Hence the price for “Gold” would be 18200 Rs and for
“Platinum” the price would be 9000 Rs
The bill amount would be 28200 Rs which is entitled to 3% discount i.e 846 and hence the
totalBill amount would be 27354.0
Example:
input_string = 'RadeepeekaaRrm'
output_dict = {
“LETTERS” = ['e', 'a', 'R', 'd', 'p', 'k', 'r', 'm'],
“COUNT” = [4, 3, 2, 1, 1, 1, 1, 1]
}
output_list1 = ['e', 'a', 'R', 'd', 'p', 'k', 'r', 'm']
output_list2 = [4, 3, 2, 1, 1, 1, 1, 1]
Example Explanation:
Identify the unique letters and the corresponding count for the letters in input_string
i.e ‘R’ is appearing 2 times, ‘a’ is appearing 3 times, ‘e’ is appearing 4 times similarly
letters ‘d’, ‘p’, ‘k’, ‘r’ and ‘m’ are appearing 1 time each
Generate output_list2 in descending order of counts
i.e output_list2 = [4, 3, 2, 1, 1, 1, 1, 1]
Corresponding to the count in output_list2 the unique letters identified would be
arranged in output_list1 accordingly
i.e output_list1 = ['e', 'a', 'R', 'd', 'p', 'k', 'r', 'm']
o Highest count is 4 and hence stored as the first element in output_list2 and its
corresponding letter ‘e’ is stored in output_list1 as the first element.
o Similarly, count 3 & 2 appear next in output_list2. Hence the corresponding
letters ‘a’ & ‘R’ are stored in second and third position respectively in
output_list1
o Count 1 is the next value in output_list2 and there are 5 unique letters
corresponding to count 1 i.e ‘d’,’p’,’k’,’r’,’m’. These letters are stored in
output_list1 based on their order of occurrence in input_string
Create the output_dict with keys “LETTERS” and “COUNT” and map the list output_list1
and output_list2 accordingly
Section 1.3:
Model class:
model_remuneration_list:
AdAgencyService class:
Constructor:
It initializes the instance variables customer_type and model.
It invokes identify_customer_type() to verify and set the value accordingly.
It would auto-generate quotation_id as discussed below.
Quotation_id would be prefixed with first three characters of customer_type in
uppercase followed by the integer value starting from 1001.
For example: The first quotation_id whose customer_type is “Government”, would be
pre-fixed with “GOV” which is the first three characters of
customer_type in upper case followed by first integral value, i.e. 1001.
Thus the quotation_id is “GOV1001”.
identify_customer_type():
calculate_quotation_amount ():
AdMovies class:
Constructor:
It initializes the instance variable no_of_days_of_shooting and type_of_ad_movie
Note: Implementation of this constructor is provided. No need to code