wont compile



#include "stdafx.h"
//#include "Cube.h"
//#include <iostream>

//using namespace std;

// ============
// Constructors
// ============

// ========================
// Default Constructor Cube
// ========================
Cube::Cube(void) {

edgeLength = 0;

} // Constructor Cube
// ======================

// ================================
// Non-Default Constructor Number()
// ================================
Cube::Cube(double x){

edgeLength = x;

} // Constructor Cube
// ======================

// ================
// End Constructors
// ================

// ================
// Destructor ~Cube
// ================
Cube::~Cube(void){


} // Destructor
// ===============

// ==============
// End Destructor
// ==============

// =================
// Member-Functions
// =================

// =======================
double Cube::GetEdge(){

return edgeLength;

} // Functon Get EdgeLength
// ===========================



// ======================
// Mutator Function Set()
// ===========================
void Cube::Set(double x){

edgeLength = x;


}// Mutator Function Set
// ========================

// ======================
// Member-Function Output
// ============================
void Cube::OutputSurface(){

cout << edgeLength << endl;
cout << endl;

} // Member Function Output
// ===========================

// ==============================
// Member-Function Surface (cube)
// ==============================
void Cube::Surface(Cube A){


edgeLength = 6 * (A.GetEdge() * A.GetEdge());

} // Function Square Area
// =======================

// =============================
// Member Function Volume (Cube)
// =============================
void Cube::Volume(Cube X){


edgeLength = X.GetEdge() * 3;

}// Function Circle Area
// ========================

// ====================
// End Member Functions
// ====================




Cube.h ====>

#pragma once
#include "stdafx.h"

class Cube {

public:


// ============
// Constructors
// ============
Cube(void);
Cube(double);
// =============

~Cube();

// =========
// Functions
// ======================
double Cube::GetEdge();
void Cube::Set(double);
void Cube::OutputSurface();
void Cube::OutputVolume();
void Cube::Surface(Cube);
void Cube::Volume(Cube);
// ==========================

// ========================
// Private Member Functions
// ========================

private:

double edgeLength;

}; // Class Cube
// =================





MenuClass.cpp
// MenuClass.cpp

#include "stdafx.h"
// #include <iostream>
// #include <string>


// using namespace std;

// ============
// Constructors
// ============

// ===================
// Default Constructor
// ===========================
MenuClass::MenuClass(void){

userMenuSelection = Quit;

} // Constructor Menu
// =======================

// ================
// End Constructors
// ================

// ==========
// Destructor
// ================================
MenuClass::~MenuClass(void){

// cout << "Destructor ~Menu invoked." << endl;

}// Destructor ~Menu
// ====================

/// ==============
// End Destructor
// ==============

// ================
// Member-Functions
// ================

// ==============================
// Accessor Member-Function Get()
// ==============================
MenuChoices MenuClass::Get(){

return userMenuSelection;

} // Accessor Method Get
// =========================

// =============================
// Mutator Member-Function Set()
// ===================================
void MenuClass::Set(MenuChoices newValue){

userMenuSelection = newValue;

} // Mutator Method Set
// ========================

// =========================
// Member-Function Display()
// =========================
void MenuClass::Display(){

cout << endl;
cout << "**************************************************************" << endl;
cout << "* 1: Change Edge Length 2: Output Surface Area *" << endl;
cout << "* 3: Output Volume 4: Quit *" << endl;
cout << "**************************************************************" << endl;

}// Member-Function Display
// ===========================

// =========================
// Member-Function QueryUser
// ============================
void MenuClass::QueryUser(){

int selection;

cout << "Enter Menu Selection: ";
cin >> selection;

switch (selection){

case 1: userMenuSelection = GetEdge;
break;

case 2: userMenuSelection = OutputSurface;
break;

case 3: userMenuSelection = OutputVolume;
break;

case 4: userMenuSelection = Quit;
break;

default: userMenuSelection = Quit;


cout << endl;

} // Method QueryUser()
// =======================

// ===============
// Method Continue
// ===========================
bool MenuClass::ContinueA(){

return userMenuSelection != Quit;

} // Method continue
// ====================

// ==============================
// Member-Function ProcessCommand
// ==================================
void MenuClass::ProcessCommand(){

int numA;
Cube numberA;
double orginalNum;

if (userMenuSelection != Quit){

// =====
// Input
// ===========================================
cout << endl << "Enter an integer value: ";
cin >> numA;
numberA.Set(numA);

// Input
// ==========

// ============================
switch (userMenuSelection) {

case GetEdge:

orginalNum = numberA.GetEdge();

cout << orginalNum;
break;

case OutputSurface:

orginalNum = numberA.GetEdge();

cout << "Your surface area is: "
<< orginalNum
<< endl;

break;

case OutputVolume:

orginalNum = numberA.GetEdge();

cout << "Your volume is: " << orginalNum << endl;
break;

case Quit:
break;

default: cout << "Warning: error state encountered." << endl;

} // Switch
// ===========


cout << endl;

} // then

} // Method ProcessCommand()
// ============================

// ====================
// End Member-Functions
// ====================


MenuClass.h ===>

// MenuClass.h

#pragma once

// ================
// enumerated types
// ================================================================
enum MenuChoices { GetEdge, OutputSurface, OutputVolume, Quit };
// ================================================================



// ===============
// File Inclusions
// =================
#include <string>
// =================

// ====================
using namespace std;
// ====================

// ===================
class MenuClass {

public:

// ============
// Constructors
// ================
MenuClass(void);
// ================

// ==========
// Destructor
// =================
~MenuClass(void);
// =================

// ==========================
// Member-Function Prototypes
// ==========================
MenuChoices MenuClass::Get(); // Accessor
void MenuClass::Set(MenuChoices); // Mutator
void MenuClass::Display();
void MenuClass::QueryUser();
bool MenuClass::ContinueA();
void MenuClass::ProcessCommand();
// ================================================

private:

// ================
// Member-Variables
// ==============================
MenuChoices userMenuSelection;
// ==============================

}; // Class MenuClass
// =====================


MD.cpp===>

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

#include "stdafx.h"
#include "MenuClass.h"

// ============
int main() {

// ================================
// Variable and Object Declarations
// ================================
MenuClass menu;
// ===============
do {
menu.Display();
menu.QueryUser();
menu.ProcessCommand();

} while (menu.ContinueA()); //Do While Loop
// ============================================

return 0;

}// Main Function
// =================


stdafx.h ===>
#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
using namespace std;

// ================
// Class Inclusions
// ================
#include "Cube.h"
#include "MenuClass.h"
// ======================







for some reason it is is not compailing. i could use some help if there is any !
What error messages are you getting?
In MenuClass::QueryUser, you're missing a } to terminate your switch statement.

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Topic archived. No new replies allowed.