Help.. How can I use arrays to make this more functinalbe

looking to use arrays for the temperature change but unsure how to set it up. I want it to print our like I have below so I can then find the max amount in each column, but don't know how to code it getting frustrated.

Enter the starting thickness
.01
enter the end thickness
.1
Enter the thickness increment
.01
Enter the starting temperature
-10
Enter the ending temperature
10
Enter the temperature increment size
10
Thickness CI CF fuel_savings @ -10 fuel_savings @ 0 fuel_savings @ 10
0.01 185.75 0 -185.75 -185.75 -185.75
0.02 228 474.277 246.277 216.634 186.992
0.03 276.75 655.041 378.291 337.351 296.411
0.04 332 803.135 471.135 420.939 370.743
0.05 393.75 925.397 531.647 473.81 415.972
0.06 462 1027.51 565.515 501.295 437.075
0.07 536.75 1113.87 577.116 507.499 437.882
0.08 618 1187.75 569.753 495.518 421.283
0.09 705.75 1251.67 545.916 467.687 389.458
0.1 800 1307.5 507.5 425.781 344.062
Do you want to run this program again? (y/n)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
int main()
{
    float i, thick_increment, start, end, start_temp, end_temp, temp_increment, a, b, L, Ta, k, F, Cvol, CL, Cstheat, tenneg9, dQ, Q3, c, d, e, f, g, h, j,CI, CI_1, CI_2, tenpos8, one5sev, cf, CF, fuel_savings, tair, dQ_1, dQ_2, CF_1, CF_2, Q3_1, Q3_2, fuel_savings1, fuel_savings2, rerun;
    
    float temp[3];
    
    char y, Y;
        
    cout<<"Enter the starting thickness""\n";
    cin>>start;
    cout<<"enter the end thickness""\n";
    cin>>end;
    cout<<"Enter the thickness increment""\n";
    cin>>thick_increment;
    cout<<"Enter the starting temperature""\n";
    cin>>start_temp;
    cout<<"Enter the ending temperature ""\n";
    cin>>end_temp;
    cout<<"Enter the temperature  increment size""\n";
    cin>>temp_increment;
    
    do {
    
    
    cout<<setw(10)<<"Thickness"<<setw(15)<<"CI"<<setw(25)<<"CF"<<setw(35)<<"fuel_savings @ "<<start_temp<<setw(25)<<"fuel_savings @ "<<start_temp+temp_increment<<setw(25)<<"fuel_savings @ "<<end_temp<<endl;
    
    for (i=start; i<=end; i=i+thick_increment)
    {  a=.05;
    b= a+i;
    L=100;
    Ta=150;
    k=.1;
    F=3;
    Cvol=325;
    CL=1.5;
    tenneg9= pow(10, -9);
    Cstheat=1.11*tenneg9;
    CI_1=(b*b-a*a)*(L)*(Cvol);
    CI_2=L*CL;
    CI=CI_1+CI_2;
        
        for (tair=start_temp; tair<=end_temp; tair=tair+temp_increment)
        c=b/a;
        d=b*F;
        e=d/k;
        f=log(c);
        g=(e*f)+1;
        h=c/g;
        j=1-h;
        dQ=Q3*j;
        dQ_1=Q3_1*j;
        dQ_2=Q3_2*j;
        Q3_1=2*3.14*a*F*(Ta-0)*L;
        Q3_2=2*3.14*a*F*(Ta-10)*L;
        Q3=2*3.14*a*F*(Ta-(-10))*L;
        tenpos8= pow(10, 8);
        one5sev=1.578*tenpos8;
        cf=dQ*Cstheat;
        CF=dQ*one5sev*Cstheat;
        CF_1=dQ_1*one5sev*Cstheat;
        CF_2=dQ_2*one5sev*Cstheat;
        fuel_savings=CF-CI;
        fuel_savings1=CF_1-CI;
        fuel_savings2=CF_2-CI;
        
         cout<<i<<setw(25)<<CI<<setw(25)<<CF<<setw(25)<<fuel_savings<<setw(25)<<fuel_savings1<<setw(25)<<fuel_savings2<<endl;
        
        
    }
        cout<<"Do you want to run this program again? (y/n)""\n";
        cin>>rerun;
    } while (rerun =='Y' || rerun=='y');
    
    return 0;
}
well the output I put in for you is not formatted correct but if you look at the code I think you will get what I am saying thanks
This doesn't answer your current question, but just to go back to a point from your other thread....

You still have rerun defined as a float. You don't need to declare y and Y as char variables. Rerun should be defined as char. Your while statement will then evaluate the value in rerun - if it's 'y' or 'Y', the loop will run again.

float i, thick_increment, start, end, start_temp, end_temp, temp_increment, a, b, L, Ta, k, F, Cvol, CL, Cstheat, tenneg9, dQ, Q3, c, d, e, f, g, h, j,CI, CI_1, CI_2, tenpos8, one5sev, cf, CF, fuel_savings, tair, dQ_1, dQ_2, CF_1, CF_2, Q3_1, Q3_2, fuel_savings1, fuel_savings2, rerun;

char y, Y;

1
2
3
cout<<"Do you want to run this program again? (y/n)""\n";
        cin>>rerun;
    } while (rerun =='Y' || rerun=='y');


i was working with two files and changed one and posted the other, yes you are correct thanks for the help
allekj, make sure you pay attention to what wildblue has to say because he is very good at this. wildblue, I need your help again. I apologize for jumping in asking for help but could you take a look at my most recent plea for help. http://www.cplusplus.com/forum/general/131374/
Topic archived. No new replies allowed.