Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE DO NOT ANSWER IN SHEET PAPER....PROGRAM ONLY PLEASE NO C+ .......PLEASE Write a C program ANSI that will read the required values from the
PLEASE DO NOT ANSWER IN SHEET PAPER....PROGRAM ONLY PLEASE NO C+ .......PLEASE Write a C program ANSI that will read the required values from the input file. NO other format will be accepted. INTRODUCTION An example of a simple resistor circuit is displayed below V1 R1 In such circuits, VI is a voltage source (V) and R1 is a resistor (). The current in these circuits may be calculated using Ohm's law: The power dissipated across the resistor is In the above equations, lis the current in amps (A) Vis the voltage in volts (V),Ris the resistance in ohms (), and Pis the power in Watts (W) An input data file called circuits contains voltage and resistance information for a set of simple resistor circuits. The first record line of the input file is the control nunber, which defines the mmber of circuits to be read into the program. Each succeeding record line has two columns, where the first column is the voltage and the second column is the resistance. The input file is comma delimited ASSIGNMENT: Write a C program that will read the required values from the input file. Using the voltage and resistance, compute the current in each circuit and the power dissipated by the resistor in each circuit. Your program will produce a report in tabular fomat. Print the table to the computer screen and to an output file called levels Once the program is working, modify the program to account for any current that is greater than 0.1 amp. Instead of printing the normal column items, for any circuit with current greater than 0.1 amp, print the voltage, the resistance, and then print a message that the current may be fatal. The output format is shown on page 2 Use the "Code Sections c" tem plate to write your code OUTPUT FORMAT: CIRCUIT AMPERAGE AND POWER Voltage Resistance Current Power (ohms) xxXX Current may be fatal. ** FILE PATHS: Before submitting your C source program, make sure that you set your input and output file paths to U MCE 200. Input data 13 480,5100 192,1800 192,2100 810,3000 190, 2500 380,100 400,4250 00, 2500 240,3000 240,2500 150,1600 110,9200 910,750 PLEASE DO NOT ANSWER IN SHEET PAPER....PROGRAM ONLY PLEASE NO C+ .......PLEASE Write a C program ANSI that will read the required values from the input file. NO other format will be accepted. INTRODUCTION An example of a simple resistor circuit is displayed below V1 R1 In such circuits, VI is a voltage source (V) and R1 is a resistor (). The current in these circuits may be calculated using Ohm's law: The power dissipated across the resistor is In the above equations, lis the current in amps (A) Vis the voltage in volts (V),Ris the resistance in ohms (), and Pis the power in Watts (W) An input data file called circuits contains voltage and resistance information for a set of simple resistor circuits. The first record line of the input file is the control nunber, which defines the mmber of circuits to be read into the program. Each succeeding record line has two columns, where the first column is the voltage and the second column is the resistance. The input file is comma delimited ASSIGNMENT: Write a C program that will read the required values from the input file. Using the voltage and resistance, compute the current in each circuit and the power dissipated by the resistor in each circuit. Your program will produce a report in tabular fomat. Print the table to the computer screen and to an output file called levels Once the program is working, modify the program to account for any current that is greater than 0.1 amp. Instead of printing the normal column items, for any circuit with current greater than 0.1 amp, print the voltage, the resistance, and then print a message that the current may be fatal. The output format is shown on page 2 Use the "Code Sections c" tem plate to write your code OUTPUT FORMAT: CIRCUIT AMPERAGE AND POWER Voltage Resistance Current Power (ohms) xxXX Current may be fatal. ** FILE PATHS: Before submitting your C source program, make sure that you set your input and output file paths to U MCE 200. Input data 13 480,5100 192,1800 192,2100 810,3000 190, 2500 380,100 400,4250 00, 2500 240,3000 240,2500 150,1600 110,9200 910,750
Step 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