RollCast's Classic Salmon Fly Proportion Calculator | C++ Help

  • C/C++
  • Thread starter rollcast
  • Start date
  • Tags
    C++
In summary: For example:./program > output.txtThis will save the output of the console to "output.txt" in the current directory.
  • #1
rollcast
408
0
Code:
#include <iostream>

using namespace std;

int main()
{cout<< "Welcome to RollCast's Classic Salmon Fly Proportion Calculator!"<<endl;
cout<< "Please enter the gape of your hook in mm."<<endl;
int gape;
cin>> gape;
cout<< "Your hook gape ="; cout<< (gape); cout<< "mm"<<endl;
cout<< "Please select which tyers proportions you wish to use"<<endl;
cout<< "1: Kelson \n2: Cohen \n3: Alcott \n4: Carne \n5: Guidry \n6: Inman \n7: Boyer \n8: Ostoj \n9: Gotzmer"<<endl;
cout<< "Please input the number for which proportion you wish to use"<<endl;
int tyer;
cin>> tyer;
float dtl;
float has;
float dbb;
switch (tyer)
   {case 1:
      dtl =1.8;
      has =0.8;
      dbb =0.7;
    break;
   case 2:
      dtl =2;
      has =0.875;
      dbb =0.5;
    break;
    case 3:
      dtl =1.4;
      has =0.7;
      dbb =0.3;
    break;
   case 4:
      dtl =1.8;
      has =1;
      dbb =0.44;
    break;
    case 5:
      dtl =1.88;
      has =1.1;
      dbb =0.75;
    break;
   case 6:
      dtl =1.9;
      has =0.81;
      dbb =0.69;
    break;
    case 7:
      dtl =1.78;
      has =0.5;
      dbb =0.83;
    break;
   case 8:
      dtl =2;
      has =0.78;
      dbb =0.78;
    break;
    case 9:
      dtl =1.69;
      has =0.58;
      dbb =0.53;
    break;
     default:
    cout << "Not a valid option" << endl;
    }
    cout<< "Diagonal tail length ="; cout<< gape*dtl; cout<< "mm"<<endl;
    cout<< "Height above shank ="; cout<< gape*has; cout<< "mm"<<endl;
    cout<< "Distance behind bend ="; cout<< gape*dbb; cout<< "mm"<<endl;

    cout<< "Thanks for testing, RollCast \n Press ANY KEY to continue";

  return 0;
  }

When I try to debug this it stops the console window at the part:

Code:
...
float dtl;
float has;
float dbb;
switch (tyer)
   {case 1:
      dtl =1.8;
      has =0.8;
      dbb =0.7;
    break;
...

but doesn't give me any error messages?
 
Technology news on Phys.org
  • #2
I just ran this code and my debugger didn't crash. By the looks of it, it seems good. What exactly is the problem?
 
  • #3
When I try to save the code as a .exe so I can email it to some people who wanted it, the console opens when the .exe is ran but then stops and closes at the part I indicated.
 
  • #4
My bet is that it displays the message and then closes the console - as there is no reason for the console to stay open. Console closes so fast, it is impossible to see that the message was displayed.
 
  • #5
Think what my problem is that the person I'm trying to send it to hasn't got a compiler for c++, is there any way I can save it so he doesn't need to install a compiler?
 
  • #6
Sorry I just realized that I had forgotten to code a pause into the end of it
 
  • #7
... or you could tell the person to run the program from a dos console window. For windows XP, you'd click on programs / accessories / command prompt. I assume that the "pause" function asks the user to press the enter key to continue?
 
  • #8
Do what rcgldr said: use the command prompt.

Also if you ever come across a scenario where there is too much text, then pipe the output to a text file.
 

Related to RollCast's Classic Salmon Fly Proportion Calculator | C++ Help

What is RollCast's Classic Salmon Fly Proportion Calculator?

RollCast's Classic Salmon Fly Proportion Calculator is a C++ program designed to help fly fishermen accurately measure and tie classic salmon flies. It calculates the correct proportions for each component of the fly, such as the hook size, wing length, and body length, based on the desired overall fly size.

How do I use the Classic Salmon Fly Proportion Calculator?

To use the calculator, simply input the desired fly size and the program will automatically calculate the correct proportions for each component. You can then use these measurements to tie your fly or make adjustments as needed.

Is RollCast's Classic Salmon Fly Proportion Calculator accurate?

Yes, the calculator is based on the classic salmon fly tying principles, and has been tested and verified by experienced fly fishermen. However, it is always important to use your own judgement and make any necessary adjustments based on your personal tying preferences.

Can I customize the proportions in the calculator?

Yes, the calculator allows you to input your own desired proportions for each component, giving you the flexibility to create a fly that meets your specific preferences. However, it is recommended to stick to the classic proportions for the most accurate and traditional results.

Is the Classic Salmon Fly Proportion Calculator available for other programming languages?

Currently, the calculator is only available in C++. However, the code is open source and can be adapted for other programming languages by experienced developers.

Similar threads

  • Programming and Computer Science
Replies
3
Views
3K
Back
Top