Вам нужно будет поставить правильные настройки в разных частях, а также выравнивание по левому краю на основе вашего текста
1) Первая часть
setw(20)<<left<<setfill('.')<<"Equation #01"
2) Вторая часть - приблизительно 30
.
setw(30)<<left<<setfill(' ')<<"Ideal Gas Law(Chemistry)"
3) Чтобы выровнять двоеточие:
setw(3)<<left<<setfill(' ')<<":"
4) значение части
setw(5)<<std::left<<setprecision(3)<<gaslawPressure<<" atm"
#include <iomanip>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
//
//HERE IS THE ISSUE
//set precision to 3 decimals
auto gaslawPressure = 1.641;
auto pointDistance = 30.017;
cout<<fixed;
//printing the final pressure of the gas
cout <<setw(20)<<left<<setfill('.')<<"Equation #01"<<setw(30)<<left<<setfill(' ')<<"Ideal Gas Law(Chemistry)"<<setw(3)<<left<<setfill(' ')<<":"<<setw(5)<<std::left<<setprecision(3)<<gaslawPressure<<" atm"<<endl;
//printing the calculated distance
cout <<std::left<<setw(20)<<left<<setfill('.')<<"Equation #02"<<setw(30)<<left<<setfill(' ')<<"Distance Formula(Math)"<<setw(3)<<left<<setfill(' ')<<":"<<setw(5)<<setprecision(3)<<pointDistance<<endl;
return 0;
}
выход
Equation #01........Ideal Gas Law(Chemistry) : 1.641 atm
Equation #02........Distance Formula(Math) : 30.017
Program ended with exit code: 0