Question
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
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 (let'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 NOT be 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 Would you like to perform another calculation (Y/N)?N ***Grading: 35 points will be for style, and the point breakdown is described in post @10 10 points loop until N is given 15 points calculating individual resistor values from color code 15 points correct code for performing series / parallel resistor calculations 15 points get users input (text and numeric values) 10 points appropriate text to prompt user to enter values (resistance, number of resistors, etc.) Extra Credit:(5 points for each of the following) 1) Format the output so it's more appealing (not so many 0's and uses appropriate suffixes K,M,G, etc) 2) Handle invalid gracefully, if expecting a number and user gives a letter, or expecting a letter and get a number, or get wrong number of inputs, etc.
#pin
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