Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write In Java program Write a Wings and WingsRUs class. The Wings instance variables should be the name, a Boolean field for whether the wings

Write In Java program

Write a Wings and WingsRUs class. The Wings instance variables should be the name, a Boolean field for whether the wings have bones or not, the cost for each wing and the number purchased. You decide appropriate variable names and data types. Write a no-argument and full constructor, a toString() method, and your getters and setters, in that order. Write a method named totalCost() after your toString() method that calculates and returns the cost for the wings. It should take no parameters and return a double. Give the customer a 10 percent discount if they buy over a dozen wings.

In the Driver, create two instances of the Wings class. With the first one, call the full constructor (you can use whatever values you like just hard code them in). For the second one, use the no-argument constructor followed by the setters to set the field values. These values need to come from keyboard input from the user. Call the toString() method to print each out. Next, call just the totalCost() method so it print out the cost for the order. Make certain it is formatted like money. SEE SAMPLE OUTPUT BELOW image text in transcribed

WingsRUs What kind of sauce? BBQ Are there bones (please answer true or false) false How much does each cost? .60 How many can you eat? 14 Your orders: You bought 6 Hot wings which cost $1.25 each Bon es: true You bought 14 BBQ wings which cost $0.60 each Bones: false The costs of the orders were: First $7.50 Second $7.56

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

=+How much do they already know about the subject?

Answered: 1 week ago

Question

=+How many people do you need to reach?

Answered: 1 week ago