spacing

I want to display all the columns in the same line.
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
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

void NumberOfAssignments ();
void FinalGrade ();

int main()
{
	NumberOfAssignments ();
	FinalGrade ();
	cout << "\n\n\n\t\t\t   "; return 0;
}

void NumberOfAssignments()
{
	int NumberOfAssignments;
	cout << "NumberOfAssignments\n";
	NumberOfAssignments = 0;		
	while ( NumberOfAssignments < 22 )
	{
		cout << NumberOfAssignments+1 << endl;
		NumberOfAssignments++;
	}
	cout << NumberOfAssignments+1;
}

void FinalGrade ()
{
        int FinalGrade;
	cout << "\tFinalGrade\n";
	FinalGrade = 0;
	while ( FinalGrade < 23 )
	{
		if ( FinalGrade > 0 )
			cout <<  "\n\t\t\t\t" << pow ( FinalGrade*1.0 , 6 );
		    FinalGrade++;
	}
	cout << "\n\t\t\t\t" << pow ( FinalGrade*1.0 , 1.0 / 6 );
Last edited on
If you mean that you want 2 columns, you can't do that using 2 functions, this way.

You can calculate one assignment at a time, this would mean you put the while loop in main. Probably easiest.

or combine the two functions.

or you could save all the values to an array and output the values at the end.

NumberOfAssignments
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 FinalGrade

1
64
729
4096
15625
46656
117649
262144
531441
1e+006
1.77156e+006
2.98598e+006
4.82681e+006
7.52954e+006
1.13906e+007
1.67772e+007
2.41376e+007
3.40122e+007
4.70459e+007
6.4e+007
8.57661e+007
1.1338e+008
1.68638
Topic archived. No new replies allowed.