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?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education