I need to create two enumerations, one for the months in the year and the other for birthstones.
Make a function named getBirthStone that returns the birthstone based on the month.
Jan-garnet
Feb-amethyst
Mar-aquamarine
Apr-diamond
May-emerald
June-pearl
July-ruby
Aug-peridot
Sep-sapphire
Oct-opal
Nov-topaz
Dec-turquoise
Add code to call the function when the user selects the display information option.
Include a menu item to the main menu to display all birth stones. Add code to call getBirthstone for each month.
I have started the assignment, but I'm not quite sure what I'm doing wrong. Any help is highly appreciated!!
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
Bstone::Bstone ( string ); // consructor intializes Bstone with string supplied as argument
int main()
{
int name; //the user's name
int Bday; //the user's birthday
//prompting the user for their name
cout << "Please enter your name:\n ";
cin >> name;
//prompting user for their birthday
cout << "Please enter your birthday:\n ";
cin >> Bday;
//prompting the user to select one of the following.
cout << "Please select the following, which you want to display:\n ";
//beginning of the switch statement.
switch (Useroptions)
{
case 1: //displaying the user's birthstone.
cout << "Here is " << name << " birthstone \n";
cout << "His birthday is " << Bday;
break;
case 2: //displaying the user's astrogical sign.
cout << name << " astrogical sign is " << ....;
break;
case 3: //displaying the season of which the user's birthday occurs in.
cout << " The season in which " << name << " birthday occurs " << "....";
break;
default;
}
char Months, BirthStone; // Months and Birthstones of the potential users
// enumeration declaration for months
enum Months { Jan = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC };
// enumeration declaration for birthstones
enum BirthStone { GARNET = 1, AMETHYST, AQUAMARINE, DIAMOND, EMERALD, PERAL, RUBY, PERIDOT, SAPPHIRE, OPAL, TOPAZ, TURQUOISE };
string Bstone::getBirthStone()
{
return Birthstone;
} //end function getbirthstone
return 0;
}