Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i) An abstract Animal class as a parent class. Suppose that a dairy farm is located in a grassland area next to UMP Pekan. The

image text in transcribed

i) An abstract Animal class as a parent class.

Suppose that a dairy farm is located in a grassland area next to UMP Pekan. The farm has five cows and ten goats, which produce milk. Milk is sold out on daily basis with a rate of RM4.50/Liter for cow-milk, and RM12.00 for goat-milk. Milk produced by the animal is associated to the weight. For cow, the relationship between weight w (Kg) and milk production m (Liter) is given by: m=Aw+B (1) And for goat: m=C* (2) w where A, B, C and D are the coefficients (variables). The weight of cach animal is listed in Table 1 and Table 2: Table 1 Cow ID 1 2 3 4 5 Weight (kg) 500 625 718 813 995 Table 2 Goat ID 23 4 UA 6 7 8 9 10 Weight (kg) 55 65 50 30 40 70 80 90 20 30 As a programmer, you are required to help the farm owner, by writing an object-oriented program in java to compute the daily sell value (in RM) of milk. In particular, you are required to make the following: Suppose that a dairy farm is located in a grassland area next to UMP Pekan. The farm has five cows and ten goats, which produce milk. Milk is sold out on daily basis with a rate of RM4.50/Liter for cow-milk, and RM12.00 for goat-milk. Milk produced by the animal is associated to the weight. For cow, the relationship between weight w (Kg) and milk production m (Liter) is given by: m=Aw+B (1) And for goat: m=C* (2) w where A, B, C and D are the coefficients (variables). The weight of cach animal is listed in Table 1 and Table 2: Table 1 Cow ID 1 2 3 4 5 Weight (kg) 500 625 718 813 995 Table 2 Goat ID 23 4 UA 6 7 8 9 10 Weight (kg) 55 65 50 30 40 70 80 90 20 30 As a programmer, you are required to help the farm owner, by writing an object-oriented program in java to compute the daily sell value (in RM) of milk. In particular, you are required to make the following

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions