# EGRE 245 Programming Project #1 Calculating Parallel Resistance solution

\$30.00

Original Work
Category:

## Description

1 Overview
The formula for the e↵ective resistance R of n resisters in parallel is
1
R = 1
r1
+
1
r2
+ … +
1
rn
Write a complete C program that inputs from the keyboard the value of 3 resisters (in kohms)
and then prints to the screen a simple diagram of the system plus the e↵ective resistance of the 3
resisters connected in parallel. Make sure you prompt the user for all input and that you label all
of your output; you should do this for all applicable programs this semester. Also be sure to echo
print to the screen the values that have been entered.
Project #1’s code is given to you below; you are to input it exactly as it is shown (with the exception
that you would of course replace my name with yours). Don’t worry that the diagram will only
format correctly for up to three-digit input.
2 The Code
/* Project #1
EGRE245
D. Resler */
#include <stdio.h>
int main(void) {
float r1,r2,r3;
printf(“Proj. #1 – D. Resler\n”);
printf(“Enter the value of 3 resisters connected in parallel (in kohms)\n”);
printf(” #1: “);
scanf(“%f”,&r1);
printf(” value entered: %f\n”,r1);
printf(” #2: “);
scanf(“%f”,&r2);
printf(” value entered: %f\n”,r2);
printf(” #3: “);
scanf(“%f”,&r3);
printf(” value entered: %f\n”,r3);
printf(“\n”);
printf(” |—— %6.2f kohms ——|\n”,r1);
printf(“—-|—— %6.2f kohms ——|—-\n”,r2);
printf(” |—— %6.2f kohms ——|\n”,r3);
printf(“\n”);
printf(“Effective resistance: %f kohms\n”,1.0/(1.0/r1 + 1.0/r2 + 1.0/r3));
1
return 0;
}
3 Project Documentation
The very first lines in all of your programming project files this semester should be comments giving
general information about the project, class, author using the following format (you of course will
/* Project #1
EGRE245 Fall 2014
D. Resler */
In addition, the first output for all of your projects this semester should be the name of the project
/* … */
main() {
printf(“Proj. #1 – D. Resler\n”);
/* … */
}