public static void main(String[] args){
/*The number of bacteria, B, in a culture that’s subject to refrigeration can be
approximated by this formula:
B=300000*e^-0.032t
Using this formula, write a program that prompts the user for a value of time, calculates the
number of bacteria in the culture, and displays the result. */
Scanner i=new Scanner(System.in);
double B,e=2.71828,t;
Math.pow((double)e, (double)t);
System.out.println("Please input your value of time: ");
t=i.nextDouble();
** B = (300000)*Math.pow(e),(-0.032 * t);**
System.out.println("Number of bacteria: "+B);
}
it gives me an error
how can i make a formula multiply with that e^-0.032t?
reincom 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
reincom 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
reincom 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.