Posts
 
Reputation
Joined
Last Seen
Ranked #70
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
99% Quality Score
Upvotes Received
171
Posts with Upvotes
145
Upvoting Members
100
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
74 Commented Posts
4 Endorsements
Ranked #396
Ranked #141
~278.67K People Reached
Favorite Tags
Member Avatar for KLane

[CODE] //I need to make a class that calculate the mean and standard deviation. I have to test my program with an external file containing about 300 data. My program doesnt return the correct valuesAny help? #include <cstdlib> #include <iostream> #include <cmath> #include <fstream> using namespace std; class Statistics{ double …

Member Avatar for mellguth
0
1K
Member Avatar for qqwushi12345

Write the C program that solve the quadratic equation problem The output should appear as follows: Enter A: 3 Enter B: 5 Enter C: 2 There are two solutions: -0.666667 and -1. Press any key to continue_ thank you,

Member Avatar for mohanned_2
0
4K
Member Avatar for Nomar_1

Ok I need to make a 3 part program thats made with c++. The first part is to write 10 number, and then program ask to ether repeat the number or to reapeat them reverse. Second part I need to make a program that ask for a word and later …

Member Avatar for StuXYZ
0
351
Member Avatar for Dean_5

So... I've slept since college - meaning I've forgotten a few things. I need to do an inner-join on two large-ish sorted vectors. Thought about converting them to unsorted sets and walking through "find-ing", but I'm pretty sure this is the fastest way to do it - and still accurately. …

Member Avatar for StuXYZ
0
2K
Member Avatar for Rain_1

Hello, So I am first year at Uni and I am new to C++ and I am still trying to learn the basics. I can't seem to find the right way to start my exercise. Ex1. Create a program, which is with a main() function and menu-function for: 1.1) Inputting …

Member Avatar for Andrew_36
0
411
Member Avatar for can-mohan

In below code snippet , I am trying to add the intefeger and float values in Array template but was surprised to see below output for float value as 5.1 was expected there but getting 0 . Can anybody let me know what can be wrong here. output value=5 value=15 …

Member Avatar for can-mohan
0
360
Member Avatar for Ghada_1

Can someone help me please find the ploblem with this program ? I know it's a question of a misssing pointer but i don't know where to put it .. #include<stdio.h> void remplissage_matrix(char M[50][50],int l , int c); void remplissage_elements(int l, int c ,char M[50][50],char elements[100],int *n); void remplissage_histo(int histo[100],char …

Member Avatar for StuXYZ
0
234
Member Avatar for tonykjose

I have got a small problem with this program. It takes a user's input of numbers and sorts them by merge sort in increasing order using linked lists. Unfortunately, a segmentation fault appears immediately after I input the numbers. Probably something to do with the merge sort function. Help! [code] …

Member Avatar for rcgldr
0
359
Member Avatar for can-mohan

Hi All, Below is the code of implementation of aggregation in c++. In this code class bar object will be contained in class a but class a won't act as a owner of class bar and due to this bar object is deleted after class a's life time ends. Now …

Member Avatar for StuXYZ
0
211
Member Avatar for ALosh99

How can we insert two independent random number to two equations (x,y) contain two parts like this: x = a* randomnumber1 + b* randomnumber2 y = c* randomnumber1 + d* randomnumber2 these two random number should be independent. Thank inadvance.

Member Avatar for ALosh99
0
260
Member Avatar for homeryansta

[CODE=C++] #ifndef LIST_H #define LIST_H #include <iostream> typedef char Item; class List{ public: List() {first = NULL; last = NULL;} //~List() void append(Item entry); void remove_last(); void output(); private: struct Node { Item data; Node *next; Node *back; }; Node *first; Node *last; }; #endif [/CODE] I'm writing a class …

Member Avatar for Syed Zuman
0
967
Member Avatar for Dasun_1
Member Avatar for Dasun_1
Member Avatar for StuXYZ
0
175
Member Avatar for tgreiner

I am trying to calculate the angle between two vectors. Here is my relevant code: cout << "\n\nPoint1 "; Point1.dump(); cout << "Point2 "; Point2.dump(); cout << "\nanswer: " << Point1.dot(Point2) << endl; cout << "\nacos: " << acos(-1)<< endl; cout << "Problem: " << acos(Point1.dot(Point2)) << endl; cout << …

Member Avatar for ipswitch
0
1K
Member Avatar for jamesjohnson25

Q 1) In this small snippet #include <stdio.h> void passingAddressOfConstants(const int* num1 , int* num2) { *num1 = num2; } int main(){ const int limit = 100; int result = 5; passingAddressOfConstants(&limit,&limit); } Error : error: invalid conversion from 'const int*' to 'int*' Here I defined "limit" is of type …

Member Avatar for aleeha.saqib.5
0
223
Member Avatar for James_47

Hello I am tring to write a code to generate random numbers into an array, I don't understand why this isn't working. please help #include <iostream> #include <ctime> #include <cstdlib> const int NRows = 5; const int Ncols = 5; using namespace std; int main() { //declare variables int num[NRows][Ncols]; …

Member Avatar for StuXYZ
0
116
Member Avatar for hadisur_rahman

# What's the problem in output where the algorithm was correct ???? # #include<iostream> #include<stdio.h> using namespace std; main() { int LA[100],K=1,N=5,L;//K=POSITION...N=element for(int i=0;i<=4;i++) { cin>>LA[i]; } L=LA[K]; for(int J=K ; J<N-1; J++) { LA[J]=LA[J+1]; } cout<<"DELETE ITEM:"; N=N-1; for(int P=0;P<=4;P++) { cout<<" "<<LA[P]; } }

