Question
Urgent!!! Please use java thank you in advance SHOW ALL CODE FOR THE PROGRAM!!!! Create a program that computes annual sales revenue to-date to determine
Urgent!!! Please use java thank you in advance SHOW ALL CODE FOR THE PROGRAM!!!! Create a program that computes annual sales revenue to-date to determine the status of the companys sales revenue and whether a year-end bonus is in store for the employees. Sales revenue is captured by month within a quarter; therefore, the user can enter as many quarters as needed as long as the quarters are not less than 1 or greater than 4. If sales revenue is on target by 50% or more for a sales rep, an encouraging message is sent; otherwise, a warning is sent. If sales revenue to date for the company is greater than or equal to 100% of projected annual sales, then employees qualify for a 2-5% year-end bonus; otherwise, no year-end bonus can be expected. Use printf() with format specifiers where needed. 1st Prompt: What is the projected annual sales for Tandem? 2nd Prompt: How many sales reps work for Tandem? 3rd Prompt: Enter the name of a sales rep: OR Enter the name of the next sales rep: Use this ternary in a printf() to determine which prompt is used by inserting the words to put in %s based on the value in salesRepCtr. "%nEnter the name of %s sales rep: " , salesRepCtr == 1 ? "a" : "the next" 4th Prompt: Enter the number of quarters worked (no less than 1 or greater than 4): 5th Prompt: 1. First Quarter 2. Second Quarter 3. Third Quarter 4. Fourth Quarter Choose the quarter in which sales were earned: OR Choose the next quarter in which sales were earned: Insert this code as the last concatenated line in the printf() for Prompt 5. The argument is a ternary that decides to put next or nothing in the %s. Note there is a space after the word next in the String literal. There is no space inbetween the double quotes. "%n%nChoose the %squarter in which sales were earned: " , qtrCounter > 1 ? "next " : "" Right after the printf(), code the following ternary to setup for Prompt 6. The ternary is a shortened if-else-if. quarter = (qtrChoice == 1) ? "First Quarter" : (qtrChoice == 2) ? "Second Quarter" : (qtrChoice == 3) ? "Third Quarter" : "Fourth Quarter" ; 6th Prompt: Enter the sales revenue for the Xxx month of the Xxxxxx Xxxxxxx: where Xxx holds 1st, 2nd, or 3rd and Xx Xxxxxx holds First Quarter, Second Quarter, Third Quarter, Fourth Quarter.
| Output |
1 |
TANDEM ENTERPRISES SALES REVENUE FOR , noOfQtrs, QUARTER(S) OF , dateTime (Year Only) SALES REP: , salesRep
Total Year-To-Date: $, quarterlySales
Get the output pseudocode from PA1 Final Output Specs for Plan file. Use Appendix 1 to find the format specifier for just the year |
2 |
Keep up the GOOD work, first name of salesRep, , There is a possible year-end bonus!
Actual code given in PA instructions. |
3 |
So far sales are lagging behind projections,
|
4 |
CORPORATE SALES PERFORMANCE |
5 |
Its been a GOOD year so far. There could be a year-end bonus of about 2-5% if we can keep on top of our sales goals. Thank you all and please continue your excellent effort! |
6 |
Sales are lagging projections. A year-end bonus may not be possible. |
Prompt 1
Prompt 2
Do
Assign 1 to qtrCounter
Reinitialize quarterlySales to default value
Post-increment salesRepCtr
Prompt 3
Prompt 4
while qtrCounter <= noOfQtrs
Assign 1 to monthCounter
Prompt 5 Assign First Quarter through Fourth Quarter to quarter using a ternary operation (actual code given in PA instructions)
while monthCounter <= noOfMonths
if monthCounter =1
monthNo = 1st
else if monthCounter = 2
monthNo = 2nd
else in monthCounter = 3
monthNo = 3rd
endIfElseIf
Prompt 6
quarterlySales = quarterlySales + salesRevenue (use combined assignment per instructions meaning +=.)
Pre-increment monthCounter
endWhile monthCounter <= noOfMonths
annualSales = annualSales + quarterlySales (use combined assignment per instructions meaning +=.)
Pre-increment qtrCounter
endWhile qtrCounter <= noOfQtrs
Print 1
percofTargetRep = quarterlySales / (projectedSales/noSalesReps) * 100
if noOfQtrs < 4
if percOfTargetRep >=50
Print 2
else
Print 3
endIF
while salesRepCtr < noSalesReps //end of do-while
percOfTargetCo = (annualSales/projectedSales) * 100
Print 4
if percOfTargetCo >= 100
Print 5
else
Print 6
endIf
Stop
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