Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P11.10 After the switch in the figure below closes, (see book for figure), the voltage (in volts) across the capacitor is represented by the equation

P11.10 After the switch in the figure below closes, (see book for figure), the voltage (in volts) across 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.

IMPORTANT!! For this lab you simply need to create a CapacitorVoltage class that implements the main method in order to perform your file I/O. Make sure you use params.txt as your input file. Use rc.txt for your output file.

in.txt:

12.2 13.3 144.4 96.333 45.01 92.22 7872.22 .223344 .665544 100.0001 27

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions