Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ASSIGNMENT #5 1. Create a program that will compute the voltage drop across a re

ID: 3805614 • Letter: A

Question

ASSIGNMENT #5 1. Create a program that will compute the voltage drop across a resistor for a range of current values selected by the program user. The program user is input the value of the resistor, the beginning and ending current values, and the incremental of the current. The relationship between the resistor voltage and current is given by V IR Where V Voltage across the resistor in volts I Current in the resistor in amps R Value of the resistor in ohms Use 4700 ohms for R with the current varying from 500mA to A in steps of 250mA. Use a for loop. The output of the program should be an appropriate title which identifies the program and include your name, followed by a Table (a list) with the values of currents used and the values of the calculated voltages. Use Notepad to enter the V, l values that were output by the above program into a data file called C:IV-I.txt, and then have GNUPLOT plot this data. Submit a printout of your program, the printed output list, and a copy of this graph to your instructor. 2. Develop a program that will calculate the power dissipated in a resistor for a range of voltage values across the resistor. The relationship is given by Where Power dissipation of the resistor in watts V Voltage across the resistor in volts R Value of the resistor in ohms Use the voltage values 1 through 10 in steps of l V and R-40 ohms. The output of the program should have an appropriate title which identifies the program and include your name, followed by a Table (a list) with the values of voltages used and the values of the calculated powers. Draw a flowchart. 1/2015

Explanation / Answer

First Of All a "Loop" is a way to execute line(s) of code multiple times. Hence Making code usable and less redundant. "For" Loop is very common and popular in programming.

Here is your final code for Solution 1:
#include<conio.h>
#include<stdio.h>
int main()
{
   int n,i;
   int v,r;
   r=4700; //for given resistance
   cout<<"Program to Compute Voltage Drop"
   cout<<"YOUR NAME" //Your Name
   cout<<"Cureent(mA) Resistance(ohms) Voltage";
   for(i=500;i<=3000;i+=250)
   {
   v=i*r;
   cout<<i<<" "<<r<<" "<<v;
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote