T
tvn007
Below is my code:
#include <string>
#include <iostream>
#include <iomanip>
int main (void){
using namespace std;
string name1 = "JOHN";
int id1 = 1234;
float balance1 = 27000.00;
float available1 = 14000.00;
cout
<<left<<setw(20)<<"NAME"<<setw(20)<<"ID"<<setw(20)<<"BALANCE"<<setw(20)<<"AVAILABLE"<<endl;
cout
<<left<<setw(20)<<name1<<setw(20)<<id1<<setw(20)<<setprecision(15)<<balance1<<setw(20)<<available1<<endl;
}
output:
NAME ID BALANCE AVAILABLE
JOHN 1234 27000 14000
however, I would like to have the output as follow:
NAME ID BALANCE AVAILABLE
JOHN 1234 27000.00Cents 14000.00Cents
Thanks in advance for any hints.
#include <string>
#include <iostream>
#include <iomanip>
int main (void){
using namespace std;
string name1 = "JOHN";
int id1 = 1234;
float balance1 = 27000.00;
float available1 = 14000.00;
cout
<<left<<setw(20)<<"NAME"<<setw(20)<<"ID"<<setw(20)<<"BALANCE"<<setw(20)<<"AVAILABLE"<<endl;
cout
<<left<<setw(20)<<name1<<setw(20)<<id1<<setw(20)<<setprecision(15)<<balance1<<setw(20)<<available1<<endl;
}
output:
NAME ID BALANCE AVAILABLE
JOHN 1234 27000 14000
however, I would like to have the output as follow:
NAME ID BALANCE AVAILABLE
JOHN 1234 27000.00Cents 14000.00Cents
Thanks in advance for any hints.