Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,630 members, 7,816,593 topics. Date: Friday, 03 May 2024 at 01:40 PM

Please I Need Help On This Question - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please I Need Help On This Question (1161 Views)

IT Gurus Here Pls Help Me Answer This Question / Can A Pro Programmer/developer Answer This Question? / I Need Help On Java (2) (3) (4)

(1) (Reply) (Go Down)

Please I Need Help On This Question by possibiliterian(m): 5:18pm On Jan 03, 2017
the voltage across a discharging capacitor is v(t) = 10(1− e^-0.2t) generate a table of voltage, v(t) , versus time, t, for t = 0 to 50 seconds with increment of 5 s
Re: Please I Need Help On This Question by Drniyi4u(m): 6:12pm On Jan 03, 2017
Hi. From the question, you were given the time from 0 to 50 seconds and increment of 5. So, the time will be 0, 5, 10, 15, 20......50secs, and for each instance of time, v(t) will be generated by inserting the value of t in the given equation.
Then, you'll tabulate your result as required.
I hope this is helpful.
Cheers!

1 Like

Re: Please I Need Help On This Question by kudaisi(m): 9:52am On Jan 04, 2017
possibiliterian:
the voltage across a discharging capacitor is v(t) = 10(1− e^-0.2t) generate a table of voltage, v(t) , versus time, t, for t = 0 to 50 seconds with increment of 5 s

Do you need a computer program to output the result ?
Re: Please I Need Help On This Question by kudaisi(m): 10:17am On Jan 04, 2017
possibiliterian:
the voltage across a discharging capacitor is v(t) = 10(1− e^-0.2t) generate a table of voltage, v(t) , versus time, t, for t = 0 to 50 seconds with increment of 5 s

Just in case you needed the a program to solve it, here is a code I just whipped up in Java:

public class CapacitorDischarge {

public static void main(String[] args) {
String head = String.format("%-10s|%20s" , "Time(t)", "Voltage(v)" );
System.out.println(head);
System.out.println(new String(new char[head.length()]).replace("\0", "-" ));
for(int t=0; t <= 50; t+=5){
double v = 10*(1 - Math.pow(2.718281828459045,(-0.2*t)));
System.out.println(String.format("%-10s|%20s" , t, v ));
}
}
}


An this is what the output looks like:
Time(t)   |          Voltage(v)
-------------------------------
0 | 0.0
5 | 6.321205588285577
10 | 8.646647167633873
15 | 9.50212931632136
20 | 9.816843611112658
25 | 9.932620530009146
30 | 9.975212478233336
35 | 9.990881180344456
40 | 9.996645373720975
45 | 9.998765901959134
50 | 9.999546000702376


Disclaimer I can't assure you that the result is correct cause the value of e (Euler's number) used was to ten places. The plan is to give you an idea on how to go about it.

1 Like

Re: Please I Need Help On This Question by possibiliterian(m): 8:45am On Jan 05, 2017
Thanks Guys.....Have gotten it

(1) (Reply)

VISIOLA FOUNDATION Five-week Coding Boot Camp For Girls 2017 / My Observations / Need A Fingerprint Scanner Or Facial Recognition For Integration Into My Project

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.