Hopefully this answers your questions in order:
The only reason I can see for returning the number of faces of each dice is to inform the user which dice is currently being rolled. I've shown an example of this in my code below where I have dOne.getFaces() and dTwo.getFaces().
The int roll() function and getVal() were supposed to be the same thing I'm assuming. I've gone ahead and removed getVal() and just used roll() instead.
Dice() and Dice(int size) are just initializing the number of faces for each dice. A default dice will have 6 faces, but the user can roll a dice with more than 6, hence the int size.
#include <iostream>
#include <cstdlib>
#include <time.h>
class Dice
{
private:
int faces; // no. of faces of the dice
int value; // the face-value that shows up
public:
int getFaces() {return faces;} // returns the no. of faces of the dice
int roll() // returns the face value that shows up
{
value = rand() % faces + 1;
return value;
}
Dice() : faces(6) {}; // default constructor, create a dice of standard size
Dice(int size) : faces(size) {}; // create a dice of given size
};
int main()
{
srand( time(NULL) ); // Initialize random seed
char yesNo;
std::cout << "\nWould you like to roll two normal dice? (y/n)\n";
std::cin >> yesNo;
if ( yesNo == 'y' )
{
Dice dOne, dTwo;
std::cout << "\nA dice with " << dOne.getFaces() << " faces rolled: " << dOne.roll() << '\n';
std::cout << "A dice with " << dTwo.getFaces() << " faces rolled: " << dTwo.roll() << '\n';
}
else
{
int dFaces;
std::cout << "\nHow many faces would you like each dice to have?\n\n";
std::cout << "Dice 1: ";
std::cin >> dFaces;
Dice dOne(dFaces);
std::cout << "Dice 2: ";
std::cin >> dFaces;
Dice dTwo(dFaces);
std::cout << "\nA dice with " << dOne.getFaces() << " faces rolled: " << dOne.roll() << '\n';
std::cout << "A dice with " << dTwo.getFaces() << " faces rolled: " << dTwo.roll() << '\n';
}
return 0;
}