Good Tomato Soup

Description

I Have upload the file you will need and I will send the link through google drive to check on everything

Don't use plagiarized sources. Get Your Custom Assignment on
Good Tomato Soup
From as Little as $13/Page

Assignment Directions can be found here Download here.

Click here Download herefor driver file.

Click here Download herefor the python test script and here Download herefor the sample solution text file.

Make sure to include a comment header at the top of your file like the example below. If you don’t do it exactly like this, then points will be deducted in accordance with the rubric.

/* Johnny Knights
* Dr. Steinberg
* COP3503 Spring 2024
* Programming Assignment 3
*/

Rubric

Programming Assignment 3

Programming Assignment 3

Criteria Ratings Pts

This criterion is linked to a Learning OutcomeCode CompilationDid the student’s file compile successfully with no errors or warnings?

15 pts

Full Marks

Code compiled with no errors or warnings.

10 pts

Partial Marks

Code compiled, however warnings were generated.

6 pts

Low Marks

Code didn’t compile at all.

0 pts

No Marks

No code submission was received.

15 pts

This criterion is linked to a Learning OutcomeProgram RunDid the program run successfully without crashing on Eustis?

5 pts

Full Marks

Program ran successfully on Eustis and did not crash.

2.5 pts

Half Marks

Program ran on Eustis, however it crashed in the middle of the run or did not finish running within the time constraint.

0 pts

No Marks

No code submission was received or could not run at all on Eustis.

5 pts

This criterion is linked to a Learning OutcomeImplementation of the Tomatoes ClassDid the student properly the Tomatoes Class based on the assignment directions?

5 pts

Full Marks

The class was implemented properly.

2.5 pts

Half Marks

The class had some things missing that were specified in the assignment. Attributes, methods, etc…

0 pts

No Marks

No code submission was received OR the code is extremely way off from what the assignment specified.

5 pts

This criterion is linked to a Learning OutcomeminTomatoMovesDid the student properly implement the minTomatoMoves method by using a greedy technique?

20 pts

Full Marks

The method was solved perfectly and a greedy technique was applied properly.

15 pts

High Marks

The method uses a greedy technique, however there exists one error.

10 pts

Half Marks

The method uses a greedy technique, however there exists two – three errors.

5 pts

Low Marks

The method uses a greedy technique, however there exists more than three errors.

0 pts

No Marks

No code submission was received or could not run at all on Eustis. OR Greedy Technique was not applied.

20 pts

This criterion is linked to a Learning OutcomeTheoretical Running Time ConstraintDoes the program satisfy the theoretical running time constraint O(n)?

10 pts

Full Marks

Yes!

0 pts

No Marks

No.

10 pts

This criterion is linked to a Learning OutcomeTest Case 1Did Test Case 1 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 2Did Test Case 2 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 3Did Test Case 3 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 4Did Test Case 4 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 5Did Test Case 5 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 6Did Test Case 6 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 7Did Test Case 7 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeTest Case 8Did Test Case 8 produce the correct answer?

5 pts

Full Marks

Yes!

0 pts

No Marks

No!

5 pts

This criterion is linked to a Learning OutcomeCode Style and CommentsDid the student follow proper coding style techniques along with sufficient comments?

2.5 pts

Full Marks

Student used good coding style and provided sufficient number of comments.

1.25 pts

Half Marks

Student somewhat used good coding style and provided sufficient number of comments. There were error(s) detected.

0 pts

No Marks

Student did not used good coding style and provided sufficient number of comments.

2.5 pts

This criterion is linked to a Learning OutcomeCode Submission and HeaderDid the student properly named the .java file as stated in directions? Did the student provide a comment header at the top of the code file that contained (name, course, professors, assignment)?

2.5 pts

Full Marks

The student followed all directions of the naming the submission properly and providing a proper header at the top of the file.

1.25 pts

Half Marks

The student somewhat followed directions of naming the submission properly and providing a proper header at the top of the file. There was an error detected.

0 pts

No Marks

The student did not follow directions of naming the submission properly and providing a proper header at the top of the file.

2.5 pts

Total Points: 100

PreviousNext


Unformatted Attachment Preview

COP3503 Computer Science 2
Dr. Andrew Steinberg
Spring 2024
Programming Assignment 3
Good Tomato Soup
Due: 3/29/2024 at 11:59pm
Objective: Students will apply concepts of greedy algorithm design.
Assignment Description:
You are opening a restaurant that makes the BEST tomato soup. The secret of making the best
tomato soup is properly splitting up the ingredients in equal proportions. The most important
ingredient that needs to be evenly distributed are tomatoes. This tomato soup has spread
throughout the town that people are lining up just to have it. Luckily, the kitchen you design has
an enormous stove that allows you to make tomato soups simultaneously. In other words, you
have pots to work with. Now unfortunately, your staff has made a tiny, but noticeable mistake.
As they were bringing out the pots to the stove, you noticed that the tomato proportions are way
off for each set of pots. You have lots of people lined up just to try this soup. You don’t want one
pot to have more tomatoes than the other pots. That will throw off the tomato taste proportions.
You realize the only way of fixing the staff’s mistake is to properly transfer the tomatoes to
neighboring pots as quickly as possible. The challenge is you must determine the number of
minimum moves needed to transfer the tomatoes over until all pots have the same exact
number of tomatoes. In order to solve this problem, you must use a greedy algorithm
technique.
We can represent the set of pots as an array of integers where each value contains the number of
tomatoes (some can include the value 0). For example, the following figure shows an array with
three pots.
pots
0
3
0
The first and third (indexes 0 and 2) pots have 0 tomatoes while the second pot has 3 tomatoes.
Here, the minimum number of swaps needed to evenly distribute the tomatoes is 2. The
following figures show how the scenario would work out.
pots
1
2
0
Here, we moved 1 tomato from index 1 to index 0. The second move now is to move the extra
tomato from index 1 to index 2, resulting in the following array.
pots
1
1
1
Now all pots have the same number of tomato(s). Your objective is to determine the minimum
number of moves needed.
COP3503 Computer Science 2
Dr. Andrew Steinberg
Spring 2024
Here’s another example scenario to consider.
pots
5
2
1
In this scenario we have 3 pots but 8 tomatoes. In this particular example, there is not actual
solution since we cannot evenly distribute the 8 tomatoes to three pots.
For this assignment, you must follow these requirements.
1. Create your solution defined in a class called Tomatoes.
2. You will need to implement a method called minTomatoMoves. The method is nonstatic that takes a reference to an integer array (that is not dynamic) and returns an integer
value that represents the minimum number of moves. Note, the integer array is declared
in the driver file. This array represents the number of pots and each value represents the
number of tomatoes for the respective pot. You will be passing this array to the method.
This method MUST have a theoretical running time of ( ) where is number of pots.
In other words, the size of the array. This method is called in the provided driver file.
3. Constructors are not needed for this assignment. You are going to implement the greedy
method only.
4. You are welcome to create additional helper methods as you see fit. Please make sure that
the methods are implemented in your solution file and NOT the driver file (as the driver
file will be modified for grading purposes).
5. Your solution must use a Greedy Technique! If a greedy technique is not used, then no
credit will be given for the test cases and method implementation.
6. You can assume that you can hold multiple tomatoes at a time from a single pot and
move them over to another pot (which can count as a single move).
7. Each time a set of tomatoes is placed in a pot, a move is counted. Sometimes you may not
have to place all tomatoes in your hand into the pot.
A driver file (TomatoesDriver.java) has been provided for you to show you how the
methods are called along with 8 test cases to see if you get the same scenario result.
What to submit: Submit a file called Tomatoes.java to webcourses. You are not required to
submit the driver file as that will be provided for the graders to test your code. Please make sure
the driver file provided works for your code. Any name changes may cause your program not to
work when graded, which will result in a lower score on the assignment and would not be
changed.
Comment Header: Please make sure to provide the appropriate comment header (like in the
Eustis assignment) as the first thing on the top of your file. Otherwise, if your comment header is
done incorrectly including not being placed literally at the top of the file will result point
deductions in accordance with the rubric.
COP3503 Computer Science 2
Dr. Andrew Steinberg
Spring 2024
Theoretical Constraint: In this assignment your main method that will compute the solution
must run theoretically in ( ). If your solution does not follow this theoretical constraint, then a
score of 0 is applied as the grade for the assignment with no other partial credit from any
components of the rubric.
Time Constraints: For this assignment, your code solution must entirely run within 1 second on
Eustis. If your solution takes longer than 1 second, then a score of 0 will be applied to the
assignment grade with no partial credit. The test script already has timeout exception set so you
can test your code’s time constraints. As long as you follow the theoretical constraints, your code
should be able to run fast!
Important Note for running Eustis and Packages: Many of you are probably using IDEs like
Netbeans and Eclipse to build your Java Solutions. Please note that some of these IDEs will
automatically place your Java file in some sort of package. Please make sure your Java file is not
defined in some package as this can result package private errors. Any such error that occurs
during the grading will not be fixed and points will be deducted as such in accordance with the
respective categories in the rubric. Also, DO NOT create a main method in your solution file!!
This will result in your code not running properly with the driver file which will result in points
being deducted from the respective categories.
**************************************
Test Case 1 with two stoves.
Number of moves is 3
**************************************
Test Case 2 with three stoves.
Number of moves is 2
**************************************
Test Case 3 with five stoves.
Not possible to solve since distribution is uneven.
**************************************
Test Case 4 with ten stoves.
Number of moves is 5
**************************************
Test Case 5 with fifteen stoves.
Number of moves is 13
**************************************
Test Case 6 with twenty stoves.
Number of moves is 12
**************************************
Test Case 7 with fifty stoves.
Number of moves is 26
**************************************
Test Case 8 with one hundred stoves.
Number of moves is 23

Purchase answer to see full
attachment