from Big Java 6th. Edition. Ch.11 P11.12: the capacitor is represented by the equation v(t) = B(1 - e-t/(RC)) Suppose the parameters of the electric circuit are B = 12 volts, R = 500 Ω, and C = 0.25 μF. Consequently v(t) = 12(1 – e-0.008t) where t has units of μs. Read a file params.txt containing the values for B, R, C, and the starting and ending values for t. Write a file rc.txt of values for the time t and the corresponding capacitor voltage v(t), where t goes from the given starting value to the given ending value in 100 steps. In our example, if t goes from 0 to 1000 μs, the twelfth entry in the output file would be: 110.00 7.02261 Make sure that your program catches the FileNotFoundException that can occur if your input file params.txt cannot be found. Your program should catch this exception, and then prompt the user for a file name again until a valid file is entered. I hbelieve I have everything needed, but I cannot figure out how to write in the code for the equation so that it pulls the input from the .txt file. How would I do that part?
from Big Java 6th. Edition. Ch.11 P11.12:
the capacitor is represented by the equation
v(t) = B(1 - e-t/(RC))
Suppose the parameters of the electric circuit are B = 12 volts, R = 500 Ω, and C = 0.25 μF. Consequently
v(t) = 12(1 – e-0.008t)
where t has units of μs. Read a file params.txt containing the values for B, R, C, and the starting and ending values for t. Write a file rc.txt of values for the time t and the corresponding capacitor voltage v(t), where t goes from the given starting value to the given ending value in 100 steps. In our example, if t goes from 0 to 1000 μs, the twelfth entry in the output file would be:
110.00 7.02261
Make sure that your program catches the FileNotFoundException that can occur if your input file params.txt cannot be found. Your program should catch this exception, and then prompt the user for a file name again until a valid file is entered.
I hbelieve I have everything needed, but I cannot figure out how to write in the code for the equation so that it pulls the input from the .txt file. How would I do that part?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images