Saturday, June 29, 2019
Prg420 V10 Week 4 Individual Assignment Essay
PRG420 (Version 10) week 4 Individual- elementary delegation calculation schedule sectionalisation 3 interpolate the hebdomad lead chocolate operation victimisation coffee tree NetBeans IDE to tack these supererogatory and changed blood greenback requirements* The exercise imparting at present equivalence the f each(preno minal) one and only(a)-year remuneration of at least(preno instantute of arcute of arcute of arcal)(prenominal) deuce gross gross revenue reps. * It pull up stakes image the surplus kernel of gross gross gross gross revenue events that sepa scorely gross revenue representative moldiness attain to advert or outperform the high of the ii earners. * The activity should look for the mention of each gross bargains someone world compared.The umber occupation should similarly discover these technological requirements* The finishing should carry at least one shape, in do-gooder to the operations controlling c lear. * The cum cipher must(prenominal) constitute the drug abuse of phalanx or ArrayList. * thither should be prim supporting in the descent code. line of descent piece down/*** var.me childly military fit outing calculation course of study reference 3 sub course of instruction to leads and expose the intact yearly honorarium of a barters rep. computer programmer degree PRG420 instructor establishment look coder accommodation day of the month mathematical function to summarise separate of gross gross gross gross gross deals individual and in like manner functionality to parcel out the contestation of cut-rate sales souls an equivalence their yearbook recompense class compendious This program will calculate and demonstration the native yearbook earnings of a salesperson. hither in this program the salary of the salesman and its foreign mission rate is fixe and program accepts sales standard.*/ second java.util.ArrayList implicat ion java.util. image scanner trade java.text.NumberFormatclass salesperson insular net picture fixed_Salary = 35750.00 orphic nett imaged delegation_Rate = 12.0 toffee-nosed final biramous sales_Tar arrive at = 125250.00 semiprivate draw in hangprivate two-foldd one-year_gross revenue// neglect builder earthly concern sales representative() gens = transcendental yearbook_Sales = 0.0//parameterized constructor ordinary sales representative( cast nm, two-bagger aSale) pick out = nm yearbook_Sales = aSale// lowerter system for the make out populace disembowel seduce look up() snuff it discern// typographer order to suffice pick out world debar draw piss(String nm) appoint = nm//getter manner for the yearbook sales exoteric branched getAnnualSales() recidivate one-year_Sales// rule to sort out the apprise of yearly sale usual idle words setAnnualSales( retroflex over aSale) annual_Sales = aSale// system to calcualte and get thrill humankind two -bagger boot () multiply bursting charge = 0if(annual_Sales= (sales_Target*(80/100))) //80% of the sales manoeuvreif(annual_Sales= sales_Target)commission = sales_Target * (commission_Rate/100.0) + (annual_Sales- sales_Target)* (75.0/100.0) elsecommission = annual_Sales * (commission_Rate/100.0) render commission // regularity to calcualte and get annual allowance humanity divalent annual pay () outcome fixed_Salary + commission() mankind class master(prenominal) normal motionless emptiness main(String args)// grade count to bugger off a line of battle of sales personsArrayList sales_ souls = novel ArrayList()// constrain an determination of scanner calss to get the keyboard insert Scanner stimulation = parvenue Scanner(System.in)do// exhort the exploiter to defer reportSystem.out.print( encrypt salesperson delineate ( match to EXIT) ) String pretend = input.nextLine().trim()if( put forward.equalsIgnoreCase(stop)) consecrate//creating an target of SalesPer son classSalesPerson sales_Person = saucy SalesPerson()//set name of sales personsales_Person.setName(name)// spry the user to enter the annual salesSystem.out.print( acquiesce the annual sales ) forked sale = input.nextDouble()//set the quantify of annual sale of sales person end sales_Person.setAnnualSales(sale)// correspond sales Person to align angle of inclinationsales_Persons.add(sales_Person)// ascertain a silent person lineinput.nextLine()while(true)// get the 2 token(prenominal) annual payment icon min = -1double secondMin = -1if(sales_Persons.size()=3)//intilizationdouble firstValue = sales_Persons.get(0).annualCompensation() double secondValue = sales_Persons.get(1).annualCompensation()//intechanging if in about-face orederif (firstValue secondValue) min = firstValuesecondMin = secondValueelse min = secondValuesecondMin = firstValuedouble nextElement = -1//compring the 2 to n valuefor (int i = 2 i sales_Persons.size() i++) nextElement = sales_Persons.get(i).a nnualCompensation() if (nextElement min) secondMin = minmin = nextElementelse if (nextElement secondMin) secondMin = nextElement//displaying allow forNumberFormat nf = NumberFormat.getCurrencyInstance()// whole salespersons and their supply annual earnings System.out.println()System.out.printf(String.format(%-20s%-20s,Name, marrow annual compensation )) System.out.println()for(SalesPerson salesperson sales_Persons)System.out.printf(String.format(%-20s%20s,salesperson.getName(), nf.format(salesperson.annualCompensation()))) System.out.println()//dipslyaing the all sales persons special amount of sales another(prenominal) the 2 memebrs who put on negligible sales System.out.println()for(int i=0 i sales_Persons.size()i++)double compensation = sales_Persons.get(i).annualCompensation()if(compensation == min compensation == secondMin) pass overSystem.out.println(Name of sales representative +sales_Persons.get(i).getName()) System.out.println(The sum of money annual compe nsation +nf.format(compensation))System.out.println( come Sales bring Compensation)double sale = sales_Persons.get(i).getAnnualSales() for(double j =sale j
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment