Resistor values develop a prolog program

                                      Electrical Engineering Case Study – Resistor Values

 

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.

A resistor is a circuit device designed to have a specific resistance value between its ends (see http://en.wikipedia.org/wiki/Resistors for more details on resistors). Resistance values are expressed in ohms (Ω) or kilo-ohms (k Ω). Resistors are frequently marked with four colored bands that encode their resistance values, as shown below.  The first two bands encode the first two significant digits of the resistance value, the third is a power-of-ten multiplier or number-of-zeroes, and the fourth is the tolerance accuracy, or acceptable error, of the value.

 
 

 

 

 

 

 

 

 

 

 

 

(Source: http://ikalogic.com/beg_1_res_v_c.php)

 

The table below shows the meanings of each band color.  For example, if the first band is green, the second is black, and third is orange, and the fourth is silver, the resistor has a value of 50 X 103 ± 0.1X50X103 Ω or 50 ± 5 kΩ.

Color

1st band

2nd band

3rd band (multiplier)

4th band (tolerance)

Black

0

0

×100

 

Brown

1

1

×101

 

Red

2

2

×102

 

Orange

3

3

×103

 

Yellow

4

4

×104

 

Green

5

5

×105

 

Blue

6

6

×106

 

Violet

7

7

×107

 

Gray

8

8

×108

 

White

9

9

×109

 

Gold

   

×10-1

±5%

Silver

   

×10-2

±10%

 

The Challenge:

 

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.

 

 

 

 

 

 

 

Here is a snapshot of what the program will look like:

 

 

 

 

 

 

 

 

 







Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Get 15% OFF on your FIRST order. Use the coupon code: new15