Q:

c++ dice game simulate rolling two dices

I'm a c++ beginner, I need to create a dice game simulate rolling two dices. I'm quite confused with using the header file. But first of all, why do I need to return the no.of face of the dice? Second of all, what does the int roll function do? To reset the values and faces ? If so, what is the default value? And the last function Dice(int n), do I use this function to control the maximum sum of dice values?  The function must have a class header file with these functions:
class Dice{

private:
    int face;    // no. of faces of the dice
    int value;    // the face-value that shows up

public:
    int getFace()// returns the no. of face of the dice
    {
    };

    int getVal()
    {
        int dice1;
        int dice2;
        dice1 = rand() % 6 + 1;
        dice2 = rand() % 6 + 1;
    };    // returns the face value that shows up

    int roll();     // simulate the roll pf the dice, the  value field is set  and  returned.
    Dice();   // default constructor , a standard six-face dice is created with value = 1
    Dice(int size);  // create a dice of given size

};

A:

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;
}

