50% found this document useful (2 votes)
5K views7 pages

FA1 Hands

The document provides instructions for a hands-on assessment involving programming questions. It outlines guidelines for submitting code, such as not modifying the default folder structure or adding unauthorized methods. It also notes errors that could result in score reductions, such as infinite loops or improper class diagrams. Candidates are instructed to follow the provided class diagram and method signatures strictly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
5K views7 pages

FA1 Hands

The document provides instructions for a hands-on assessment involving programming questions. It outlines guidelines for submitting code, such as not modifying the default folder structure or adding unauthorized methods. It also notes errors that could result in score reductions, such as infinite loops or improper class diagrams. Candidates are instructed to follow the provided class diagram and method signatures strictly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

FA1 Hands-On

Duration: 120 minutes


Max Marks: 15
 

 
Instructions to candidates:
1. Follow the class diagram strictly. Read the problem statement, examples and the other details
provided carefully and implement the solution
2. Code submitted with compilation errors may not get evaluated
3. DO NOT add any new method apart from the one given in the file where you write the solution
4. DO NOT alter the method name or the argument list of the method that is provided to you
5. DO NOT write codes that result in infinite loops/infinite recursive calls, because it just won’t
work!
6. The test cases provided are a subset of test cases that will be used to test your code
 
Guidelines:
1. You (Trainee) should not tamper/modify the default folder structure in eclipse. Any changes
done to default folder structure in eclipse will result in solution scripts not being evaluated.
2. You (Trainee) should take frequent backup of your solutions.
3. In case of system restart use the back up and retrieve features on the hands-on client to persist
your code.
4. There is no “Auto Submission” feature and hence you (Trainee) must submit the scripts
mandatorily before the closing time of the exam.
5. The verify option checks the code for structural and logical correctness as per the requirements
given in the problem statement. Please ensure that your code is structurally and logically correct
according to the given problem statement before submitting.
6. Submission must be done only once, after completing all the solutions in Eclipse. Submission on
hands on client will be considered as the end of assessment. You will not be allowed to change code
once submitted.
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
        

Question1: Programming Fundamentals:                                                                                               [5 Marks]

Problem Statement:

Description: Flip Jewellery store sells variety of jewels to its customers. 

Write a Java program to calculate the billAmount(double) for customers based on the array of available
jewels availJewelArr(String []), array of price of the jewels availPriceArr(int []), array of purchased
jewels purchasedJewelsArr(String []) and array of quantity purchased purchasedQuantityArr(int []).

For each jewel  of the purchasedJewelsArr,

 Check if the jewel  is present as one of the jewels of availJewelArr. If present,


o Identify the corresponding perGramAmount(int)  using availPriceArr
o Calculate the totalPrice by multiplying the above identified perGramAmount  and the
corresponding quantity(int)  from purchasedQuantityArr

Note: purchasedJewelsArr and purchasedQuantityArr have one to one correspondence

o Set the billAmount  by adding the above obtained totalPrice  of all the jewels


o If the billAmount is greater than 20000.0 Rs, then apply 3% discount on the billAmount
 Otherwise, if any of the jewels is not present, then set the billAmount to -1.0
 Return the billAmount

Assumptions:

 Each quantity(integer) in the purchasedQuantityArr would be always greater than 0


 purchasedJewelsArr and purchasedQuantityArr would have at least one element each
 availJewelArr and availPriceArr have one to one correspondence
 purchasedJewelsArr would contain unique jewel
 perGramAmount in availPriceArr is on per gram basis
 quantity in purchasedQuantityArr would be in terms of grams

Note: 

 Perform case-sensitive comparison
 No need to validate assumptions

Example:

availJewelArr: {"Bentex", "Silver", "Gold", "Platinum"}

availPriceArr: {20, 50, 2600, 3000}


purchasedJewelsArr: {"Silver", "Gold", "Platinum"}

purchasedQuantityArr: {20, 7, 3}

billAmount: 27354.0

Example Explanation:

 Consider the first jewel  of the purchasedJewelsArr is "Silver" and it is present as one of the


jewels in availJewelArr and the corresponding perGramAmount from availPriceArr is 50 Rs. The
corresponding quantity  from purchasedQuantityArr is 20 grams and hence the totalPrice  for "Silver"
would be 1000 Rs. 
 Similarly, "Gold" & "Platinum" are present as one of the jewels in availJewelArr and the
corresponding perGramAmount from availPriceArr are 2600 Rs and 3000 Rs respectively. The
corresponding quantity  from purchasedQuantityArr are 7 grams and 3 grams respectively, and hence
the totalPrice  for “Gold” would be 18200 Rs and for “Platinum” the totalPrice  would be 9000 Rs.
 By adding the above obtained totalPrice  of the jewels "Silver", "Gold" and "Platinum",
