Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A sample output is as follows: Enter Band 1: green Enter Band 2: black Enter Band 3: yellow Resistance = 500 kilo-ohms *******THIS SHOULD BE

image text in transcribed

A sample output is as follows:

Enter Band 1: green Enter Band 2: black Enter Band 3: yellow Resistance = 500 kilo-ohms 

*******THIS SHOULD BE DONE IN C CODE, NOT C++*******

1 Resistors (20 Points) Name the project: resistor A resistor is a circuit device designed to have a specific resistance value between its ends. Resistance values are expressed in ohms or kilo-ohms. These are frequently marked with three colored bands that encode their resistance values. The first two bands are digits, and the third is a power-of-ten multiplier. The table below shows the meaning of each band color Color Value as Digit Value as Multiplier Black 0 Brown 1 Red Orange3 Yellow 4 Green 5 10 103 Violet 7 10 re White9 For example, if the first band is green, the second is black, and the third is orange, the resistor has value of 50 1 = 50000 ohms or 50 kilo-ohms. The information in the table can be stored in a C program as an array of strings. char coLOR CODES [10]17-"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "gray", "white"); Using "red" as an example, it is stored in COLOR_CODES [2] and corresponds to digit 2 and multiplier 102 from the table. In general, COLOR_CODES [n] has digit n and multiplier 10" Write a program that prompts the user to enter colors for Band 1, Band 2, and Band 3, and then displays the resistance in kilo-ohms. You'll need to include a function called search that has three parameters: the array of strings, the size of the array, and the string you want to search (i.c., the actual word). This function returns the index of the element that matches the target or returns -1 if the target is not in the list. Note that you'll need to call this function for each color you'll search Once you have the indices of all three colors, you'll then need to compute the resistance. This can be done in mairn

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions