Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
C++ help
Reply
Posted 2007-04-23, 11:19 AM
I got a c++ help. this my assignment i have to make two enumerated data type private variable that will store the name of a color.
two constructor one accepts no formal parameters and sets the flag colors to red and white.
second constructor accepts two formal parameters of the enumerated data type and sets the colors accordingly.
two public member function to set the colors of the flag
one function accepts two formal parameters enumerated data typs both colors.
two function accepts two formal parameters at least one enumerated using the first parameters as the color to set and second parameter as which color the first or second is to be modified.
the member function should be named SetFlagColors.
A third public member function that accepts two formal parameters and returns the currents colors of the flag in the variables passed in. use pass by reference to set values in the variables.
this member function should be named GetFlagColors.
in the main function put the appropriate code in place to decode and display to the user the current colors of the flag.
create two objects of the flag class, using each of the constructors and make the colors of the second object blue and gold.
use both member function to change the colors.

don't understand that shit because my english are bad. ok this what i have so far.

#include <iostream.h>

class flag
{
private:

enum name {blue, green};
enum name1 { orange, black};

flag( red,white);

public:

void Func1;

};

flag::flag()
{

color= (Red, White);
};
flag::flag()
{
const1= blue;
const2= black;
};

public:

void SetFlagColors
Old
Profile PM WWW Search
osmoses-jones is neither ape nor machine; has so far settled for the in-betweenosmoses-jones is neither ape nor machine; has so far settled for the in-between
 
osmoses-jones
 



 
Reply
Posted 2007-04-23, 11:51 AM in reply to osmoses-jones's post "C++ help"
this what i got so far change it around last code.
#include <iostream.h>

class flag
{
private:
enum color1 {orange, green};
enum color2 {gray, brown};

public:

kconst();
kconst(enum color1,enum color2);
kconst1();
};

flag::kconst1(void)
{
enum color1 { red};
enum color2 {white};

}
Old
Profile PM WWW Search
osmoses-jones is neither ape nor machine; has so far settled for the in-betweenosmoses-jones is neither ape nor machine; has so far settled for the in-between
 
osmoses-jones
 



 
Reply
Posted 2007-04-23, 12:23 PM in reply to osmoses-jones's post starting "this what i got so far change it around..."
*sigh*
Code:
enum colors{
  red,
  orange,
  yellow,
  green,
  cyan,
  blue,
  magenta,
  white,
  black,
  gold,
  purple
};

class flag{
  public:
  flag();
  flag(colors color1,colors color2);
  void SetFlagColors(colors color1,colors color2);
  void SetFlagColors(colors color,int whichColor);
  void GetFlagColors(colors& color1,colors& color2);
  private:
  colors m_color1;
  colors m_color2;
};
There's the declarations. I'm not going to do your whole assignment for you, however.
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:11 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.