51,593 Topics

Member Avatar for
Member Avatar for tuskyballer

I'm about 3 weeks into my C++ class. I already made a simple program below that calculates grade averages and received an A. Now my teacher wants me to turn in three variations of it, replacing the goto with a while, do while, or for loop. I have experimented and …

Member Avatar for Stack Overflow
0
716
Member Avatar for nanodano

Hey guys, I am trying to write a section of a program that reads in data from a file and stores the data into an array. The problem is the length of the file can vary, and I need to know how many items to store in the array.(I really …

Member Avatar for Tight_Coder_Ex
0
101
Member Avatar for ohnbabygal

hi im tryin to read some info (both characters and integers) from an input file and save them into the sorted list. it is a big project and i cant put all the files i have over here. so i'll just put the part im having a problem. i have …

Member Avatar for Dave Sinkula
0
112
Member Avatar for seeplusplus

alright, here i have this code i wrote....but it tells me now i have to have a public member function that will add two rational numbers, and have the result be stored in reduced form.......hmmmmmm......heres my code: RATIONALL [code] #include <iostream> using std::cout; using std::cin; using std::endl; class rational { …

Member Avatar for Dave Sinkula
0
120
Member Avatar for Morinar

Okay, I need to read in a binary file from stdin and stick it in an array. The file contains binary representations of floating point numbers. I need to make sure that my array is sized properly based on the number of elements. It is quite easy to do with …

Member Avatar for Dave Sinkula
0
137
Member Avatar for cap2361

ok, help!!! I'm totally lost. I have to use a file stream program and add names to file, then keep count of file names, then display the count of names entered and the names entered. Use a loop to enter names until prompt to end. these are just two of …

Member Avatar for cap2361
0
149
Member Avatar for DaveSS

:?: Hi i am in my first C++ class and have already written two simple C++ programs. Im working on another using functions. I have to write 3 functions to calculate the area, cost, and retail price for wooden boxes and a main function to have the user input information …

Member Avatar for DaveSS
0
122
Member Avatar for Lapari

Hello, can anybody help me please? I am new to C++. I need help with assignment that calculate income tax. thank you. instruction: ******* 1.Set up a project called CTax. 2.Add to your project a class called GRTax. 3.The member variables for this class are: float mTaxableIncome, float mTaxRate, and …

Member Avatar for murschech
0
111
Member Avatar for boujibabe

I have been given an assignment to write a class to accomodate the following code: [code] int getMenuOption (); int main () { int option; int id; char name[80]; //create a Salesperson object and sets all 12 monthly sales to 0. Salesperson sp; cout << "Enter name: "; cin.getline(name, 80); …

Member Avatar for boujibabe
0
285
Member Avatar for rharvison

Hi all. I am very new at this stuff; first C++ Programming class with no background whatsoever. We are asked to create the design work and coding to generate an invoice given certain criteria. I wrote the program using the info and directives provided but I am coming up with …

Member Avatar for rharvison
1
173
Member Avatar for rporter1

I have found out through the compiler that you cannot declare and initialize an array within a class header file. I was trying to figure out how I might go about getting a 5 by 14 array initialized as a private mamber within the class. I have included the header …

Member Avatar for Tight_Coder_Ex
0
204
Member Avatar for VeG

was wondering if someone could help me on this slight problem my rogram compiles but a section doesnt seem to run.. } void main() { clrscr(); int one, two, three; char choice=' ', input[5]; while (choice != 'e') { cout<<"\nPlease enter +,-,*,/ or sqrt and then two numbers,\nsepperated by spaces, …

Member Avatar for Acidburn
0
116
Member Avatar for s47221288

This is my project about: league table , print result of score i attach all my code in filename c++.zip -------------------------------------------------------- my program : 1. you must select O to open teams.txt 2. then select I to input a score 3. select P to print a result ps.- this program …

Member Avatar for Siersan
0
57
Member Avatar for alastair18

I am rather inexperienced at C/C++ so hopefully my question will be easy to answer. I have created a struct which contains vectors. I read in data from a file into the various vectors in each struct do a bit of maths, write the results to another file, clear the …

Member Avatar for Siersan
0
104
Member Avatar for Tripoli178

I'm was working on a c++ program that inolved calsses and when i got done with it was running good. Now I need to use that program in GUI. Is thier any advice on using the C++".exe" file in GUI Thanks :rolleyes:

Member Avatar for Siersan
0
31
Member Avatar for Genar Codina

I am trying to call a stored function (which makes basically a select query)from a VC++ program using OCI. The description of the stored function is: [code] FUNCTION patrick.P_DICTIONARY_FOR_RISK_GROUP RETURNS REF CURSOR Argument Name Type In/Out Default? ---------------- ------------- --------------- V_RISKGROUP VARCHAR2 IN V_DICTIONARY VARCHAR2 IN V_MARKETDATA VARCHAR2 IN V_MODE …

0
93
Member Avatar for s47221288

so i have 4 integer that are int m = rand() % 3+ 0; int n = rand() % 3 + 0; int x = rand() % 3 + 0; int y = rand() % 3 + 0; and i want to random in 0-3 range so how can i …

Member Avatar for Siersan
0
107
Member Avatar for syphyr_0707

Hello all, I am taking a C++ class after not touching it for about 4 years now... I am rather dusty. My book is horrible, I am trying to randomly select a switch case for a word output. This is my latest attempt: ******************************************************* [code] void right(); void wrong(); int …

Member Avatar for syphyr_0707
0
98
Member Avatar for s47221288

Hi, I'm a thai student ... now i have a premiership project but i can't pass this problem that is , How to random matching football team ? example I have 4 team in `vector<string>` name [0]=a [1]=b [2]=c [3]=d I want to matching them such as week 1 : …

Member Avatar for s47221288
0
108
Member Avatar for Gav2

Have been issued a problem. 'Design a program using the top down stepwise refinement. This should include a structure chart and pseudo code' The program is to control a temperature process, with two reference temperatures. Dont understand a word of this - can anyone help PLEASE? :sad:

Member Avatar for Siersan
0
113
Member Avatar for migthyjohn

i hate C++. i have been working through the C++ for dummies book, and i have yet to make any sense out of it. the only thing that i have been able to grasp is the i/o parts. it is so hard. maybe i havent given it a chance to …

Member Avatar for Siersan
0
117
Member Avatar for samyn

hi .. im doin an assignment on edlin text editor.. while implementing the insert new line function i need to exit a loop when a key combination is pressed.. inside the loop there will be some lines reading input from the user..so will be somting like below while( ? ) …

Member Avatar for samyn
0
119
Member Avatar for cap2361

when I complile this program and then try to run it I get error LNK1201. So I started over and left it complile to c:\ and when I try to run it I get file could not be opened. I think the objective is to compile on c:\ and save …

Member Avatar for cap2361
0
124
Member Avatar for mrb260478

Can somebody help me in getting cursor position using C++ Programming language on a UNIX operating system. :cool:

Member Avatar for vegaseat
0
119
Member Avatar for noyz

the problem is not opengl coding so is not that much to work :D the problem is that i want to be copyed the lib and dll next to exe program how can i do that and there is a program like directx9.0c for opengl ??? and if it is …

Member Avatar for noyz
0
120
Member Avatar for dallin

I'm using visual studio .net c++ and I'm looking for the easiest code to drop the 0 on 0.233 to .233 when displaying floating point variable on screen. Thanks.

Member Avatar for BountyX
0
127
Member Avatar for shonenhype

Write a function IsoTriangle() that takes a size parameter and dispays an isoceles triangle with that many lines. Use the DrawBar() function as a basis. (Hint: Use another function Spaces() to display the leading spaces before the start of the asteriks on each line.) For example, the function call IsoTriangle(4) …

Member Avatar for Narue
0
159
Member Avatar for ANRCCC

I am trying and I don't know what to do. Attached is a aprogram and I don't know what is going wrong. :sad:

Member Avatar for Narue
0
117
Member Avatar for xplst

I've just downloaded the C++ sockets library from [url]www.alhem.net/Sockets[/url], but I can't get my programs to link -- I get a lot of "undefined reference"s.... I'm using g++ version 3.3.3. on Fedora Core 2 (kernel version 2.6.5-1.358). I can get the programs to compile (using the -c flag to g++), …

Member Avatar for grymse
0
3K
Member Avatar for ANRCCC

I fixed my program from the previous complaint and I got it to run. Now my problem is that it won't run correctly. Can you help me?

Member Avatar for frrossk
0
127
Member Avatar for dal4488

This is what I have so far and I can't figure out how to get the converted length in my output file so that 312 inches converts to 3 yards, 1 foot, and 3 inches. #include <iostream.h> #include <fstream.h> using namespace std; int main() { ofstream outfile; int centimeters; int …

Member Avatar for blackdove
0
104
Member Avatar for missy

#include <iostream> #include <string> #include <fstream> using namespace std; void main() { ifstream indata; ofstream outdata; char name [13][20]; float avg[20]; int sum=0, n, i=0, m,p; float davg; char ch; indata.open("a:nameFile.txt"); if(indata.fail()) { cout<<"file not open:"; exit (1); } while(i<=20) { for (i=0;i<20;i++) indata.getline(name[i],20); } for (int k=1; k<=3; k++) …

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

Can anyone direct me where to go for doing stacks in C++. I have to make a program using stacks but can you initialize a stack with given values? If so can you give an example?

Member Avatar for vegaseat
0
104
Member Avatar for xsxixtxhx

I have a project that i am working on and i can't get how to get it to work. I have attached the .h and the main cpp file. If any one can be of help please reply or im me at xsxixtxhx on Instant messenger. I need to get …

Member Avatar for kc0arf
0
237
Member Avatar for MAD_DOG

Is there any books you guys know of that someone like me that dont know anything about programming can use C++/VB what ever something that is quick and easy to understand. Something really simple something you guys can recommand. Thanks again

Member Avatar for bombe
0
431
Member Avatar for odee

is it possible to create an array then you pass it to a function? That function will change the values in the array then return it back as an array.

Member Avatar for Dave Sinkula
0
122
Member Avatar for Dani

I am taking a Computer Graphics course where we are doing some c++ programming using the OpenGL API. I'm writing a C++ program in Visual Studio.NET, where I've installed GLUT (Open GL Utility Toolkit). OpenGL, itself, apparently comes with VS. The only include that I have in my one-file program …

Member Avatar for Intel
0
1K
Member Avatar for notdumb

I was attempting to initilize bool done to false, then have this program continue to give the user the option to do more check balance functions util they pressed exit, however, my program continues to cycle repeatedly, even after option 5 (EXIT) is entered. Please, some help on how to …

Member Avatar for notdumb
0
173
Member Avatar for mattcplusplus

I'm wanting to send an email from my c++ application. i know that email applications interface with an SMTP server when sending email and that is what i will have to do, but i don't know how. Thanks for your help

0
87
Member Avatar for Asif_NSU

After having us write codes to convert decimal numbers to another base my faculty has now asked me to write codes to convert a number from ANY base to another. He explains that itz simple since i already wrote the program to convert integer to another base. So i just …

Member Avatar for Asif_NSU
0
208
Member Avatar for sidhjn

hello! I am a newbie and probably dont know much. I need to implement a 1-bit adder in c/c++ and then combine this 1-bit adder to make 32-bit adder. I shall be really grateful if you can help. Regards, Siddharth

Member Avatar for Narue
0
147
Member Avatar for ah01

#include <iostream> #include <stdio.h> #include <iomanip> using namespace std; struct person { char name[15]; int Idnum; int *testscores; float average; char grade; } *student, freshman; //////////// function prototype /////////// void allocate_memory(int number_students , int number_scores); void get_data(int number_students ,int number_scores); float validate_score(int score); void print_results(int number_students ,int number_scores); void release_memory(int …

Member Avatar for vegaseat
0
179
Member Avatar for gal05

Hai all, Does anybody know how to read a binary image file and convert it to a GeoTiff image? pls help :cry:

Member Avatar for Narue
0
62
Member Avatar for Leigh

Hi I'm trying to find a way of calling statistical functions in Visual C++ .NET. To give an example of what I'm trying to do, there is a built-in function in Excel called GAMMADIST, which evaluates a cumulative gamma distribution function. Another example is the NORMINV function in Excel, which …

0
111
Member Avatar for seeplusplus

alright, so i have two files now, main.cpp, and Rationall.h, when i compiled my code it gave me this.... /tmp/ccyeOf6F.o(.text+0x1a6): In function `main': : undefined reference to `rational::~rational [in-charge]()' /tmp/ccyeOf6F.o(.text+0x1c4): In function `main': : undefined reference to `rational::~rational [in-charge]()' collect2: ld returned 1 exit status this is my code......i dont …

Member Avatar for Tripoli178
0
106
Member Avatar for tones1986

the code compiles but when i try running the .exe it closes. It looks liek for the 2 seconds its up it works, but then it closes itself. What am i doing wrong? heres the code: #include <iostream> using namespace std; int main() { // sets variables to be set …

Member Avatar for bombe
0
602
Member Avatar for chound

I get 2 strings. I remove all the characters present in both the 2 strings.I count the no. of characters left. How do i do this in C++?

Member Avatar for vegaseat
0
177
Member Avatar for Geek-Master

I've been playing around with files and streams and just hit a pot hole. My goal is to be able to input time and date into a file when say someone "clocks in/out". Just a little program that will help me keep up with my time in school. [CODE] #include …

Member Avatar for Geek-Master
0
125
Member Avatar for 40ounce68

Well currently Im a student, and very interested in becoming a good C++ programmer. Im currently in a class and is very challenging for me. I mean, I read the book, but have a hard time applying it sometimes...any of you experts have any tips for me. Cause I really …

Member Avatar for Narue
0
98
Member Avatar for 40ounce68

anyone know where i can get the answers for the exercises...Im stuck on some of these...

Member Avatar for vegaseat
0
107

The End.