I have a homework assignment that I'm stuck on...i have to make a program that works like text messaging on a cell phone. It uses three classes, keypad, display, and texter.
keypad - is the keypad. it allows the user to enter all alpha-numeric characters. the class handles input. it can include cin statements (like cin.getine) but no cout statements
display - it simulates a display on the texting device. It is responsible for the output and can only contain cout statments
texter - it's the "brain" It is responsible for orgainizng functions of the keypad and display classes so the user can send texts. the class should have one member variable which is a keyboard object and one member variable that's a display object. It is supposed to call functions on the objects to facilitate texting. This class should have no cin or cout statements
The code in main only does three things:
Declare a Texter object
Call a "menu" method on the Texter object
At the end of main, return 0
The texter screen should look like this:
Main Menu:
1. send Text Message
2. Turn off
Input your choice:
If the user chooses 1, the Texter should show
Input phone number: 1234567(the input)
Input Message: Hey! (the input)
Message sent successfully.
(Print main until the user chooses the second option)
Here is my code thus far:
// keypad.h
#include <string>
using namespace std;
class keypad
{
private:
long int number;
string message;
public:
long int InputNumber();
string InputMessage();
};
// keypad.cpp
#include “keypad.h”
#include <string>
using namespace std;
long int keypad::InputNumber()
{
cin >> number;
return number;
}
string keypad::InputMessage()
{
cin >> message;
return message;
}
// display.h
#include <string>
#include “keypad.h”
#include “keypad.cpp”
using namespace std;
class display
{
private:
long int number;
string message;
public:
void InputPhone();
void InputMessage();
};
// display.cpp
#include “keypad.h”
#include “keypad.cpp”
#include <string>
void display::InputPhone()
{
cout << “Input phone number: “;
}
void display::InputMessage()
{
cout << “Enter your message: “;
}
// text.h
#include “display.h”
#include “display.cpp”
#include “keypad.h”
#include “keypad.cpp”
class text
{
private:
public:
keypad key();
Display disp();
};
// text.cpp
#include “display.h”
#include “display.cpp”
#include “keypad.h”
#include “keypad.cpp”
#include “text.h”
void text::disp.InputPhone()
{
}
void text::key.InputNumber()
{
}
void text::disp.InputMessage()
{
}
void text::disp.InputPhone()
{
}
// textMain.cpp
#include “display.h”
#include “display.cpp”
#include “keypad.h”
#include “keypad.cpp”
#include <iostream>
using namespace std;
text Texter
* i haven't started main yet. I want to get my classes done first
* one question, which files should I include in my classes...i don't know if i should include all of the ones i did include or if i only need the .cpp files
*any help is greatly appreciated :)