49,761 Topics

Member Avatar for
Member Avatar for reyaanhelp

If anyone have "bus reservation system" c++ code in classes format then please give it to me.

Member Avatar for Salem
-1
65
Member Avatar for TheSilverFox

[code=CPP]#include <iostream> using std::cout; using std::cin; using std::endl; void Calculate( double ); int main() { int worked; double salary; double pay; cout << "Enter the hours worked: (-1 to end)" << endl; cin >> worked; cout << "Enter the salary: " << endl; cin >> salary; while( worked > 0 …

Member Avatar for csurfer
1
103
Member Avatar for doublebond

Hi Guys, Please help me in doing this. I am trying to read a file using fstream, but my prof wants me to do the same using hash table, which i have know idea. Please tell me hw can i do the same. The file contains huge data like the …

Member Avatar for csurfer
0
995
Member Avatar for Cloneminds

Hello again, My assignment is to calculate a 10% bonus based on sales figures. I have to use a main() function, obviously, and 3 void functions, getSales(), calcBonus(), and displayBonus(). I'm pretty sure I have the functions coded correctly, I'm just having some issues getting them to actually run correctly …

Member Avatar for wildgoose
0
224
Member Avatar for slomad1956

I've searched for days on how to find the correct way to convert a string to a float and then double the user entry. Any help would be appreciated. Thanks. #include <iostream> #include <cstdlib> using namespace std; bool FloatInput(char []); void main() { float floatValue; char buffer[100]; bool validInput; do …

Member Avatar for slomad1956
0
123
Member Avatar for reyaanhelp

[code] #include <conio.h> #include <stdio.h> #include <iostream.h> #include <string.h> #include <graphics.h> #include <stdlib.h> #include <ctype.h> //#include <dos.h> typedef enum{false,true}boolean; static int p = 0; class a { char busn[5], driver[10], arrival[5], depart[5], from[10], to[10], seat[8][4][10]; public: void install(); void allotment(); void empty(); void show(); void avail(); void position(int i); } …

Member Avatar for csurfer
0
454
Member Avatar for Pokenerd

Hi, I'm working on a program to convert Celsius to Fahrenheit, but I have a problem when I run a check to make sure that input is not a letter. My problem is that if the user inputs a 0 it catches it with the [code=C++] if(num == 0) { …

Member Avatar for Pokenerd
0
102
Member Avatar for XodoX

Hello, I had to creat the following code that displays a table depending on the number te user entered. [code] int main() { int n = 0; const int base = 4; std::cout << "Enter max: "; std::cin >> n; std::cout << " "; for(int i = 1; i<= n; …

Member Avatar for NathanOliver
0
100
Member Avatar for Pokenerd

Hi, I'm looking for some help with this short program I am writing... I'm trying to make the sure that the user enters a number when it asks for the temperature in Celsius, and when the user enters a number it works. However if a letter is entered it all …

Member Avatar for Pokenerd
0
176
Member Avatar for somyasinha

Hi, How do I use the generator in the file? I keep randomc.h as a header file in the Visual c++ project. My project has several header files and several .cpp files, many of which require to use the random no. generator. I have copied all the files in the …

Member Avatar for u8sand
0
137
Member Avatar for goody11

I've tried like 100 different ways but I can't figure this out. I need each of these variables initialized and defined before they are used. Here is the bit of code: [code] int i, a; char etxt[100]; HWND hwndListBox = GetDlgItem(hEdit, IDC_LIST); i = SendMessage(hwndListBox, LB_GETCOUNT, 0, 0); //gets the …

Member Avatar for NathanOliver
0
128
Member Avatar for Pokenerd

Hello! I'm trying to make a command line program that converts Celsius to Fahrenheit, and then asks if you would like to convert another number. This is the code I have (below) however when it gets to the point of asking if you would like to convert another number, no …

Member Avatar for wildgoose
0
118
Member Avatar for gretty

Hi I am trying to teach myself C++ windows programing, ie creating windows applications (is that GUI or API or neither :P). I know the fundamentals of C++ programming but looking at some windows code it looks really difficult. [B]Can you suggest any good books or maybe some tutorial sites …

Member Avatar for Ancient Dragon
0
234
Member Avatar for zeus1216gw

I know how to make random numbers. and How to make random numbers in a specific range. BUT!!! How can you display 'x' random numbers in a given range and make it so the output display lists the numbers in groups a 'y'. For example: I want to display 25 …

Member Avatar for csurfer
0
113
Member Avatar for Leila1
Member Avatar for Salem
0
440
Member Avatar for gergep

i am wondering how to create a gui that is something like wxWidgets. I know how to use the windows api and all of that so i am not asking how to create a button or edit box but really am asking how to create a pixel on the screen …

Member Avatar for tux4life
0
77
Member Avatar for whotookmyname

I have to open a file named "axb.txt" I have user input a and b as strings i have concatenated the string using string str = a + "x" + b+ ".txt" now i need to open the file. it does not open with fopen(str, ios::app) because str is not …

Member Avatar for whotookmyname
0
303
Member Avatar for _dragonwolf_

Okay, so I have my program almost complete. I can get it to do everything except use the computeAverage. I know it works because if I hard code the arrays, I can utilize that and it will work. However, I am having to utilize what I pull from a .txt …

Member Avatar for VernonDozier
0
252
Member Avatar for cooolguy

hi.. i need to read a file.. in tat file i ve to read all strings and compare it with the given string.. hw 2 read strings in file exculding whitespaces n compare it..? help me...!!!!

Member Avatar for cooolguy
0
74
Member Avatar for penguhooks

[code=cplusplus] #include<iostream.h> #include<conio.h> float si(int p,int r,int t) { return(float)(p*r*t)/100; } int main() { int p,r,t,s; cout<<"enter the p,r,t"; cin>>p>>r>>t; float s=si(p,r,t); cout<<"simple interest="<<s; } getch(); } [/code] iam new to c++ and i was going through UDF's when i pondered upon this problem of calculatin the simle interest ... …

Member Avatar for Tom Gunn
0
276
Member Avatar for Rodman2009

How did you disable the Unicode, I used the same program and get the same errors, I tried to disable the Unicode by going to the properties of the program, and unticked the inheritance, but I still get the errors?

Member Avatar for Nick Evan
0
148
Member Avatar for cplusplusfool

Hii Friends, I do not know how to use FILE for writing data. I have tried something but i missed something to write and i do not know what to write now to get data inside file. Help me plz. Regards, Shivi circle.cc [code=cplusplus] #include <iostream> #include "circle.h" using namespace …

Member Avatar for csurfer
0
144
Member Avatar for didijc

Hey C++ guru's... I'm pretty new to the C++ world and would really appreciate some help... ... I'm trying to build a general tree (a tree with one root and N children), I've written the code and compiled it quote/un-quote successfully... ...I say that because I am faced with a …

Member Avatar for Laiq Ahmed
0
1K
Member Avatar for Shaitan00

I'm trying to declare a std::map that is keyed by a char and has a function pointer as a second parameter, these functions would be a member function of my class. But for some odd reason I cannot call the functions when extracted... So, I have a class A as …

Member Avatar for Laiq Ahmed
0
2K
Member Avatar for silent prince

i need ur help to write c++ porgram... this is the topic of it """"" Write a C++ program that calculates the perimeter and area of simple geometrical shapes based on the user’s selection. Let the program handle the perimeter and area calculations for circles, and Parallelograms. The program should …

Member Avatar for jencas
0
144
Member Avatar for petry

Hi All: I have a large number of elements to be stored into vector or basic string(delimited by \n). I need to search for an element and I would like to know what is faster: A:[CODE]std::string str = "\nElement1\nElement2...element1000\n" str.find("\nElement3\n");[/CODE] B: [CODE]std::vector<string> v; v.push_back("Element1"); v.push_back("Element2"); .... std::find(v.begin(), v.end(), "Element3") != …

Member Avatar for jencas
0
1K
Member Avatar for ravenrider

HEY guys, I can't figure out why my code doesn't compile, I'm trying to read a text from a file, count the words. any help would be approciate it thanks [code] #include<iostream> #include<fstream> using namespace std; // global constants const int MAX_ROW = 150 ; const int MAX_COL = 80 …

Member Avatar for jencas
0
101
Member Avatar for ninjaneer

hi! I'm trying to get the following C++ class (contained in a DLL): [code] __declspec(dllexport) class ThreadManager { public: __declspec(dllexport) static UINT32 setThreadPriority(UINT32 tPriority); __declspec(dllexport) static UINT32 setPriorityClass(UINT32 pClass); __declspec(dllexport) static UINT32 setProcessorMask(UINT32 pAffinity); __declspec(dllexport) static UINT32 changeMATLABSeed(UINT32 inputSeed); static BOOL setHandles(HANDLE* thread, HANDLE* process); __declspec(dllexport) static BOOL testFun(UINT32 testInt); …

Member Avatar for Ramy Mahrous
0
1K
Member Avatar for squall1986

I was working on an assignment, and I had finished everything and was cleaning up the code by just adding some comments to it and everything, and when I tried to run it again afterwards, it came up with an error that said "Debug Assertion Failed!" It says "Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" …

Member Avatar for squall1986
0
113
Member Avatar for lancevo3

I have been working on this program for my class and I have everything working fine it seems up until I get my New Balance output. What I get for the output is below. Date Account Type Amount New Balance 06/19 9858-5420-3025-7452 P 5500.00 -2694.35 06/19 1111-1111-1111-1111 C 430.00 -2264.35 …

Member Avatar for lancevo3
0
135

The End.