Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q5) Write a Java program in BlueJ to perform the following: [2 Marks] a) Create a class shop with fields item1, item2, item3, billamount and

Q5) Write a Java program in BlueJ to perform the following: [2 Marks]

a) Create a class shop with fields item1, item2, item3, billamount and discount. Initialize discount= 5

b) Declare a method bill, to find the totalbill of items using the formula: (billamount * discount) /100.

c) Declare a parameterized constructor for the above class and set the billamount.

d) Declare one more parameterized constructor for the above class and set the discount to 6 using this keyword.

e) Calculate the totalbill by calling the method bill. Show the output using the program screenshots.

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

=+3. Who is responsible for this project?

Answered: 1 week ago

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago