Create a class whose main method creates three arrays

Assignment Help Data Structure & Algorithms
Reference no: EM131270490

Create a class whose main method creates three arrays. The first array will contain five kinds of flowers - petunia, pansy, rose, violet, and carnation. The second array will contain the cost of each flower, respectively, 50 cents, 75 cents, $1.50, 50 cents, and 80 cents per flower. The third array will contain the number of flowers in stock of 5, 0, 10, 3 and 15. The main() method will call the readInput() method which will request that the user enter the desired flower. If the flower is not within the first array and message will appear and the program will end. If the flower is in a array, the user will be prompted to enter the number of flowers. If the user enters a number less than one, they will be requested to reenter the number of flowers until they enter a number greater than zero.

After all requirements are met for the input, the readInput() method will call the checkStock() method. This method will check to see if the number of flowers entered was in stock. A message will display if there are enough in stock.

Once the sale is complete the type of flower, number of flowers, and the total cost will display.

Reference no: EM131270490

Questions Cloud

Describe the process of ecological succession : Discuss at least three solutions that would move our society towards more environmentally sustainable economies or "eco-economies" . Include your opinion of how at least one of these solutions could be applied locally.
Effectively evaluate the leading edge program : A Healthy Investment at Sisters of Charity Providence Hospital What outcomes should the hospital collect to determine how well their Leading Edge training program worked? What level(s) of evaluation should be used? From a practical perspective, how e..
Establishing a pricing strategy : Pricing is one part of the value equation in developing a marketing program. Discuss the methods available to marketers for establishing a pricing strategy. Analyze why each would be selected. Use at least one resource (cited in APA format) to sup..
Complete a truth table for the gate : A three-input AND-OR (AO) gate shown in Figure 1.42 produces a TRUE output if both A and B are TRUE, or if C is TRUE. Complete a truth table for the gate.
Create a class whose main method creates three arrays : Create a class whose main method creates three arrays. The first array will contain five kinds of flowers - petunia, pansy, rose, violet, and carnation.
Large scale bakery is laying out new production process : A large scale bakery is laying out a new production process for its packaged bread, which it sells to several grocery chains. it takes 12 minutes to bake the bread. how large of an oven is required so that the company is able to produce 4200 units of..
Real interest rate if people instead are risk averse : What net real interest rate will be charged to the borrower if people are risk neutral? What is the corresponding (net) nominal rate?What can you say about the level of the real interest rate if people instead are risk averse?
What ways have you kissed the earth with your feet lately : Which made me think of all of you and the journey we are on together to learn to preserve our beautiful planet. It also inspired me to share my favorite quote with you: "Walk as if you are kissing the earth with your feet" - Thich Nhat Hanh, Vietn..
Write java application that calculates the minimum for quiz : Write a Java application that calculates the minimum, maximum, and average for each quiz. Print the output results in a table format using a text area. Use loop and if statement control structures as well as Array data structure.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write a program to take n elements and insert them into heap

Write a program to take n elements and insert them into a heap one by one. Include a function to print out the elements in the heap.

  Utilize the flow chart to make an ethical decision

You are presented with three case studies. It is your job to utilize the flow chart to make an ethical decision for each of the three scenarios

  Prints the sorted array to the console.

check all the values between position i and size-1 to find the smallest one

  What is the relationship of object model to data structure

What are the reasons for object orientation? What is the relationship of the object model to the data structure

  Design greedy algorithm to solve activity selection problem

Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ... an that wish to use a lecture hall. Each activity ai has a start time siand a finish time fi.

  Create a running shellsort on the input

Create a "Shellsort" I need to create a running Shellsort on the input 9,8,7,6,5,4,3,2,1 using increments 1,3,7.

  Explain solution to recurrence-appealing to recursion tree

Solve the following recurrence relations by the method of your choiceT(n) = 1 for n = 4 and T(n) =pnT(pn) + n for n > 4. Argue that the solution to the recurrence T(n) = T(n=3) + T(2n=3) + cn is (n lg n) by appealing to the recursion tree.

  Recognize how many playing cards you have

Create a flowchart that programs a robot to recognize how many playing cards you have and to put them in order from smallest to largest.

  How many leaf nodes can a decision tree have

At most how many leaf nodes can a decision tree have if it is consistent with a training set containing 100 examples?

  How to draw a five inch square

How to draw a five inch square on the screen using * symbo

  Create b-tree function is replaced by an open file function

In this version of the ADT, the create B-tree function is replaced by an open file function. The compare function must be defined when the file is opened.

  Write a procedure to produce the alternative description

Write a procedure to produce the alternative description of the moves based on the observations If we can move a tower of k rings in either direction we can certainly move a tower of k +1rings.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd