Question: I am having difficulty writing code for problem P8.6 in the book Big Java 6th edition by Cay Hortsman. I will submit the image of
I am having difficulty writing code for problem P8.6 in the book Big Java 6th edition by Cay Hortsman. I will submit the image of the problem, page 417-418.
.

418 Chapter 8 Designing Classes make the suma multiple of 10. For example, the sum of the digits in the ZIP code 95014 is 19, so the check digit is 1 to make the sum equal to 20 Each digit of the ZIP code, and the check digit, is encoded according to the table at right, where O denotes a half bar and 1afullDigit bar. Note that they represent all combinations of two full and three half bars. The digit can be computed easily from the bar code using the column weights 7,4, 2, 1,0. For example, 01100 is Weight 0x7+1x4+1x2+0x1+0x0=6 on is 0, which would yield 1101 o The only ex according to the weight formula. Write a program that asks the user for a ZIP code and prints the bar code. Use : for half bars, | for full bars. For example, 95014 becomes (Alternatively, write a graphical application that draws real bars.) hould also be able to carry out the opposite conversion: Translate Your programs bars into their ZIP code the digits. e, reporting any errors in the input format or a mismatch of Business P8.7 Implement a program that prints paychecks for a group of student assistants. Deduct l and Social Security taxes. (You may want to use the tax computation used in federa Chapter 5. Find out about Social Security taxes on the Internet.) Your program should prompt for the names, hourly wages, and hours worked of each student. Business P8.8 Design a Customer class to handle a customer loyalty marketing campaign. After accumulating $100 in purchases, the customer receives a $10 discount on the next purchase. Provide methods void makePurchase (double amount) hoolean discountReachedO Provide a test program and test a scenario in which a customer has earned a discount and then made over $90, but less than $100 in purchases. This should not result ina second discount. Then add another purchase that results in the second discount. Business P8.9 The Downtown Marketing Association wants to promote downtown shopping with a loyalty program similar to the one in Exercise P8.8 Shops are identified by a number between 1 and 20. Add a new parameter variable to the makePurchase method that indicates the shop. The discount is awarded if a customer makes purchases in at least three different shops, spending a total of $100 or more
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
