51,593 Topics

Member Avatar for
Member Avatar for JayseR

I'm trying this new project, like this. Write a program which will use functions to compute the distance between 2 points on a plane given their coordinates. If one point is located at (x1,y1) and the other is located at (x2,y2) then the formula for computing the distance is sqrt(sqr(x2-x1) …

Member Avatar for JayseR
0
522
Member Avatar for Fasola

In all my classes never taught us how to us C++ I still don't know how to [I]put it to use[/I] My professors taught us how to write it, but now how to use it every program we wrote would excute some programming by inputing data or outputing data on …

Member Avatar for Fasola
0
316
Member Avatar for tyczj

how do you write exponents in c++ i though it was "exp (#)" afterthe variable am i right?

Member Avatar for Narue
0
170
Member Avatar for Nauro

I'm currently writing a program and I want it to read in data from a source and if needed change some or all of it and re-write it to the same source file. I have: where all the variables are ints in a struct called date. ifstream ifs("data.txt"); ifs>>date.hours; ifs>>date.minutes; …

Member Avatar for Narue
0
296
Member Avatar for dallin

I have random numbers such as 1 6 8 5 7 3 9 2 4 in a 1 dimensional array what for loop do I use to reorder the numbers from 1 through 9? thanks.

Member Avatar for Narue
0
329
Member Avatar for iorisendoh

i have a sample program,can someone help to find the error of this program or someone to correct this program coz i don't know what is the error of this program this is the sample program of mine [code] #include<windows.h> #include<string.h> #include<strstrea.h> #include"mydialog.h" void main() { LONG FAR PASCAL _export …

Member Avatar for Tight_Coder_Ex
0
161
Member Avatar for hopeolicious

can someone help me to get my program to sort i have the logic but this is my first time doing a sort program and i cant get it to work can some tell me what i'm doing wrong [CODE]#include <iostream> #include <iomanip> using namespace std; void sort(); const int …

Member Avatar for Gnome_101
0
123
Member Avatar for F50

This seems like a simple task but the microsoft visual c++ 6.0 compiler is giving me a problem with this. Its complaining about the lines where i try to use a passed array such as "fin[i]=0". Its giving this error for the following code. "error C2109: subscript requires array or …

Member Avatar for Tight_Coder_Ex
0
182
Member Avatar for xfruan

How can i create a directory in c++ other than writing [CODE]system ("md directory");[/CODE]

Member Avatar for Tight_Coder_Ex
0
227
Member Avatar for xfruan

Hello, i'm a novice who have some ideas of the basic concepts and some advanced topics like templates and exception handling. I now want to improve my programming skills. I would very appreciate if anyone could recommend some good books to me. :)

Member Avatar for xfruan
0
182
Member Avatar for hopeolicious

Can someone help me to output each array element [CODE]#include <iostream.h> void array(); const int LIMIT = 50; float MYARRAY[LIMIT]; float value = 0; int x; void main() { for(x=0;x<LIMIT;x++) { while(value < 999) { cout << "\n\nPlease enter a number: "; cin >> MYARRAY[x]; value = value + MYARRAY[x]; …

Member Avatar for Acidburn
0
133
Member Avatar for shock1

Given the integer variables x , y , and z , write a fragment of code that assigns the smallest of x , y , and z to another integer variable named min . Assume that all the variables have already been declared and that x , y , and …

Member Avatar for Acidburn
0
91
Member Avatar for Iamhere

cout<<"how many slots are there?: "<<endl; cin>>s ; cout<<"Please enter\t" <<n<<" " "size of each slot"<<endl; j=k; for(int counter1=0; counter1<krfd; counter1++) { cin>>job_size[k]; }

Member Avatar for Narue
0
107
Member Avatar for Iamhere

