Develop a prolog program that prompts the user for the


Develop a PROLOG program that prompts the user for the colors of Band 1, Band 2, Band 3, and Band 4 and then displays the resistance in Kilo-ohms.

Develop a PROLOG program that prompts the user for the colors of Band 1, Band 2, Band 3, and Band 4 and then displays the resistance in Kilo-ohms. Assume that band 4 can only be Gold or Silver.

a) Present a main menu to the user about the following options:
a) Calculate resistance value
b) Help
c) 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.

b) The secondary menu prompts the user to select the band colors. For example:
a) Black
b) Brown
c) Red
d) Orange
e) Yellow
f) Green

Please select the color for band 1: 5
Please select the color for band 2: 0
Please select the color for band 3: 3
Please select the color for band 4: 11

The resistance value is: 50 ± 5 k?

Then the program should print back the main menu (Step 1).

c) If the user enters an invalid value, print an error message, and prompt the user for another value.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Develop a prolog program that prompts the user for the
Reference No:- TGS0666762

Now Priced at $40 (50% Discount)

Recommended (90%)

Rated (4.3/5)