To investigate what we mean by planning, we want you to write a program that involves multiple tasks.
Create a class called Planning
and put your solution to the following problem in that class.
The Problem: Write a method called rainfall
that consumes a LinkedList<Double>
representing daily rainfall readings. The list may contain the number -999 indicating the end of the data of interest. Produce the average of the non-negative values in the list up to the first -999 (if it shows up). There may be negative numbers other than -999 in the list (representing faulty readings). If you cannot compute the average for whatever reason, return -1.
For example, given a list containing (1.0, -2.0, 5.0, -999.0, 8.0), the program would return 3.0 (the average of 1.0 and 5.0).
Make sure you write a set of test cases for your program.
Problem: A medical research team needs to manage information about its experiments with mice. Each mouse is assigned to a particular regimen of a food to eat, how many grams of that food to eat per meal, how many treadmill workouts to do each day, and how many minutes each workout should last. Each day, the team weighs the mice, recording the date of the experiment along with the weight (and tying each piece of data to a specific mouse).
Design a set of classes to capture this scenario, including field names and types, any class extensions or abstract classes, and any interfaces you think you might need.
zip
of the .java
files that you produced for this assignment to InstructAssist. The name of the InstructAssist project is Lab 3.