cout<<"how many slots are there?: "<<endl; cin>>s ; cout<<"Please enter\t" <<n<<" " "size of each slot"<<endl; s=k; for(int counter1=0; counter1<krfd; counter1++) { cin>>slot_size[k];//this suppose to print out #size of each slot where there is s # of slots and how would I name each slot according to the number of …

Member Avatar for Narue
0
99
Member Avatar for hopeolicious

Can someone help me to output the numbers in the array that are user inputted and sort them in ascending order please this is the code i've come up with so far it .... prompts the user no less then 50 elements and a value no more than 999 it …

Member Avatar for Narue
0
109
Member Avatar for trevs234

im a beginner game game programer with C++ but i dont understand how to use a game engine so if someone could help me by giving tips or website with free info on this topic that would be great.

Member Avatar for Narue
0
104
Member Avatar for Chadmo

Aloha, I am trying to add some basic error checking to my program. I have it only accepting the correct numbers (Positive) but when a 'char' is entered, it displays my message infinately. Any ideas? cout << "For DEBUG information press 1, to omit, press 0:"; cin >> DEBUG; if …

Member Avatar for Narue
0
104
Member Avatar for tat2dlady

Does anyone know how to compare a old style character string with a character in qoutes? Example: I want to compare the first character in a record that is stored in an old style character string with a `*`. Here's what I have in my code: char FirstCharacter[1]; // Character …

Member Avatar for tat2dlady
0
124
Member Avatar for dallin

I'm stuck, I have a base class String, derived class Pstring, and trying to develop another derived class Pstring2. Pstring2 needs a function called left. Main will call the function by Text.left(Text1,N) // Text2 is assigned the leftmost N characters from Text1. I'm having a hard time understanding how to …

Member Avatar for dallin
0
93
Member Avatar for bluegoo06

i have to define a function that tests number from 2 to 10000 to see if they are prime. heres what i have so far. [code] #include <iostream> #include <iomanip> using namespace std; bool find_prime(int); int main () { int i, counter =0; bool test; for (i =2; i <= …

Member Avatar for samarth
0
94
Member Avatar for new comer

hi i have just got my self a Borland 4.5 from ebay and would like some help in using it. i am very new to programing and i would like to be able to put a shoping cart on my website but i know nothing about it all help very …

Member Avatar for vegaseat
0
154
Member Avatar for xfruan

I wanna create an array whose size would be determined by a variable, but i when i write the following, i got an error int main () { int a; std::cin >> a; int intArray [a]; return 0; } the error is "an constant expected".

Member Avatar for Narue
0
109
Member Avatar for trevs234

in a book there is a code that i am trying out and my compiler keeps giving me diferent errors (compiler is Borland C++) and i dont know how to fix them. the code is [code] //----------------------------------------------------------------- // Skeleton Application // C++ Source - Skeleton.cpp //----------------------------------------------------------------- //----------------------------------------------------------------- // Include Files …

Member Avatar for vegaseat
0
161
Member Avatar for Maple_Tiger

Yes - I'm a noob. :rolleyes: I just wanted to be 100% sure that I understand what a parameter is before I go on lol. [Code] #include <iostream> //header of function? int Add (int x, int y) { using std::cout; //Parameters x and y? cout << "In Add(), received " …

Member Avatar for Dave Sinkula
0
77
Member Avatar for Maple_Tiger

In this book I'm using, Sams Teach your self C++, it says to: Start compiler, choose file, choose Win32 Console Application, choose empty project, choose C++ source file, edit source code, choose build, check that you have know build errors and run the program. Whats the difference betweeen Build and …

Member Avatar for Maple_Tiger
0
177
Member Avatar for arikeri

Iam reading in a 4row 3column table. Iam refering to char_function[4][3] in the following code.This is a part of a larger program. You can neglect all other things and look at char_function my aim is to print it out [code]#include<iostream> using namespace std; int N, Q, M;//number of user inputs, …

Member Avatar for Dave Sinkula
0
202
Member Avatar for xfruan

There used to be a a clrscr () function in conio.h include file which clears the screen, but this function is not in the conio.h file in visual C++ 6. How can i clear the screen without clrscr()?

Member Avatar for Narue
0
122
Member Avatar for trevs234

I am new to programming in any language and right now i am using C++. im having trouble getting started with programming because i dont know how to use code together very well to create my own programs if anyone would refer some book or website or just give some …

Member Avatar for trevs234
0
115
Member Avatar for tyczj

ok so im taking a class at school and we have a lab that i am stuck on. "the program must read in an inventory list of items at a small retail store." i have most of it but im stuck on getting a discount price and having it line …

Member Avatar for OurNation
0
156
Member Avatar for yonoid

How can I use the Checkboxes of a Tree Control in Visual C++ 6, I add it in properties but I don't know how to program de detection of the click over the checkbox. The idea is that the user can make multiple selections, in order to store every item …

Member Avatar for Stack Overflow
0
150
Member Avatar for dani1982

i am suppossed to write a program using an array of strings to hold the words of the ICAO alphabet, and index the array by the positions of the letters of the alphabet. I started it off but cannot figure it out please help!! #include <iostream> const int n_row=26; const …

Member Avatar for Tight_Coder_Ex
0
239
Member Avatar for shonenhype

Hey, I am in a beginning C++/C# Class and we are jsut starting the Math LIbrary. I need to write a program that displays all perfect integers up to 100. I am required to write a boolean function, IsPerfect(), to use in the program. My problem is I was either …

Member Avatar for Dave Sinkula
0
182
Member Avatar for yni420

Hi I am in the process of developing a series of tutorial cds for programming and web designing like C C++ Java html etc My first Cd is on C programming languages I need feedback 1) Completely flash based or completely html based...... if a combo of both which more …

Member Avatar for william_stam
0
148
Member Avatar for tat2dlady

I am trying to create a random access file from a sequential file. I have the random access file skeletonized with "dummy records". An example of my dummy record is: 100 *********ZZZZZZZZZZXXXXXXXXXXYYYYYYYYYYYYYYYYYYYY00.00 -1 *********ZZZZZZZZZZXXXXXXXXXXYYYYYYYYYYYYYYYYYYYY00.00 -1 The "*'s" are a SSN, "Z's" are the last name, etc, etc. The 100 and …

Member Avatar for Tight_Coder_Ex
0
137
Member Avatar for ashjoy

