Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Murachs java 6th edition.. please break down or highlight what belongs where. just needing a better visual understanding. Exercise 4-2 Modify the Invoice application In

Murachs java 6th edition.. please break down or highlight what belongs where. just needing a better visual understanding. image text in transcribed
image text in transcribed
Exercise 4-2 Modify the Invoice application In this evercise you'll modify the vwith statemear and the nosied itlelse statements that are used to dectermine the dinoeent persent for the linoige applisation in freure 4-5. Then, you"ll replace the naith itatement with another iflelse. satement. 1. Open the perject named cha4 ent. Jnvice that's stored in the ex starts direce tory. Then, nun the application to see bow it works. 2. Change the code so cuitomen of gye ' r " or "R" with a rabtotal that's 3500 of more get a 30% discount and those with a mutental that's $250 of more but less than $500get a 25% discount. Then, irse the applicatioe to make rure this works correctly. 3. Change the code no custonsen of type "c" or "C" always get a 20% diroount. Then, test the application to make sure dhis works correctly. 4. Add another customer of type "' oe "T. Then, add code so customers of this type get a 40% discount for subboeals of less than $400 and a 50% discount for subtotals of $500 or more. Then, teat the applicatioe 5. Replace the switch expression with an iffelse statement, making sure the user caa enter the customer type in either opper or lower case. Then, teit the application to make sure it still works cocrectly. Exercise 4-3 Modify the Guess the Number application In this exercise, you'll modify the while loop in the Guess the Number application so it doesi't use the break or continoe statements: Open and run the project 1. Open the project named chO4_er3_GuessNumber thar's stored in the ex_starts foldec. Then, run the application to see how it works. Remove the break statement 2. Modify the while loop so its Boolean expression checks that the guess and number variables aren't equal. To do that, you need to declare the guess: variable outside the loop. 3. Move the statement that notifies the user of the comect guess so it executes after the while loop is finished. 4. Delete the else clause of the iffelse statement. 5. Move the code that increments the counter variable so it's oaly executed if the guess is too high or too low, not if the guess is the correct number. 6. Run the application and test it to make sure it still works correctly. Remese the cantinue stafernent. 7. Combine de if itatement that nimitins the aser of an imvalid guess and the if clse statement that satifies the user of poeses that are noo tow or too high inte a single ifelse statement. Ther, delete the cookinec stateinent. 8. Fuin the application and test it to make sure it still worlar correctly. Exercise 4-4 Enhance the Future Value application In thit exercise, yeu'll modify the Faniet Valae ipplication wo it displays a table of funine values baved on the data enternd by the aser 1. Open the project naned ch04_ex4_FutureValue that's in the ex_starts folder. 2. Remowe all the code inside the while logp, except for the code that gets the monthly imvestinent amount and the number of years from the user and the code that asks if the user wants to costinue. 3. Within the waile loop, add staternents that create NumberF Format objects that can be used to format the interest rates and funire values as shown above. 4. Within the while loop, add a for loop that displays the interent rates from 5.0% to 6.5% at 5% incremeats. To aliga the columns for the rates, you can use the printfo) method. 5. Within the while loop, add nested for loops that calculate and display the future valee for the investment amount at each interest nate and for the number of years entered by the user. Again, yoe can use the printfo method to align the columas. 6. Rith the application and test it to make sure it works correctly, even for: slightly larger values for the monthly investment and the number of years

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions