Approximate salaries of various people

#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int max(vector<int> seq) { return *max_element(seq.begin(), seq.end()); } int main() { vector<string> names = { "Jasmine Craig", "Rochelle Dunn", "Freda Hoffman", "Chelsea Brooks", "Leo Williams", "Casey Hopkins", "Lucille Frazier", "Raul Blake", "Javier Norman", "Amanda Torres" }; vector<int> salaries = { 3600, 3350, 2900, 3750, 5200, 2100, 2650, 3220, 3000, 2500 }; double max_salary = max(salaries); string ch = "="; int max_chars = 20; cout << "Approximate salaries of various people:\n\n"; for(size_t i = 0; i < names.size(); i++) { string name = names[i]; int chars = floor((salaries[i] / max_salary) * max_chars); string char_str = ""; while(chars > 0) { char_str += ch; chars--; } cout << name << "\t" << char_str << endl; } cout << endl; return 0; } Approximate salaries of various people