Question: Programming Assignment: OfferDecision Problem Statement: This assignment will acquaint you with the use of parameter passing, return values, if / else blocks, and user input.

Programming Assignment: OfferDecision
Problem Statement:
This assignment will acquaint you with the use of parameter passing, return values, if/else blocks, and user input. You will create a program that helps Maya decide whether to accept one of the two offers she has received based on her preferences. Specifically, your program prompts for the information regarding two job offers, then checks to see if any of the offers is acceptable and returns the final decision on which offer is accepted, if any. Maya's preferences can be summarized as follows:
Maya is looking for her dream job but has some preferences. She hates Massachusetts and so demands at least $100,000 per year to work there. She likes Washington state, so she would take a job there if it paid $65,000 or more per year. But she really loves California, so she would take a job there if it paid more than $50,000 per year. At any other place, she will work for at least $75,000 per year. Given
these preferences, she wants to first check whether each of the two offers is acceptable and then pick the
one with the higher salary. If both are acceptable and they both offer the exact same salary, she will take
up the first offer.hand, if not acceptable, it returns the value of the class constant REJECTED_SALARY (which is
initialized to be a negative number).
(6 points) compareAndPrintDecision method accepts 6 arguments - company, state code, and
salary for both the offers. It calls the acceptableSalary method twice passing the information for
each offer. It analyzes the returned values and makes the final decision according to Maya's
preference above and prints the final decision. See the sample runs below.
(5 points)- Include appropriate program documentation and formatting including: Your first and
last name, the date of submission, code comments necessary to explain the operation of your
program, and proper indentation of the code, etc.
Tips:
For each of the methods, think about the following: What is the return type, what parameter(s)
will it need to perform the task, and accordingly decide the method signature for each.
To be able to use a single Scanner object effectively you will have to pass it to all the methods
that prompt the user for input.
You can simplify the logic of your if/else statements by using the logical operators & & and II
given on page 258 of the textbook.
Sample runs: Text in orange is what user has entered as input.
Sample run 1: both the offers are acceptable, the first one has a higher salary, the first one accepted.
jGRASP exec: java offerDecision
Congratulations, Maya! You got two job offers!
Enter information about the first offer
Please enter the company name: Microsoft
Please enter the 2-letter state code: WA
Please enter the yearly salary: 80000
Enter information about the second offer
Please enter the company name: Google
Please enter the 2-letter state code: CA
Please enter the yearly salary: 77000
Hurray! The first offer accepted.
Joining Microsoft in WA.
----jGRASP: operation complete.
Sample run 2: neither of the offers are acceptable, none of them is accepted.
[----jGRASP exec: java OfferDecision
Congratulations, Maya! You got two job offers!
Enter information about the first offer
Please enter the company name: Microsoft
Please enter the 2-letter state code: FL
Please enter the yearly salary: 70000
Enter information about the second offer
Please enter the company name: DishaTech|[ Please enter the 2-letter state code: MA],[ Please enter the yearly salary: 88000],[No offer accepted :-( Job hunt continues. ],[---- GGRASP: operation complete. ]
Sample run 3: only one of the offers is acceptable, it is accepted.
Sample run 4: both offers are acceptable and have equal salary. The first one is accepted.
[ Congratulations, Maya! You got two job offers!
Enter information about the first offer
Please enter the company name: Houston_Electric
Please enter the 2-letter state code: TX
Please enter the yearly salary: 77000
Enter information about the second offer
Please enter the company name: SanJose_Electric
Please enter the 2-letter state code: CA
Please enter the yearly salary: 77000
Hurray! The first offer accepted.
Joining Houston_Electric in TX.
----jGRASP: operation complete.
 Programming Assignment: OfferDecision Problem Statement: This assignment will acquaint you with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!