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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started