Hi,
I am currently taking C++ classes, and I have been given a simple (erm...) task of creating a C++ application that takes one input which is a number to one-decimal point e.g. 1.8, 1.9, 2.0, 2.1!
A user enters a one decimal point number between 0 and 20, and the app uses a loop to create a table up to that number in the format (if a user enters 1.3 then) -:
____ 1.0 | 1.1 | 1.2 | 1.3
1.0__1.0___1.1__ 1.2___1.3
1.1__1.1___1.21_ 1.32__1.43
1.2__1.2___1.32__1.44__1.56
1.3__1.3___1.43__1.56__1.69
(I had to use underscores to align the table because double spaes get removed in my post!)
I need to hand this in, and i've been burning my brain for hours!!!
I've currently got this going:
Thanks in advance.Code:#include <iostream> #include <string> using namespace std; int main() { double MAX = 20.00; cout << "Please enter scale of the multiplication table..." << endl; cin >> MAX; for(double i = 0.00; i < MAX; i = i + 0.1) { cout << i << "\t"; }; return 0; }
VD