Question: 1. Open Code::Blocks and start a new console application project. 2. Create function prototypes at the top of your file for the following functions: a.

 1. Open Code::Blocks and start a new console application project. 2.Create function prototypes at the top of your file for the following

1. Open Code::Blocks and start a new console application project. 2. Create function prototypes at the top of your file for the following functions: a. void prompt(void); b. void calc ResistorColors(int); 3. The source code for each of your functions should be written below your main() function. Optionally, if you would like to get more practice with libraries (Part 2), you could create a Resistance Library. 4. Description of the prompt(void) function: a. This function should display the Color-Code Scheme displayed in Table 1 then ask the user what resistance should be color-coded. To save you time, the print statements for Table 1 have been provided to you in Appendix-B Table 1: Resistor Color-Code Character Scheme Band 1 & 2 0 Character K N R 0 Y Color Black Brown Red Orange Yellow Green Blue Violet Grey White 2 3 4 5 6 Band 3 81 910 +100 *1.000 810,000 *100,000 *1,000,000 *10,000,000 B V E 8 9 5. Description of calcResistor Colors (int) function: a This function should take as a parameter, an integer value of a resistor. For the sake of simplicity, we will ignore the tolerance (4h band) and fractional multipliers of Gold and Silver in the 39 band in this step, so the integer should only be between 1-99M ohms. Make sure to error check this before proceeding. Assuming a valid integer, determine what the 3-band colors would be for this integer, using a leading-0 as necessary, and print the color code to the console window. i. Example: Entering "57000" should output "Green-Violet-Orange to indicate 5-7-*1,000. b. HINT: Consider making a zetlotRetween) function that sets a min and maximum value to retrieve values between and returns a valid integer. C. HINT: Consider determining what multiplier is being used before determining what digits are present in the first two bands. You can accomplish this by counting the number of times the number can be divided by 10 before it itself is less than 100 (a two-digit number). 6. Your main() function should do the following: a. Call the prompt() function to request user input. b. Perform the conversion and print to the screen c. Ask the user if they would like to try another resistor i. If yes, loop back to step A ii. If no, exit the program 7. Error Checking: All points of user input should be carefully error checked to ensure there is no chance for invalid, malicious input. For example, if the program is expecting an integer between 1-99M, entering a negative number or a number too large should fail and ask them to try again. Likewise, entering a character when an integer is expected should not break the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!