Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates
For This or a Similar Paper Click To Order Now
A key part of this project is the use a two-dimensional array.
Because of the shortened timeframe, you are not writing this from scratch, you are taking a running programming and adding 3 “features”
Before getting into the changes, here is a description of the program.
The program uses a two-dimensional array of int to represent the number of daisies that are located in a spot. When the program starts, it will initialize the 2D array with random numbers.
There is a do-while loop that handles the interaction with the user. Inside the loop it will display the 2D array, get a command from the user, and then perform the action requested.
The “gather” is implemented. It asks the user for a row and column to indicate a spot and it reduces the value in the array by 80% to simulate the gathering of daisies.
The program keeps track of the total number of daisies gathered and when the user chooses to exit, the number of gatherings is displayed.
Three Changes
The three features are different and you could tackle them in any order. So, if one seems easier to write first, then tackle that one first.
The “M” command currently has no code. The idea here is that element with the greatest number of daisies is identified by displaying the row/col.If multiple locations have the same value, then indicating one of them is fine.
The gatheringMessage() method currently has no logic. The idea here is that a message will be returned based on the totalDaisiesGathered.
totalDaisiesGathered
Message
0
What? no daisies picked
1-499
That isn’t too many daisies
500-999
That’s an acceptable number of daisies!
1000-1999
Fantastic!
2000+
That’s getting to be too much!
The “G” command currently has no input validation and will crash if the row/col entered is out of range.Add a validation loop for row to make sure it is not = NUM_ROWSAdd a validation loop for col to make sure it is not = NUM_COLS
Note: An earlier draft of this project had ragged arrays but this project does not use ragged arrays
“M” Command (30 points)
gatheringMessage() method (30 points)
row/col validation loops (30 points)
Indenting/Programming Guidelines (10 points)
Sample Snippets
A separate document will have an entire sample run. Here is just some portions of a run to illustrate the changes.
Demo of Max and Demo of Message when 0
0123456789
——————————
0:490488278215126112233284123489
1:439419227481232137340321196340
2:3954123498588460139276458276
3:243213476498238195306321294266
4:4815941548931333828755125377
5:212149422130290173269430126269
6:15589351123272140377273388485
7:473333318110425379382355265242
8:8525824214143743211226834871
9:1536038324312762106285389
Total Daisies Gathered: 0 (What? no daisies picked) Enter Command (G,M,Q): mMost Daisies(498) in spot (3,3)
0123456789
——————————
0:490488278215126112233284123489
1:439419227481232137340321196340
2:3954123498588460139276458276
3:243213476498238195306321294266
4:4815941548931333828755125377
5:212149422130290173269430126269
6:15589351123272140377273388485
7:473333318110425379382355265242
8:8525824214143743211226834871
9:1536038324312762106285389
Total Daisies Gathered: 0 (What? no daisies picked) Enter Command (G,M,Q):
EditEdit
8: 85 258 242 141 437 432 112 268 348 719: 153 60 383 243 12 76 2 106 285 389
Total Daisies Gathered: 2,306 (That’s getting to be too much!) Enter Command (G,M,Q): gEnter row: -3 out of bounds
Enter row: 13 out of bounds
Enter row: 10 out of bounds
Enter row: 9Enter col: -1 out of bounds
Enter col: 11 out of bounds
Enter col: 10 out of bounds
Enter col: 9
Daisies at (9,9): 389, gathered 311 daisies
0 1 2 3 4 5 6 7 8 9— — — — — — — — — —0: 98 98 278 215 126 112 233 284 123 98
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.