Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1: Code a public instance method called bonusData () that receives salespersonID, name, quarter, totalSales, and bonusRate as a percent in decimal form
Part 1: Code a public instance method called bonusData () that receives salespersonID, name, quarter, totalSales, and bonusRate as a percent in decimal form (in that order) and return a formatted String with the received data plus a calculated quarterly bonus when it is called. Use an object instance that is already declared called bonus to call the method by sending it the following arguments: "012585", "Amber Jenkins", 3, 125000, 0.015. The method call itself is an argument in a printf(). NOTE: Representation of floating point values are to be rounded to the nearest hundredth, and if the value is money then the proper symbol is to be included. 1 //Code method header. String.format("%nSales Person ID: + "%nName: + "%nQuarter: + "%n Total Sales: + "%nBonus Rate: + "%nQuarterly Bonus: " " //Enter the format specifiers after each label. //Represents rounded money. %%" %n", //Represents rounded money. //List the arguments for each format specifier of which 2 are calculations. }//END Method System.out.printf("%%s", ); //Method call argument. Part 2: Recode bonusData() as an overloaded instance method that only receives the necessary arguments to calculate a bonus amount and return that amount to the calling program. //Code method header. { //returns the calculation of the bonus amount. }//END method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started