the billAmount  would be 28200.0 Rs which is greater than 20000.0 Rs
 By applying 3% discount on the above billAmount, the updated billAmount  would be 27354.0 Rs

Sample Input and Output:

Question 2: Object Oriented Programming:                             [10


Marks]                                                                                                                 
Problem Statement:

Description:

Advertise is an advertising movie shooting agency. It is popularly known for producing the creative
advertisement movies. The automation of quotation generation system is depicted in the class diagram
given below.

 Implement the class diagram below to achieve the same.

Class Diagram:

Notes:

 Do not include any extra instance/static variables and instance/static methods in the given
classes
 Case insensitive 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:

modelRemuneration:

 This is a static array containing the following values-

Note: modelRemuneration is initialized and provided. Hence no need to define

Constructor:

 This method initializes modelId, modelGrade and remunerationPerDay


 Extract the first digit of modelId and set that digit as modelGrade

For Example: if the modelId is 43216 then the first digit, i.e. 4 would be assigned as the modelGrade 

Assumption: modelId is a 5digit positive nonzero integer number, not more than 59999  

Note: No need to validate assumption

validateRemunerationPerDay() :

 This method validates the remunerationPerDay(double)


 Identify the minimumLimit and maximumLimit to
validate remunerationPerDay using modelRemuneration array and modelGrade
 In modelRemuneration array, considering modelGrade as position
of maximumLimit of remunerationPerDay, and the minimumLimit is the value available in the
previous position of the same array.

For example: When the modelGrade is 2, maximumLimit is 45000.0 (the value at index 2


in modelRemuneration array) and minimumLimit is 30000.0 (the value at index 1
in modelRemuneration array)
 If the value of remunerationPerDay is more than the minimumLimit and less than or equal
to maximumLimit, then return true
 Otherwise return false

 Example: If the modelId is 12345, modelRemuneration is {25000.0, 30000.0, 45000.0, 57500.0,


100000.0, 150000.0} and remunerationPerDay is 28000.0, then this method would return true

AdMovies class:

validateNoOfDaysOfShooting() :

 This method validates noOfDaysOfShooting(double)


 If the value of noOfDaysOfShooting is between 2.0 to 100.0 (inclusive of boundary values)
return true
 Otherwise return false

 For Example: If noOfDaysOfShooting is 10.0 days, this method would return true

validateTypeOfAdMovie():

 This method validates typeOfAdMovie (char)


 If the value of typeOfAdMovie is either ‘H’ or ‘A’ or ‘L’, return true
 Otherwise return false

Note: Perform case-sensitive comparison

For Example: If typeOfAdMovie is ‘H’, this method would return true

calculateQuotationAmount():

 This method calculates and returns the quotationAmount as per the logic given below
 Invoke validateTypeOfAdMovie(), validateNoOfDaysOfShooting() and validateRemunerationP
erDay()
Note:  validateRemunerationPerDay() needs to be called from Model class
 If all the above methods return true,
o Identify budget(int) and serviceCharge(double) in percentage based
on typeOfAdMovie as provided in the below table:

o Identify tax(double) based on customerType as provided in the below table:


Note: Perform case insensitive comparison
o Calculate actualNumberofShootingDays(long) as mentioned below:
 If noOfDaysOfShooting has a fractional part set the value
of actualNumberofShootingDays to lower integral part

Example: if noOfDaysOfShooting is 10.50 then actualNumberofShootingDays would be


10.0

Note: You may use Math.ceil(), Math.floor() and Math.round() methods


of java.lang.Math package to implement the mathematical functions

o Calculate  totalBudget(double) using the below logic,


totalBudget = budget  + remunerationPerDay * actualNumberofShootingDays

Where remunerationPerDay is retrieved from the Model class

o Calculate  serviceCharge and taxAmount on totalBudget using the


identified serviceCharge percentage, and tax  percentage.
o Add them to totalBudget
o Invoke the calculateQuotationAmount() method of AdAgencyService to get
the baseQuotationAmount
o Add this baseQuotationAmount to totalBudget
o Set the quotationAmount  with the value of totalBudget
o Return quotationAmount                    
 Otherwise, return -1L.

 For Example: If customerType is "public", typeOfAdMovie is ‘H’ noOfDaysOfShooting is


10.0, remunerationPerDay is 35000.0 and modelId is 23534 then, quotationAmount would
be 4019000 L

You might also like