Programming has to use

➢ The use of decision structures

➢ The use of repetition structure.

The Problem is how to do

Present a main menu to the user about the following options:

1) Calculate resistance value

2) Help

3) Exit

The “help” option presents some information about the program and how to use it, and re-displays the main menu options. The “Exit” option terminates the program. The “Calculate resistance value” leads the user to a secondary menu as shown in Step 2.

The program need to be build is for this

Thanks alot

just telling me how to do might help me

Code:#include <stdlib.h> #include <stdio.h> int main() { int band1, band2, band3, band4 ,dig1, dig2, dig3, dig4 ,exit; do { printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n\n"); printf("\n Please choose the colour of band1: "); scanf("%i",&band1); if ((band1 < 0) || (band1 > 9)) { do { printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n\n"); printf("\n\a!!You have entered an invalid number!! \n\n"); printf("\n Please choose the colour of band1: "); scanf("%i",&band1); } while ((band1 < 0) || (band1 > 9)); } printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n\n"); printf("\n Please choose the colour of band2: "); scanf("%i",&band2); if ((band2 < 0) || (band2 > 9)) { do { printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n\n"); printf("\n\a!!You have entered an invalid number!! \n\n"); printf("\n Please choose the colour of band2: "); scanf("%i",&band2); } while ((band2 < 0) || (band2 > 9)); } printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n 10) Gold \n 11) Silver \n\n"); printf("\n Please choose the colour of band3: "); scanf("%i",&band3); if ((band3 < 0) || (band3 > 11)) { do { printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n 10) Gold \n 11) Silver \n\n "); printf("\n\a!!You have entered an invalid number!! \n\n"); printf("\n Please choose the colour of band3: "); scanf("%i",&band3); } while ((band3 < 0) || (band3 > 11)); } printf("\n 0) Gold \n 1) Silver \n"); printf("\n Please choose the colour of band4: "); scanf("%i",&band4); if ((band4 < 0) || (band4 > 1)) { do { printf("\n 0) Gold \n 0) Silver \n"); printf("\n\a!!You have entered an invalid number!! \n\n"); printf("\n Please choose the colour of band4: "); scanf("%i",&band4); } while ((band4 < 0) || (band4 > 1)); } if (band1 == 0) dig1 = 0; if (band1 == 1) dig1 = 1; if (band1 == 2) dig1 = 2; if (band1 == 3) dig1 = 3; if (band1 == 4) dig1 = 4; if (band1 == 5) dig1 = 5; if (band1 == 6) dig1 = 6; if (band1 == 7) dig1 = 7; if (band1 == 8) dig1 = 8; if (band1 == 9) dig1 = 9; if (band2 == 0) dig2 = 0; if (band2 == 1) dig2 = 1; if (band2 == 2) dig2 = 2; if (band2 == 3) dig2 = 3; if (band2 == 4) dig2 = 4; if (band2 == 5) dig2 = 5; if (band2 == 6) dig2 = 6; if (band2 == 7) dig2 = 7; if (band2 == 8) dig2 = 8; if (band2 == 9) dig2 = 9; if (band3 == 0) dig3 = 0; if (band3 == 1) dig3 = 1; if (band3 == 2) dig3 = 2; if (band3 == 3) dig3 = 3; if (band3 == 4) dig3 = 4; if (band3 == 5) dig3 = 5; if (band3 == 6) dig3 = 6; if (band3 == 7) dig3 = 7; if (band3 == 8) dig3 = 8; if (band3 == 9) dig3 = 9; if (band3 == 10) dig3 = -1; if (band3 == 11) dig3 = -2; if (band4 == 0) dig4 = 5; if (band4 == 1) dig4 = 10; printf(" 0) Black \n 1) Brown \n 2) Red \n 3) Orange \n 4) Yellow \n 5) Green \n 6) Blue \n 7) Violet \n 8) Gray \n 9) White \n\n"); printf(" Band1 is: %i \n Band2 is: %i \n Band3 is: %i \n Band4 is: %i \n", band1,band2,band3,band4); if (dig3 >= 3) { dig3 = dig3 - 3; printf("\n\n\a The Resistance is %i%i x 10^%i ± %i KΩ ",dig1,dig2,dig3,dig4); } else { printf("\n\n\a The Resistance is %i%i x 10^%i ± %i Ω ",dig1,dig2,dig3,dig4); } // Ask user if they want to exit or not: printf("\n\n\n\n Press 1 to exit, Press 2 for help or press any number to continue. "); scanf("%i",&exit); } while (exit != 1 ); system("exit"); return 0; }