Member Avatar for StuXYZ
0
161
Member Avatar for cambalinho

see my property constructor: template <typename T> class property { private: T PropertyValue; std::function<T(void)> getf; std::function<void(T)> setf; public: property(const T &value) { getf=nullptr; setf=nullptr; PropertyValue=value; } property(const property &value) : PropertyValue(value.PropertyValue) , getf(value.getf) { } property(std::function<T(void)> GetFunction=nullptr,std::function<void(T)> SetFunction=nullptr) { setf=SetFunction; getf=GetFunction; } inside a class i have 2 functions: void …

Member Avatar for cambalinho
0
189
Member Avatar for Petcheco

Hey, guys. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c². For example, 3² + 4² = 9 + 16 = 25 = 5². There exists exactly one Pythagorean triplet for which a + b + c …

Member Avatar for Petcheco
0
345
Member Avatar for RKVP

Hello. I need help with my assignment urgently. This is my assignment question and the follwoing is my code. It compiles but it doesnt give me the right output. 1. Run length encoding. Example: if the input is “AAABBCCCDEEFFA” the output will be “A3B2C3DE2F2A” 1. Input takes the form of …

Member Avatar for rubberman
0
650
Member Avatar for zrd0808

This is a homework problem; however I just want some direction. I have to write a module graph.cpp that implements djikstra's algorithm. so far i am at the reading in module and am trying to make an array of structures. here is the code. [code=c] // Zachary Dain // CSCI …

Member Avatar for Schol-R-LEA
0
438
Member Avatar for cambalinho

heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; int framedelay=0; string strfilename=""; Gdiplus::Color clrBackColor=Gdiplus::Color::Transparent; HDC hdcwindow; bool blnTransparent=true; HICON HICONFromHBITMAP(HBITMAP bitmap) { BITMAP bmp; GetObject(bitmap, sizeof(BITMAP), &bmp); HBITMAP …

Member Avatar for Schol-R-LEA
0
295
Member Avatar for PulsarScript

Hi, how can i avoid of key beeing inserted into wrong location.If i do lets say 3 numbers ,5 digits long like 12345,23445,56745 and choose location 45,they will be inserted to location 45,but if try to insert 67452 to the same location it will be inserted,but i need it to …

Member Avatar for StuXYZ
0
195
Member Avatar for DS9596

Not working right, else is getting error. #include <iostream> #include <iomanip> #include <cmath> #include <string> using namespace std; int main() { // Declare variables below here int CORRECT, WRONG; double a, b, correct, result; char choice, answer; cout <<"Let's practice addition or subtraction with random integer numbers <100"<<endl; cout <<"---------------Math …

Member Avatar for tinstaafl
0
152
Member Avatar for hellocsprogram

Hi I am wondering how you would create a program for the knight tour instead of using recursion using a stack. I just want the ideal behind using a stack/queue instead of recursion please no code:)

Member Avatar for StuXYZ
0
630
Member Avatar for TObannion

So here is my WORKING code. My problem lies in the output when I enter "0" or "00" for the hour in 12 midnight. No matter what it still outputs a 0 for midnight. (I want it to convert it to standard time.) I know it is something easy that …

Member Avatar for TObannion
0
233
Member Avatar for DS9596

So far I have this but I need to use switch statements to make age< certain numbers for each age group. #include <iostream> #include <iomanip> #include <string> using namespace std; const float CHILDREN_MALE=50.00; const float CHILDREN_FEMALE=55.00; const float TEENAGERS_MALE=150.00; const float TEENAGERS_FEMALE=155.00; const float ADULTS_MALE=275.00; const float ADULTS_FEMALE=250.00; int main() …

Member Avatar for StuXYZ
0
277
Member Avatar for Swalih

I'm trying to write 2 dimensional array of int type to a binary type file. int array[3][3]={Some data}; ofstream f; f.open("nameoffile.dat",ios::binary||ios::out); for(i=0;i<=3;i++) { for(j=0;j<=3;j++) { f.write((char *)&array[i][j],sizeof(array)); } } f.close(); Above code is not complete. I only wrote a part of the code where I need help. Is this code …

Member Avatar for Swalih
0
3K
Member Avatar for kARTechnology

Hi, I'm new here :) the problem is if i increment one member, for eg --------------------------------------- struct day { int hour[40]; int min[40]; int mins[40]; int rec; int totmins; int totsal; char status; int temp; }; struct month { struct day *da;}; struct year { struct month *mn;}; struct roll …

Member Avatar for StuXYZ
0
235
Member Avatar for Luisa_1

#include <iostream> using namespace std; double polynome3(double a0,double a1,double a2, double a3) ` double y[21]; double z[21]; for (int k=0;k<21;k++) { y[0]=1; y[1]=1; y[2]=1; /* Bernoulli's algorithm */ y[k+3]=-(((a1*y[k+2])+(a2*y[k+1])+(a3*y[k]))/a0); // cout<<y[10]/y[9]<<endl; } double alpha1=y[20]/y[19]; cout<< "The first solution is alpha1 = " << alpha1<<endl; double b0=a0; double b1=a1+alpha1*b0; double b2=-(a3/alpha1); …

Member Avatar for StuXYZ
0
2K