Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MIS 306 Managerial Applications Using Object Oriented Programming 11 Assignment 1 Due Date: Monday 10th of Jan., 2020 Part 1 Create the class Flower that
MIS 306 Managerial Applications Using Object Oriented Programming 11 Assignment 1 Due Date: Monday 10th of Jan., 2020 Part 1 Create the class Flower that has the following members: Data members: a. name b. price Methods a. Add the default constructor. That set the data members to empty string, 0. c. Add the method toString which returns a string representing a Flower. d. Add a method comparePrice of the flower with another flower. Hint: this method takes an object another flower. The method returns 1 if this flower (caller) is more expensive, returns -1 if this flower is less expensive than the other flower, and returns O if their prices are equals. Part 2 Write the MainApp contains the main method) that uses the class Bucket as follows: e. Declare a list "Bouquet" which is an ArrayList of flowers. b. Ask the user to enter the flowers' details to be added to the Bouquet. Use JOptionPane input dialog for your readings. After adding a flower to the Bouquet, your program must ask the user whether more flowers to be added. Use a confirm box to get the user answer. Your program must keep adding flowers while the user wishes to add more. c. Print the Bouquet and the total price to the user using JOptionPane message
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started