Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program must be in C++ and CANNOT use loops, functions, arrays, or data file input and output; since these concepts have not been gone
The program must be in C++ and CANNOT use loops, functions, arrays, or data file input and output; since these concepts have not been gone over yet. However, assignment, symbolic constants, and interactive input CAN be used. Thank you for your help in advanced!
9. (Electrical eng.) a. Write, compile, and run a C++ program that calculates and displays the value of the current flowing through an RC circuit (see Figure 3.19). The circuit consists of a battery connected in a series to a switch, a resistor, and a capacitor. When the switch is closed, the current, i, flowing through the circuit is given by this formula: i = (E/R) et/RC E is the voltage of the battery in volts. R is the value of the resistor in ohms. C is the value of the capacitor in farads. t is the time in seconds after the switch is closed. e is Euler's number, which is 2.71828 (rounded to five decimal places). Switch wan E Figure 3.19 A series RC circuit Using this formula, write, compile, and run a C++ program to determine the voltage across the capacitor shown in Figure 3.19 when t is 0.31 seconds. (Note: The value of RG is referred to as the system's time constant.) The program should prompt the user to enter appropriate values and use input statements to accept the data. In constructing the prompts, use statements such as Enter the voltage of the bat- tery. Verify your program's operation by calculating by hand the current for the following test data: Test data set 1: Voltage = 20 volts, R = 10 ohms, RC = 0.044, t = 0.023 seconds Test data set 2: Voltage = 35 volts, R = 10 ohms, RC = 0.16, t = 0.067 seconds b. Check the value computed by your program by hand. After verifying that your program is working correctly, use it to complete the following chart: = = = = Current i (Amps) Voltage V (Volts) 35 35 35 15 15 15 6 Resistance R (Ohms) 10 10 10 10 10 10 1000 RC (Time Constant) 0.16 0.16 0.16 0.55 0.55 0.55 2.6 Time t (Seconds) 0.11 0.44 0.83 0.11 0.44 0.067 12.4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started