Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 131,991 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,033 people online right now. Registration is fast and FREE... Join Now!




need Help With Functions Plz goin crazy

 
Reply to this topicStart new topic

need Help With Functions Plz goin crazy, don need answers just need guidance

Flash0429
post 8 May, 2007 - 08:20 AM
Post #1


New D.I.C Head

*
Joined: 8 May, 2007
Posts: 15


My Contributions


i need help i have a program i have to create called birthday profile i was able to do the first part but im stuck on the next part we had to creat an enumeration for the month of the year wich i did and an enimeration for the birthstones wich i did but than it says to add a function named getbirthstone that returns the birtstone based on the month using the following birthstones:
January--garnet
Febuary--amethyst
March--aquamarine
April--diamond
May--emerald
June--Pearl
July--ruby
August--peridot
September--sapphire
October--opal
November--topaz
December--turquoise

then it says to add code to call the function when the user selects the Display Information option. for now, hard code the month in the function call to your birth month. add a menu item to the main menu to display all birthstones. add code to call getbirthstone for each month.

im not sure how to do any of this here is my header file:
CODE

//enumerations
enum month { January, Febuary, March, April, May, June, July, August, September, October, November, December };
enum birthstone { garnet, amethyst, aquamarine, diamond, emerald, pearl, ruby, peridot, sapphire, opal, topaz, turquoise };

//functions
birthstone getbirthstone();
void mainMenu()


and here is my .cpp file
CODE

// BirthdayInfo.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "BirthdayInfo.h"

#include <string>

#include <iostream>

using namespace std;

int menu;
string name;
string space (6, ' ');

char diamonds = 4;




void mainMenu()
{
    system ("cls");
    cout << "Hello, " << name << "\n" << endl;
    
    int x=1;
    int y=1;

    while (x<=5)
    {
        cout << space << diamonds;
        x=x+1;
    }
    x=1;

    cout << "\n\n****************Main Menu****************" << endl;
    cout << "1) Display Information\n" << "2)\n" << endl;

    while (x<=5)
    {
        cout << space << diamonds;
        x=x+1;
    }

    cout << "\n";
    cin >> menu;

    
}




int _tmain(int argc, _TCHAR* argv[])
{
    cout << "What is your name?" << endl;
    getline (cin, name, '\n');
    mainMenu();
    return 0;
}


if someone can help me with any of this i would greatly appreciate it thx i dont need someone to give me the entire thing i just need some one to steer me in the right path to help me out a bit thx

This post has been edited by Flash0429: 8 May, 2007 - 04:34 PM
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/21/08 03:45AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month