Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unit 3: Programming Exercise 3-11 Need in JAVA also, I asked this question earlier but noticed it wasn't working. Here is the question updated with

Unit 3: Programming Exercise 3-11 Need in JAVA

also, I asked this question earlier but noticed it wasn't working. Here is the question updated with instructions:

image text in transcribed

image text in transcribed

image text in transcribed

This lab will focus on your ability to create non-returning and returning methods, methods that do and do not have parameters, as well as your ability to overload methods. Tasks The tasks in this lab will verify that each method works as required in the instructions. It will test the methods as a part of your program and as a standalone unit of code. It will then test your program as a whole, simulating different user inputs. If you get a task wrong, it will display an error message with details and a hint on why your code did not pass - this may include methods that are named correctly and work, but may have an incorrect function definition. For example, if a method is supposed to have a double parameter but instead your method has a int parameter, it may fail when the task attempts to use a double argument. Grading Write your code in the Code Editor. Use the Run button to compile and run your code. Click each Task checkbox to run tests against your code to calculate your grade. Once you are satisfied with your results, select the Submit button in the Tasks panel on the left navigation bar. Create a class named BookBilling that includes three overloaded computeBill () methods for the Happy Memories Company, which sells photo books. - When computeBill() receives no parameters, the method computes the price of one photo book at $14.99, adds 8 percent tax, and returns the total due. - When computeBill () receives one parameter, it represents the quantity ordered. Multiply the value by $14.99, add 8 percent tax, and return the total due. - When computeBill() receives two parameters, they represent the quantity ordered and a coupon value. Multiply the quantity by $14.99, reduce the result by the coupon value, add 8 percent tax, and then return the total due. Write a main() method that prompts the user for the number of books ordered, prompts for a coupon value, and tests all three overloaded methods. An example of the program is shown below: Enter quantity ordered > Enter coupon value 5.00 One book is $16.1892 2 books with no coupon are $32.3784 2 books with a coupon worth $5.0 are $26.9784 Tasks Create the BookBilling class. The computeBill() returns the bill for one book and no coupon. The computeBill() returns the bill for multiple > books and no coupon. The computeBill() returns the bill for multiple books and a coupon. The BookBilling program displays 3 bills to the console

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions