Important alert: (current site time 4/23/2014 11:02:41 PM EDT)
 

VB icon

Resistor color code reader

Email
Submitted on: 2/8/2013 1:43:09 PM
By: sumit subhash maredia 
Level: Intermediate
User Rating: Unrated
Compatibility: C
Views: 1254
author picture
(About the author)
 
     This program is for resistor color code useful for basic Electronic students.Just mention the color code for resistor program gives the exact value for it. If the value might be greater itself onvert to Kilo or Mega ohm as pe
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: Resistor color code reader
// Description:This program is for resistor color code useful for basic Electronic students.Just mention the color code for resistor program gives the exact value for it. If the value might be greater itself onvert to Kilo or Mega ohm as pe
// By: sumit subhash maredia
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=13977&lngWId=3//for details.//**************************************

Code :
#include<conio.h>
#include<iostream.h>
#include<string.h>
#include<process.h>
void main()
{
 start:
 clrscr();
 int i;
 float r=0;
 char a[10],b[10],c[10],d[10];
 cout<<"_____________________________!Color code Reader
1.0!____________________________";
 cout<<"Design by:A.Cherma rajan.BE.,";
 cout<<"Enter your Resister colour code here
";
 cout<<"Code 1:";
cin>>a;
 cout<<"Code 2:";
cin>>b;
 cout<<"Code 3:";
cin>>c;
 {
 if(!(strcmp(a,"black")))
r=0;
 else if(!(strcmp(a,"brown")))
r=10;
 else if(!(strcmp(a,"red")))
r=20;
 else if(!(strcmp(a,"orenge")))
r=30;
 else if(!(strcmp(a,"yellow")))
r=40;
 else if(!(strcmp(a,"green")))
r=50;
 else if(!(strcmp(a,"blue")))
r=60;
 else if(!(strcmp(a,"violet")))
r=70;
 else if(!(strcmp(a,"gray")))
r=80;
 else if(!(strcmp(a,"white")))
r=90;
 }
 {
 if(!(strcmp(b,"black")))
r+=0;
 else if(!(strcmp(b,"brown")))
r+=1;
 else if(!(strcmp(b,"red")))
r+=2;
 else if(!(strcmp(b,"orenge")))
r+=3;
 else if(!(strcmp(b,"yellow")))
r+=4;
 else if(!(strcmp(b,"green")))
r+=5;
 else if(!(strcmp(b,"blue")))
r+=6;
 else if(!(strcmp(b,"violet")))
r+=7;
 else if(!(strcmp(b,"gray")))
r+=8;
 else if(!(strcmp(b,"white")))
r+=9;
 }
{
 if(!(strcmp(c,"black")))
 r*=1;
 else if(!(strcmp(c,"brown")))
 r*=10;
 else if(!(strcmp(c,"red")))
 r*=100;
 else if(!(strcmp(c,"orenge")))
 r*=1000;
 else if(!(strcmp(c,"yellow")))
 r*=10000;
 else if(!(strcmp(c,"green")))
 r*=100000;
 else if(!(strcmp(c,"blue")))
 r*=1000000;
 else if(!(strcmp(c,"violet")))
 r*=10000000;
 else if(!(strcmp(c,"gray")))
 r*=100000000;
 else if(!(strcmp(c,"white")))
 r*=1000000000;
}
 cout<<"Colour code value for your Resister:";
 if(r/999999>=1)
 cout<<r/1000000<<" M";
 else if(r/999>=1)
 cout<<r/1000<<" K";
 else
 cout<<r<<" ";
 char ch=234,op;
 cout<<ch;
 cout<<"
Continue (y/n):";
 cin>>op;
 if(op=='y')
 goto start;
 else
 exit(1);
 getch();
}


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.