Sooo yeah. Not one of those derps begging for a solution, but my solution simply isn't working out how I want it to. TLDR;
Letters A-T are supposed to obey the number of coulmns entered by the user, then output them.
My program obeys the number of coulmns by recognizing your input, but it does not put the letters back into the number of coulmns accordingly. It is just outputting them. I know there has to be some really stupid, silly issue I'm overlooking but Im trying to finish this up.
Any help is good help.
#include <cmath>
#include <iostream>
#include <iomanip>
using namespace std; // Declares that we will be using the namespace library.
int main() // The beginning of where the C++ program
{
// Variables declared
int ncol;
double poweroftwo;
char letter;
// Main Do-while loop (nonstop)
do
{
do // Do - while loop to check user input
{
cout<<"Please input a number of columns: [8+ ends program, 0 is invalid. 1-7 are valid] "; //Ask the user to input the number of columns
cin>>ncol;
if ((ncol>=0)&&(ncol<=7)) // If ncol is the range, we close the do-while loop
break;
else // If it is not, we display the error message and the loop keep going
cout<<"Number of columns out of range [1-7]. Try again..."<<endl;
}
while(1); //We make it infinite, only close at the break (columns are in the range)
if (ncol==0) break; //If the user input is 0, we close the program before any display
{
for(letter = 'A'; letter <= 'T'; letter++)
cout<<setw(5)<<letter; //We display the number using a set width
}
cout<<endl; // To start the next user input in a new line after the previous display
}
while(1); //We make it infinite, only close at the break (columns=0)
return 0; //Causes the main function to finish.
}