51,593 Topics
![]() | |
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) … | |
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 … | |
how do you write exponents in c++ i though it was "exp (#)" afterthe variable am i right? | |
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; … | |
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. | |
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 … | |
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 … | |
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 … | |
How can i create a directory in c++ other than writing [CODE]system ("md directory");[/CODE] | |
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. :) | |
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]; … | |
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 … | |
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]; } | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 <= … | |
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 … | |
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". | |
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 … | |
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 " … | |
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 … | |
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, … | |
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()? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
How can intract ODBE with C++, Waiting for your kind responce.. | |
[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(); … | |
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 … | |
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 … | |
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? | |
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) … | |
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 … | |
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 … | |
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. … | |
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 … |
The End.