Question: Please help, unsure how to do this, in c# Test 4 Consumable public static int Test4(double onHand, double consume) Given two doubles (onHand and consume)

Please help, unsure how to do this, in c#

Test 4 Consumable

public static int Test4(double onHand, double consume)

Given two doubles (onHand and consume) that represent the amount of an on-hand resource (onHand) and the amount of the resource that is consumed per cycles (think a time period). You are to determine how many cycles (time periods), before the on-hand amount is used up. For example, if you have 1 gallon of milk (onHand)and use 1 quart (1/4 gallon) per day (consume), determine when you expect to run out of milk (4 days). Return the number representing when the on-hand amount reaches 0 (or becomes negative). You may find it necessary to use the Round method from the Math class to avoid floating-point errors. I'd suggest rounding the results of each computation to 3 decimal places.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!