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

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




Pizza Order system (some coding done)

 
Reply to this topicStart new topic

Pizza Order system (some coding done), Match phone number to address

ginobili
post 15 Dec, 2005 - 08:00 AM
Post #1


New D.I.C Head

*
Joined: 5 Nov, 2005
Posts: 46


My Contributions


Hello everyone,
I am working on an individual problem something that i might be able to use in a real work environment. I would like your advice concerning which programming language i should use i have an beginning level of knowledge in C++ but if you think the programm will be easier or more efficient in another language i am willing to learn.
The program basically should ask for the customer phone number and then prompt the name and address coresponding to the number. If no match is found it asks about the persons info phone, name, and address.

Any help and insight would be greatly appreciated.

Ginobili

[/CODE]
#include <iostream>

#include "Pizza.h"

using namespace std;


int main()
{
Pizza P;
cout << "Please enter phone number: " << endl;
cin >> P.setPhoneNumber();


cout << "The address is: "<< P.getAddress() << endl;



return 0;
}

class Pizza
{
public:
void setAddress();
void setName();
void setPhoneNumber();
char getAddress();
char getName();





private:
char Address;
char Name;
char PhoneNumber;

};

#include "Pizza.h"


char name, adr, phone;

void Pizza::setName()
{
Name = name;
}

void Pizza::setPhoneNumber()
{
PhoneNumber = phone;
}

void Pizza::setAddress()
{
Address = adr;
}

char Pizza::getName()
{
return name;
}

char Pizza::getAddress()
{
return adr;
}

This post has been edited by ginobili: 15 Dec, 2005 - 12:49 PM
User is offlineProfile CardPM

Go to the top of the page


Amadeus
post 15 Dec, 2005 - 08:04 AM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,163



Thanked 32 times

Dream Kudos: 25
My Contributions


C++ can certainly be used for this...virtually any language can. If you do it in C++, I'd suggest making a customer data structure, even a class, and having your information as data members, then implementing the methods required to search, input, etc...
User is online!Profile CardPM

Go to the top of the page

ginobili
post 15 Dec, 2005 - 08:10 AM
Post #3


New D.I.C Head

*
Joined: 5 Nov, 2005
Posts: 46


My Contributions


Hello Amadeus,
Good to hear from u again.
About that is what i had in mind using a Pizza class with data with public and private data members. One thing i have a problem with is how to store a string into a file in my computer ....

Any ideas?
Ginobili
User is offlineProfile CardPM

Go to the top of the page

Amorphous
post 15 Dec, 2005 - 08:38 AM
Post #4


New D.I.C Head

*
Joined: 10 Dec, 2005
Posts: 44



Thanked 1 times
My Contributions


If you want the database to be able to be connected from via the Internet so you don't need to download separate programs per user then you could use PHP.

use the file library of functions so you open a file with "fopen" I think use "fwrite" will write a string into it when you use ">>" to store it. I have to go to class now.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/20/08 06:55AM

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