[FONT=Arial]undefined[/FONT] hi.!! guyzzz.... i am an eng'g student.. nyways... im using turbo c++ 4.5, i cnt run programs that is in graphics mode :confused: ... it tells that it didnt support a BGI..(graphics.h)... can you suggest me on how to solve my problem??? PLEASE???? :sad: hope you could help me …

Member Avatar for Narue
0
67
Member Avatar for Almost a GURU

I am using VC++6.0 I am attempting to implement the TEA for a Oracle server. I am plannng to write the algorithm in C++(C), then add it to a shared library. I am new with C++ and I am having some difficlulty, mainly in two basic areas: 1. I want …

Member Avatar for Almost a GURU
0
85
Member Avatar for Iamhere

Hi ppl I would really appreciate if someone help me out here. I really tried to do this problem and its driving me crazy. All I could get is the algorithum of worst fit, best-fit next fit and first fit. Please help me as soon as I can. And I …

Member Avatar for Iamhere
0
178
Member Avatar for roscioeak@direc

I posted earlier for help with this and someone gave me a good clue and I worked with it but I am still boggled. I have been working on a couple different ways to accomplish this but have come up with nothing right yet. I am close but still need …

Member Avatar for Narue
0
134
Member Avatar for tat2dlady

Can anyone tell me how to compare a string to an integer? I have a SSN stored as a string, SSN[10]. I need to compare each number in the SSN. What I need to do is to add up the ASCII values of the SSN to use for a hashing …

Member Avatar for tat2dlady
0
105
Member Avatar for dal4488

I'm not understanding the error I'm getting. #include <iostream> using namespace std; const double rServiceCost = 10.00; const double rPerMinuteCharge = .20; const double pServiceCost = 25.00; const double pDayPerMinuteCharge = .10; const double pNightPerMinuteCharge = .05; int main() { int minutes; int dayMinutes; int nightMinutes; double dayMinuteCharge; double nightMinuteCharge; …

Member Avatar for dal4488
0
92
Member Avatar for letmec
Member Avatar for Narue
0
81
Member Avatar for Acidburn

[php] #include <iostream> #include <cmath> using namespace std; class point { public: point(int xcoord , int ycoord); //constructor point(); int getX(); int getY(); double getDistance( point otherPoint ); void setpnt(point p); private: int x, y; }; class rectangle { public: rectangle(point p1, point p2, point p3, point p4); void perimeter(); …

Member Avatar for Narue
1
182
Member Avatar for firion

hi administrator, I'm a beginner in c++.I need to draw a graph(x vs y type).I used graphics.h and ended up with a very primitive version of a graph.The graph appears like a scribbling in the top left corner of the screen.I don't know how to draw the x and y …

Member Avatar for vegaseat
0
103
Member Avatar for TOG85

Hello i'm very new to programming and self teaching myself. I'm having a problem with my project. I'm trying to preform an equation, but every time I in put the variable it runs to the end. It is a programm to help solve precents for my friend. This is the …

Member Avatar for Narue
0
90
Member Avatar for arikeri

consider this for [code]int i.j; for (i=0;i<=5;i++){ for (j=i+1;j<=5;j++){cout<<"\n"<<i<<"\t"<<j<<"\n"; } }[/code] now suppose we have[code]list<string>::iterator l,m;[/code] the corresponding thing[code] for (l=0;l<=5;l++){ for (k=l+1;k<=5;k++){cout<<"\n"<<i<<"\t"<<j<<"\n"; } }[/code] won't work because "l+1" is meaningless here. How do I solve this problem?

Member Avatar for Narue
0
70
Member Avatar for arikeri

As a part of a larger problem I have to solve the following:: *input - number of variables (say n=4) *input - 'n' numbers in decimal (say 1,3,5,7) *I need to check for all the grey code neighbours i.e, to say, 2=00000001(a fixed length string) and 3=00000011(a fixed length string) …

Member Avatar for arikeri
0
212
Member Avatar for dal4488

Here's what I have so far and here's my response from my teacher. I'm not exactly sure what or where the problem is. Anyone else see it? Have you run this project with many different test cases, and does it work? At first glance, it seems to me that the …

Member Avatar for Narue
0
124
Member Avatar for roscioeak@direc

I am trying to make this queue right now that uses elements in an array to increase the appointment time for a queue. Only problem is I don't really know how to get each individual element from the array to add it to the queue. I thought I could just …

Member Avatar for Narue
0
138
Member Avatar for tchampion22

i am curently attending college and i don't know how to start this assignment i was givin: while spending the summer as a surveyor's assistant you decide to write a program that transforms compass headings in degrees ( 0 to 360 ) to compass bearings. using only one decimal place. …

Member Avatar for maj0nes
0
664
Member Avatar for dal4488

I'm trying to write a code that calculates a cell phone bill. There are two different services: a regular service that is $10.00 and the first 50 minutes are free and charges over 50 minutes are $.20 per minute and the other a premium service that's $25 and the first …

Member Avatar for Narue
0
160

The End.