Hey, It works. Almost.
Posted: January 17th, 2018, 11:57 pm
So, I have been really inconsistently learning c++ over the past two years and I pretty much keep forgetting everything. But I made this program and everything works well, the output is what I want it but . . . The file size is huge!!! like 545KB. I would think it should be somewhere more in the range of 15KB to 40KB. Is there a way that I can make this smaller?
Is it because of the header files I include? I would imagine these would have a lot of unnecessary baggage carried with them for my purposes.
Here's the code and an executable is attached.
Is it because of the header files I include? I would imagine these would have a lot of unnecessary baggage carried with them for my purposes.
Here's the code and an executable is attached.
Code: Select all
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
float x = 0;
float y = 0;
float x_buff = 0;
float y_buff = 0;
int s;
float mod;
float mod_history[16] = {0};
int res;
int con = 0;
int con1;
cout << " WARNING: Program breaks after 16 different modifiers.";
cout << "\n \nInput starting value: " ;
cin >> s;
do{
cout << "starting value is at " << s << endl << endl;
cout << endl << "Input Percent Modifier: %" ;
cin >> mod;
if(mod == 0){break;}
cout << endl << "x = y * " << (mod/100) << endl;
cout << "y = x / " << mod/100 + 1 << endl;
y = s;
x = s;
cout << "How many results to generate?: ";
cin >> res;
//Print
for(int i = 0; i <= (res-1); i++)
{
if(x == y){cout << ">> ";};
cout << x << ", " << y << endl;
x_buff = x;
y_buff = y;
x = y_buff * (mod/100);
y = x_buff * ((mod/100) + 1);
};
cout << "\n \n To quit, input modifier at 0 \n \n \n";
cout << "Previous Modifier was at " << mod << "%" << endl << "Modifiers used are: ";
mod_history[con] = mod;
con1 = 0;
do{
cout << mod_history[con1] << "%";
con1++;
if(mod_history[con1]!=0 || con1==16){cout << ", ";}
}while(mod_history[con1]!=0 || con1==16);
cout << endl;
con++;
}while(x!=0 || con == 16);
cout << "\n \n \n \nIf we can create stats for this that would be great. \n \n A pattern for how they line up. \n \n Since 50 makes them super small and 90 makes them big, what is the magic number for 2? \n \n what is the magic number for any number? \n \n it is between 61 and 62 and is really close to 61.8 for the number 2. \n" << endl;;
system("pause");
}