Skip to main content

Posts

Showing posts from January, 2022

30 January 2022 CPA, prime management JAVA solution.

Question: Create the class PrimeManagement with the below attributes: primeId-int  userProfileName-String subscriptionType-String subscriptionPrice-double noOfProfiles-int The above attributes should be private,write getter and setter and  parameterized constructor as required. Create class MyClass with main method. Implement a static method-findAvgPriceByType in MyClass class. findAvgPriceByType method:     This method will take two input parameters-array of PrimeManagement  objects and String parameter.This method will return average Subscription  price (as int value) from array of PrimeManagement objects for given  subscription type(String parameter passed) and whose noOfProfiles is greater than 3.       If no PrimeManagement with above condition is present in array of  PrimeManagement objects,then the method should return 0.      The main method should print the returned average subscription price  of PrimeManagement as it is ,if the returned value is greater than 0,or it  should p