My code works perfectly at first, it asks for your name and then your age, but after that it asks for the name and age of the mother at the same time and does not let you input the name. After that it does the same thing for the fathers name. Any help would be much appreciated, I am new to c++ and using getline so any information would be much appreciated.
#include <iostream>
#include <string>
int main()
{
std::string your_fullname;
int yourage;
std::string moms_fullname;
int momsage;
std::string dads_fullname;
int dadsage;
std::cout << "Hello, what is your full name?" << std::endl;
std::getline(std::cin, your_fullname);
std::cout << "And how old are you?" << std::endl;
std::cin >> yourage;
std::cout << "What is your Mothers name?" << std::endl;
std::getline(std::cin, moms_fullname);
std::cout << "And how old is she?" << std::endl;
std::cin >> momsage;
std::cout << "What is your Fathers name?" << std::endl;
std::getline(std::cin,dads_fullname);
std::cout << "And how old is he?" << std::endl;
std::cin>> dadsage;
std::cout << "Hello " << your_fullname << ". You are " << yourage << " years old. You have a mom named " << moms_fullname << "who is " << momsage << " years old and a dad named " << dads_fullname <<
" and is " << dadsage << " years old.";
return 0;
}