49,757 Topics
| |
I had to write a fraction calculator program and my only problem (I think) is when I input the two fractions it gives me garbage - for instance if I put 1/2 + 1/2 it gives me 1374389536/687194768 - can anyone help me correct this please? Thanks! divisionByZero.h [CODE] #include … | |
I have add the two functions the add and subtract I have to now add the multiply and divsion functions can someone help | |
| CSCI-15 Assignment #2, String processing. (60 points) Due 9/23/13 You MAY NOT use C++ string objects for anything in this program. Write a C++ program that reads lines of text from a file using the ifstream getline() method, tokenizes the lines into words ("tokens") using strtok(), and keeps statistics on … |
Hi. I picked up Dev C++ the other day after a while of not using it. Here's my question: I can't figure out what's wrong with my code Basically, the program prompts for a command. If the command starts with 'open:', then it puts the following character(s) within "<>"s. This … | |
Well I initialize an array of 5000, along with using srand & rand numbers with a range. I want to Prompt the user to enter an integer to search (from the front of the array) & output the index location of the element found(-1 if not found). I attempted it, … | |
hello dear people. as adviced by respected members of this community, i have decided to use an engine to develop the game, my initial findings are that unity uses c# or javascript as language, udk uses unrealscript, i was wondering if there is a good (i mean atleast on par … | |
I get stuck for this one for 3-4 hours, try various sources but no help, would you please point out what is wrong with my code ? This is the first time I am using a pointer.This one is the error : "Segmentation fault (core dumped)" when compiling // Integer.cpp … | |
| CSCI-15 Assignment #2, String processing. (60 points) Due 9/23/13 You MAY NOT use C++ string objects for anything in this program. Write a C++ program that reads lines of text from a file using the ifstream getline() method, tokenizes the lines into words ("tokens") using strtok(), and keeps statistics on … |
I have a map like this : map<int,map<int,int> > m; in this, I can insert value like a 2-D array. like this, m[i][j]=3; so, now i want to iterate all the values in a particluar row of map. for ex. if m is like this : m["user-id"]["movie-id"], then i want … | |
Suppose you save $100 each month into a savings account with the annual interes rate5%.So, the monthly interest rate is after the first month,the value in the account becomes 100*(1+0.00417)=100.4417 After the second month, the value in the account becomes (100+100.417)*(1+0.00417)=201.252 After the third month ,the valiue in the account … | |
Hey guys, noob programmer here. Over the last week or so we've been learning about classes and inheritance in my latest progamming class. I've recieved a variation of the ever so popular poker program and am having some problems putting it all together. I haven't had the opportunity to test … | |
I'm afraid to ask this on SO because all I can get is down-vote so I ask it here.* ## **Question:** ## Does C/C++ compiler (e.g the popular "gcc") with OO concepts allocates/creates all data member if other data member are not in use? /************************************* * code for example: * … | |
An example how to plot the function y = sin(x) using the WinApi function SetPixel(). The plot is centered along a line at pixel y = 200. Add an x-axis and a couple of tickmarks and it could look impressive. | |
#include<iostream> #include<fstream> #include<ctime> #include<cmath> using namespace std; clock_t start, end; double cpu_time_used; int main() { int m,i,j,n,k; double P[150][150], tou1, cx[8],cy[8], U[150][150],V[150][150]; double u,x[150],y[150],dt=1.0, T[150][150],S[150][150],t=0.0; cout<<"enter the units in X x Y"<<endl; cin>>m>>n; class pdf { public: float feq[150][150], f[150][150]; }; pdf f0, f1,f2,f3,f4,f5,f6,f7,f8; // For X for (i=0;i<=m;i++) { … | |
Okay, so I've gotten my second project in C++ and this seems pretty extream for a second project to me, but I'm determined to get this working. so my teacher suplied two header files (set.h and bingoball.h) our job is to take those files and program a bingoball.cpp and a … | |
Hello, i just made this program to push the '5' button repeatedly when I hold the 'f12' button and this works just fine but i have a question! When I run this program while I'm playing super mario bros this program does not work! I use the 5 button to … | |
so, we have this school assignement in which we are asked to make a program that would ask you to enter two integers, them the program should add the two integers and all the even integers between them. example: integer1: 1 integer2: 10 (1 + 10 + 2 + 4 … | |
am new student to c++ and am taking this course , I faced a little problem solving my assignment question .. this is the question..... to write a program that reads in 5 whole numbers and outputsw the sum of all the numbers greater than zero , the sum of … | |
Everything is coming out except for the average, what am I doing wrong? #include <iostream> #include <string> #include <iomanip> using namespace std; int main() { string ssnumber; int exam1 = 0, exam2 = 0, exam3 = 0, final = 0,count = 0, sum = 0; int average1 = 0, average2 … | |
Dear friends: I compile my procedure with mpicc, it can give correct execute file. mpicc -o testprint testprint.c libptools_ppf.a But when i compile it with mpic++, it gives me some error about undefined reference. Could you please help me out. mpic++ -o testprint testprint.c libptools_ppf.a testprint.c:25:31: warning: deprecated conversion from … | |
| CSCI-15 Assignment #2, String processing. (60 points) Due 9/23/13 You MAY NOT use C++ string objects for anything in this program. Write a C++ program that reads lines of text from a file using the ifstream getline() method, tokenizes the lines into words ("tokens") using strtok(), and keeps statistics on … |
Hi, Imagine a vector of structures with each structure containing various variables. struct Data { double x double y double z } vector<Data> Dataset vector<Data>::iterator it //input some data from a file into DataSet How can I iterate over this vector, comparing say, x at the nth row to the … | |
| I need to know how to remove spaces from a string using pointers in C++. Since I'm in senior year in school I'n not used to quite complex programming. I tried doing this program but I think I'm totally hopelessly terrible wth pointers (I was out sick, the day my … |
Im completely new to programming, and this is my problem. For example, if a train travels 40 miles per hour for three hours, the distance trav-eled is 120 miles. Design a program that asks the user for the speed of a vehicle ( in miles per hour) and how many … | |
Hello! So recently I have written a lexer/tokenizer and am working on a parser for a language with a friend. At this point everything is going great but I'm beginning to think about how I want to do code generation. Are there languages or systems that generate for example C … | |
HI I am trying to make a dll file that performs its tasks using CUDA library. Here is a simple version of my code: CUDADll.cu ` #include <iostream> #include "cuda.h" #include "cuda_runtime.h" #include "device_launch_parameters.h" __global__ void test(int a, int b, int* c) { *c = a+b; } extern "C" __declspec(dllexport) … | |
Hello! I am having a bit of a hard time figure out how to code this thing.. I have just started coding by using windows form application and need some help.. I have successfully coded so that I can open a txt file without any problem, but it is reading … | |
Hi, I am trying to call the borland C++ DLL from VS 2005 .But its giving Linking Error. Tried teh below one still its not working , Extract the DEF file from DLL converted the DEF to LIB file. Any one have any idea ? Thanks, Angelin | |
So I'm trying to validate dates and I have this else if "bool" that always returns false. I've written this at least 10 times and can't get it to work. When I comment everything out and only try one if at a time they all work. I know it's semantics, … |
The End.