Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a pseudocodes and flowchart that fit with the program below. #include #include #include #include int search (char codes[10][7], char target[], int size); int main
Design a pseudocodes and flowchart that fit with the program below. #include #include #include #include int search (char codes[10][7], char target[], int size); int main (void) char COLOR CODES [10][7] = {"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "gray", "white"); float Resistance_value; char band1[7]; char band2[7]; char band3 [7]; int i, j,k; char question; printf(" This program is designed to calculate the resistance value between the ends of a resistor."); printf(" Do you want to decode resistor now (Type 'y' for yes, or 'n' for no)? printf(" -> "); scanf("%c", &question); while (question 'y') { printf(" Enter the colors of the resistor's three bands, beginning with the band nearest the end. "); printf("Type the colors in lowercase letters only, NO CAPS. "); printf ("Band 1 => "); scanf("%s",&band1); printf ("Band 2 => "); scanf("%s",&band2); printf ("Band 3 => "); scanf("%s",&band3); i - search (COLOR CODES, band, 10); i - search (COLOR_CODES, band, 10); j = search (COLOR_CODES, band2, 10); k = Search (COLOR_CODES, band3, 10); Resistance_value- ((10*i+j)*(pow(10,k))/1000; if (i == -1 || 1 == 0) { printf ("Invalid colors : %s", i); if (j = -1 ) { printf ("Invalid colors : %s", i); if (k- { -1) printf ("Invalid colors : %s", k); : else { printf ("Resistance value: %.of kilo-ohms ", Resistance_value); } printf(" Do you want to decode another resistor (Type 'y' for yes, or 'n' for no)? "); printf(" => "); scanf("%c", &question); } system("pause"); return 0; 3 int search (char codes[][7], char target[] int size) { int x = 0; int match - ; int location; while (Imatch && x
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