Question
The first version of Abbys Eggs worked but was a bit cumbersome. I.e. you couldnt edit a single parameter, you had to always re-enter all
The first version of Abbys Eggs worked but was a bit cumbersome. I.e. you couldnt edit a single parameter, you had to always re-enter all of them. This assignment is intended to address this shortcoming as well as implement the program in a more structured and maintainable manner. Part 1: Starting with the solution to Assignment 2, re-factor the program to do the following: 1. Store the parameters (number of chickens, eggs laid per day, etc.,) in static fields of the class. 2. Have separate methods for updating the parameters. 3. Use a switch statement to take menu selections for updating parameters or outputting results. 4. If the menu choice is 0, the program should terminate, invalid inputs should be ignored and any prompt repeated. 5. Before displaying updated menu, clear the screen Part 2: Using UMLet or Draw.IO, draw an Activity Diagram of the while loop. Points Distribution: Part 1-1 1-5 assessed 8 points each. Part 2 10 points Note: While not directly assessed points, the Programming Assignment General Instructions document must be followed. If not sufficiently followed, the submission will be rejected and, if not corrected, will receive a zero. If followed but poorly, submission will be deducted points based on level of adherence. Sample Output: Number of Chickens: 12 Eggs laid per hen per day: 0.50 Feed Cost Per Pound : $0.25 Feed (lb) Per Hen Per Day: 0.25 Cost Per Carton: $0.50 1. Update Flock 2. Update Eggs Per Hen 3. Update Feed Cost Per Pound 4. Update Feed Per Hen Per Day (lb) 5. Update Egg Carton Cost 6. Show Totals 0. Exit Enter Selection : 6 Total Eggs: 180.00 Total Feed Cost: $22.50 Total Carton Cost: $7.50 It costs $30.00 to produce 15 dozen eggs Operating cost per dozen: $2.00
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