RSS Forums RSS
Please support our Site Layout and Usability advertiser: Internet Marketing Services
Views: 519 | Replies: 1 | Thread Tools  Display Modes
Join Date: Nov 2007
Posts: 10
Reputation: black3 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
black3 black3 is offline Offline
Newbie Poster

Call to a Function more than once

  #1  
Nov 18th, 2007
I have a program to write as part of assignment for class, using C++ of course and using functions. Basically I have to write a Resistor Colour Code Calculator which will allow a user to input the colours and it would give them a value as well as a tolerance range. I am currently having trouble writing the part for the first two bands which are the significant figures. Form what I can see I need to call the Significant Figures function twice, and I have no idea how to do it.

int sigfig () //Significant Figures Function
{
string sband1,sband2,sband3,sband4;
int nband,nband2,nband3,nband4, count;

cout << "Please enter colour of band 1";
cin >> sband1;
//while (count !=1)
//{
//count = count +1;
if (sband1 == "black")
{
nband=0;
}

int main() // Main Function
{
string band1, band2, band3, band4, result, colour, func, band;

band1 = sigfig ();
cout << band1;

cout << "Please enter colour of band 2";
cin >> band2;

band2 = sigfig ();
cout << band2;

cout << "Please enter colour of band 2";
cin >> band2;
cout << "Please enter colour of band 3";
cin >> band3;
cout << "Please enter colour of band 4";
cin >> band4;
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:57 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC