51,592 Topics

Member Avatar for
Member Avatar for SQ89

Here is the Quesion :: I want to write a program that estimates the value of the mathematical constant e by using the formula: `e = 1 + 1/1! + 2/2! + 3/3! + 4/4! + ………+ n/n!` Here is my Answer: #include <iostream.h> int main () { double x …

Member Avatar for ddanbe
0
162
Member Avatar for Kcube989

would a connect 4 game really be hard to make with like a 5x5 board if you make it from scratch and without the help of some premade libraries? need an answer asap cause i need to decide whether i would continue with my connect 4 game or change it

Member Avatar for ff4930
0
105
Member Avatar for sjhentges

Hi all, I'm trying to write the code for a program that will convert MPH to KPH and vice versa. Here is what I have so far.... [code=cplusplus] #include <iostream> #include <iomanip> using namespace std; int main() { const double kph_to_mph = 0.6214; int kph; double mph = kph * …

Member Avatar for skatamatic
0
77
Member Avatar for shopnobhumi

I have 3 instructions- 1- Use rand() to generate a number less then 100 and greater than 1 2- Call the prime() function to test the result 3- Print out the result So far i have found how to get a prime number but don't know how to fill up …

Member Avatar for skatamatic
0
831
Member Avatar for riya1234

i have made this program for creating and traversing binary search tree. for inorder, it is working well but for post and pre order it showing wrong results .i could not be able to get the problem .could some one please tell me problem regarding this program .it is written …

Member Avatar for Lerner
0
147
Member Avatar for xenocide001

hi there i'm new here i hope you can help me through this homework i've read like 14 pages of topics about seekg and fstream.. and well.. they didn't solve my problem. my homework it's about creating a text file from "b to z" without the vocals, then reopen the …

Member Avatar for vmanes
0
130
Member Avatar for BRICEK

how can i get this convert an array to MPH if data represents KPH equation:multiply by 5/8

Member Avatar for William Hemsworth
0
84
Member Avatar for number87

ok so what im trying to do is to read some text from a file. Put them into an array. And count the number of characters in the text file using pointers to access the array. However, when i compile i get an error for this line [B]check = isalpha('*text');[/B] …

Member Avatar for number87
0
107
Member Avatar for daviddoria

I've spend a lot of time working on a bunch of classes (point, vector, ray, triangle, plane) etc to work with these objects and their intersections in c++. However, now that I am ready to do a full scale project with them, I am finding they are terribly slow! I've …

0
54
Member Avatar for newbie5150

hi everyone, im having problems with my loop in my assignment im working on. im not tryin to get the code from you guys. but would like some pointers on what im doing wrong. im tryin to figure out why my "else" code wont work? i've tried to look for …

Member Avatar for mrboolf
0
144
Member Avatar for vladdy191

So explicit parametric polymorphism need not be restricted to a single type parameter. In other words I can write this in C++ [CODE]template <typename First, typename Second> struct Pair { First f; Second s; };[/CODE] Can someone help me write a funciton "makePair" that takes two paramters of different types …

Member Avatar for vijayan121
0
140
Member Avatar for empathy

hi i am trying to count the occurrences of different words in a string array. while(end of array) { while(end of array) { compare ith element with all other elements inc counter } increment the element number } but i guess something is terribly wrong here as i am not …

Member Avatar for kux
0
225
Member Avatar for afg_91320

im brushing over some of my notes for a midterm tommorow. questions i have when i was reading: what exactly does a parameter do? i know it passes a value to a function-but how is it always like that? or is it more complicated than that? is it kind of …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Richy321

What are the benefits of using the Conditional operator (?) over a traditional if/else statement or similar? Using ? seems to lower readability in some cases but anything else?

Member Avatar for Richy321
0
132
Member Avatar for Kanvas

How do i make an array class that contains pointers to objects? (in this case, object of type travel.) right now all i got is array of object, not pointer...... [code] class Array { public: Array(); Array(int size); Array(const Array & anArray); ~Array(); friend ostream& operator<< (ostream& out, const Array …

Member Avatar for dougy83
0
140
Member Avatar for rhy

I am thinking about becoming a programmer and have a BA in socail science and computer tech certificate. Can I ge a job with just either a C ++ certificate or Java certificate. Which one would be better to take. Please advise.

Member Avatar for ithelp
0
161
Member Avatar for foggy_coder

Hello, I'm pretty new to C++ and I've been trying to this program to open a file and check if it exists for the last two hours. It seems like it should be so simple but it keeps eluding me. Here is the code in main that starts to run. …

Member Avatar for foggy_coder
0
260
Member Avatar for Sarlacc

I would like to be able to find out the pitch of some audio recorded in a wav file and want to know the best way to go about doing this. I am using VC++ 2008

Member Avatar for skatamatic
0
134
Member Avatar for cherryteresa

Hey there, everyone. Here is the question I had to write code for: Include the following code: char test[15] = {‘T’, ‘h’, ‘i’,’s’, ‘_’, ’i’, ’s’, ‘_’, ’a’, ‘_’, ’t’, ’e’, ’s’, ’t’}; for (int row = 0; row < 15; row++) { cout << test[row]; } Add the code …

Member Avatar for cherryteresa
0
141
Member Avatar for afg_91320

int numberArray [9][11]; write a statement that assigns 145 to the first colum of the first row of this array. write a statement that assigns 18 to the last col of the last row of this array this is what i have [code] numberArrray [1][1] = 148; numberArray [9][11] = …

Member Avatar for skatamatic
0
105
Member Avatar for vladdy191

If I have these function variables: int (*f)(int); int (*g)(int); int (*h)(char); why can I do the assingment f=g but if I do h=g the C compiler gives me warning while the C++ compiler gives me an error. Can any one please explain this to me.

Member Avatar for Ancient Dragon
0
123
Member Avatar for kiwihaha

i wanna put all my variable initialization at a header file.. but after i put in a header file name, "variable.h" i #include "variable.h" in main. but it still cant reconize the variable. what can i do? + extern infront all the variable in header file?

Member Avatar for Ancient Dragon
0
271
Member Avatar for Levio91

I am a beginner I spent many hours studying c++ books and online tutorials, I am sure I am competent enough to become a good programmer but I cant wrap my mind around how c++ (or any programming language for that matter) works. My question is, How do I understand …

Member Avatar for freudian_slip
0
141
Member Avatar for inumbris

The following code, excerpted from a much larger program, triggers a C++ compile time error as shown in the leading comments. [Re-]declaring variable 'w' to be a 'const char *' will fix the problem, but I don't know exactly why. I would greatly appreciate it if somebody could elucidate the …

Member Avatar for Lerner
0
141
Member Avatar for Villanmac

Hi I'm working on the following code which is to be used on the M16C/62 microcontroller. Basically the microcontroller is to [B] "scan the keypad and display any key that is depressed" [/B](which i have done im pretty sure), on the LCD. However I know I have to Sound the …

Member Avatar for skatamatic
0
191
Member Avatar for Se7Olutionyg

[CODE] // filename = isbn.cpp // Kyle Burmark // Prof. Gelotte // 02/12/02 // Program 4 - Validate ISBN numbers program // Description: This program asks the user whether he wants to validate // ISBN numbers from his own input or from a file of isbn numbers // Start program …

Member Avatar for Ancient Dragon
0
186
Member Avatar for kotkata

This is my relatively simple code. Its just part of a memory matching game. I've looked but I cannot figure out why it won't switch the values in each of the array indexes. I would appreciate anyone helping me out here with this. ** Turns out the problem is that …

Member Avatar for Lerner
0
97
Member Avatar for Foe89

[code] #include <iostream> #include <iomanip> using namespace std; void celsius(int); int main() { cout << setprecision(2) << fixed << showpoint; cout << "This program displays a table of the Fahrenheit temperatures" << "\n0 thorugh 20 and their celsius equivalents.\n"; celsius(0); return 0; } void celsius(int fahr) { double cels; cout …

Member Avatar for DemonGal711
0
393
Member Avatar for MylesDBaker

Hello everyone, I am a Mathematics major and my mentor asked me to put together a program that evaluates explicit stencil methods along the difference mesh. Basically I need to use a recursive method to get my value, as I know base values and boundaries, but the C++ experience I …

Member Avatar for MylesDBaker
0
159
Member Avatar for mrtwinkles

Im trying to make an annogram. first you input a word, and then it mixes it up and then couts the scrambled version of the word. My problem right now is that when you input a word like "Cat", it will mix up and look like "aCt" or something with …

Member Avatar for DemonGal711
0
218
Member Avatar for DemonGal711

Okay, I've been noticing this for a while now and decided I might as well ask. When I'm working on my programs at school, if I try to read from a text file, it can't seem to find the text file. However, if I run the exact same thing on …

Member Avatar for DemonGal711
0
104
Member Avatar for ROTC89

hey there! ok i need help figuring out what is wrong with my code. i have to write a program that does addition and subtraction in stacking. but all im getting is error. some advice would be greatly appreciated thanks here is the code #include <iostream> #include <stack> #include <string> …

Member Avatar for ROTC89
0
260
Member Avatar for DemonGal711

Okay, I figured out the larger problem that I've been having with my program, now all I need is it to get out of the loop and finish the program. Well, it won't break out for some reason. Anyone see why? [code]row = col = 4; z = 0; do …

Member Avatar for DemonGal711
0
123
Member Avatar for Helgso

I'll try to explain. I've got a C++ program that is going to copy files from it's folder which it is located in to another location. So, I'd say f.x. I had a directory called "Flash". Then, inside that directory would be "myprogram.exe" and 4 other directories. Within those 4 …

Member Avatar for Helgso
0
2K
Member Avatar for acoxia

Ended up solving it don't know how delete post however [code] include <iostream> using namespace std; /* * linkedlist.h * linkedlist */ struct node { int data; node * next; }; class linkedlist { node * hd; public: linkedlist(){ hd = NULL; } void add_to_end(int data) { //find end of …

0
85
Member Avatar for McCo

I need a complete help on how to use the flush() member function with ofstream, ifstream and fstream and also its use. P.S: Please provide an example for me to understand

Member Avatar for Lerner
0
124
Member Avatar for M00nDancer

Well, I bumped into an interesting C++ problem last night while I was aimlessly surfing the Internet, and, of course, it caught my attention. It said something like this: "From a file it's read a text that contains a phrase, on a line. The program rearranges the letters in each …

Member Avatar for M00nDancer
0
148
Member Avatar for mastr924

[code] /* * File: sets.cpp * ------------------ * This program deals with sets of lower case letters. * This program computes the union and intersection of two sets. This program * also checks if set B is a subset of set A and returns true if set B is a …

Member Avatar for mastr924
0
348
Member Avatar for muya08

am just a beginner and an getting the compiling error like:(warning: no newline at end of file) anyone who could help me out? [code=cplusplus] #include <iostream> #include <cmath> using namespace std; int main(){ int a; int b; int c; double p; double x1; double x2; cout<<"bitte lesen sie vier nummern …

Member Avatar for Ancient Dragon
0
72
Member Avatar for AutoC

Hi, I'm implementing linear block coding and need some ideas on how to go about storing the cosets. i.e. If i have an alphabet C={000,101,010,111} I need to perform C+000={000,101,010,111} C+001={001,100,011,110} C+010={010,111,000,101} C+011={011,110,001,100} etc... observed here is that there are only 2 sets and it keeps repeating.So, i need to …

Member Avatar for iamthwee
0
36
Member Avatar for Kanvas

HI i have a small problem but for some reason i can't think of how to do it. I'm making a linear linked list of arrays. The Array is of travel class object. So in the struct node, how should i implement so that the size of the array is …

Member Avatar for jencas
0
150
Member Avatar for nabilchampion

Hi all I urgently need a tool that either convert java code to c++ or make reverse engineering diagrams of java code..like uml/sequence digs..etc…or explanation of the code…. If anyone have idea of such a tool then let me know please. Regards

Member Avatar for ithelp
0
164
Member Avatar for DemonGal711

My assignment is to take in values that will create a maze, and then let the user traverse the maze by use of a stack to store values. I thought I had it down to it working, but now it isn't doing what it should and then it stops after …

Member Avatar for DemonGal711
0
99
Member Avatar for shiniboy

You are supplied with a group of implemented sorting algorithms (posted file sortTest.cpp). You may not change the prototypes or any of the provided code. You will add a main program to use the functions you are given. You will also add one additional function VerirySorted. This function will take …

Member Avatar for heerokeno
0
214
Member Avatar for Nasi23

Hi guys im getting some errors here and cant seem to find why? [code] #include <iostream> #include <iomanip> using namespace std; class Student{ public: Student (Mary, 100, 99, 88, 1); void getInfo(); void showInfo(); private: string name; double test1, test2, test3; int idNum; }; Student::Student (string n, double t1, double …

Member Avatar for Alex Edwards
0
138
Member Avatar for sacarias40

i am programming in microsofts visual C++ forms program i am a very beginner. lol but i have the main design that i want but. i would like to add functionality to the url box, the go button, and the forward and backword buttons. could somebody please help me i …

Member Avatar for Ancient Dragon
0
50
Member Avatar for Se7Olutionyg

[CODE=cplusplus]// CS 210 EDDIE CHEN // THIS IS PROGRAM 4 (ISBN-Check), a program that verifies ISBN. #include <iostream> #include <fstream> // REQUIRED FOR FILE STREAMS #include <cstdlib> // FOR DEFINITION OF EXIT_FAILURE #include <cctype> #include <string> using namespace std; // ASSOCIATE STREAMS WITH EXTERNAL FILE NAMES #define inFile "isbntest.txt" // …

Member Avatar for Ancient Dragon
0
184
Member Avatar for DevC++4.9.9.2

Hey, im trying to print what is stored in my 2d dynmic array from a file in my print function. However whenever i try to access information in the array, it crashes the program. maybe the array is not being passed back some how, im not sure, any information would …

Member Avatar for vmanes
0
129
Member Avatar for afromong

Hi if i want to say if (int <= 0 || int is not a number) how could i do this i want to make sure that a positive number is input not a negative number or word or symbol hope this makes sense

Member Avatar for afromong
0
86
Member Avatar for PaladinHammer

Well, I need to write a program that uses enumerated datatypes, structs, and plenty of functions. Below is my current code: [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; void getInput(string input); void outputStudent(string student); void outputTeacher(string teacher); void outputStaff(string staff); void sendtoOutputStudents(string students); struct personDataType { …

Member Avatar for mrboolf
0
120

The End.