Answered step by step
Verified Expert Solution
Link Copied!

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

image

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

=+1. What are the six main classifications of business products?

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic teleology.

Answered: 1 week ago

Question

Calculate the percentage change in utilization for the two months.

Answered: 1 week ago