Question: I WROTE THIS PROGRAM IN C CODE ALREADY. BASICALLY THE ONLY TROUBLE I'M HAVING IS THAT WE ARE ARE SUPPOSED TO ASK THE USER IF
I WROTE THIS PROGRAM IN C CODE ALREADY. BASICALLY THE ONLY TROUBLE I'M HAVING IS THAT WE ARE ARE SUPPOSED TO ASK THE USER IF THEY WANT TO PERFORM ANOTHER CALCULATION. HOW DO I LOOP IT, SO THAT IF THE USER INPUTS N, IT WILL END THE PROGRAM, AND IF THEY ENTER Y, IT WILL COME BACK TO THE BEGINNING OF THE PROGRAM AND ASK THEM FOR THE FIRST THREE BANDS?
We are going to create a simple resistance calculator. Your program should ask the user if the resistors are in series or parallel read in the number of resistors read in the resistance of the individual resistors (et's assume they are all the same resistance) by having the user enter the first three colors of the 4 bands on the resistor (this site can help with color code calculations) calculate the total resistance of the circuit (this site can help with parallel resistor equations calculatons) print out the result Below is a sample execution of the program (values in bold are user input and should NOTbe hardcoded into your program) Welcome to the simple resistance calculator Are the resistors in Series or Parallel? Series How many resistors are there in the circuit? 5 The first three color bands on the resistors: Red Red Red Each resistor is 2200 ohms and the total resistance of the circuit is 11000 ohms Would you like to perform another calculation (Y/N)? Y Are the resistors in Series or Parallel? Parallel How many resistors are there in the circuit? 4 The first three color bands on the resistors: Red Red Red Each resistor is 2200 ohms and the total resistance of the circuit is 550 ohms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
