Well at this point I have no idea what you guys are talking about (tomorow ill look into it, right now i gota do some actual school homework) but the way that Zuk made the code im not sure if he relizes thats...pretty much all there is to my code. Although earlier I did make a function of getting the zeros, heres the full code.
Code:
#include <iostream>
using namespace std;
int process(int);
int main()
{
int band1, band2, band3;
cout<<"-------------"<<endl;
cout<<"0 is black"<<endl;
cout<<"1 is brown"<<endl;
cout<<"2 is red"<<endl;
cout<<"3 is orange"<<endl;
cout<<"4 is yellow"<<endl;
cout<<"5 is green"<<endl;
cout<<"6 is blue"<<endl;
cout<<"7 is violet"<<endl;
cout<<"8 is gray"<<endl;
cout<<"9 is white"<<endl;
cout<<"-------------"<<endl;
cout<<endl;
cout<<"1st band: ";
cin>>band1;
cout<<"2nd band: ";
cin>>band2;
cout<<"3rd band: ";
cin>>band3;
cout<<endl;
if (band1 == 0)
{
cout<<"Your resistor has "<<band2;
process(band3);
}
else
{
cout<<"Your resistor has "<<band1<<band2;
process(band3);
}
cout<<endl;
system("pause");
return 0;
}
int process(int band3)
{
for (int increase = 0; increase < band3; increase++)
{
cout<<"0";
}
cout<<" Ohms of resistance."<<endl;
return 0;
}
But im still gonna look into those casts (Im assuming those are the things Zuk suggested)