49,765 Topics

Member Avatar for
Member Avatar for Nicholas_1

I have seen C++ programs that allow you to type a string (in the case I saw it was a file name) after the name of the program, but in the same command (before pressing enter) when you go to run the program and the program parsed it as it …

Member Avatar for Schol-R-LEA
0
172
Member Avatar for shyrin

Write a program which accepts amount as float and display total number of Notes of $50 , 20, 10, 5, 2, 1, 0.50, 0.20, 0.10, 0.05 For example, when user enter a number, 575.95 the results would be like this... 11 $50 1 $20 1 $5 1 50c 2 20c …

Member Avatar for Schol-R-LEA
0
156
Member Avatar for Clouded One

I am having a lot of trouble working on this program. i am not sure how to make a linked list work with more than just numbers (i only did basic programming) and the book is just terrible, i was wondering if you guys could help me with writing this …

Member Avatar for geolotry
0
404
Member Avatar for rron17

} else{ printf(" \b"); surname[cntr]='\0'; cntr--; goto cc; } } else{ surname[cntr]=nput; cntr++; if(cntr>14){ goto aa; } else goto cc; } } aa: gotoxy(40,14); printf("%s %s",urname,surname); fullname[cntr]='\0'; { char choice; ron: SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11); gotoxy(35,15); printf(" Do you want to enter "); gotoxy(35,16); printf(" another entry? "); gotoxy(35,17); printf(" "); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),116); gotoxy(40,17); …

Member Avatar for ddanbe
0
158
Member Avatar for Zehrina

Write a program that computes a patient’s bill for a hospital stay. The different components of the program are • The PatientAccount class will keep a total of the patient’s charges. It will also keep track of the number of days spent in the hospital. The group must decide on …

Member Avatar for ddanbe
0
87
Member Avatar for xNeverx

I have no idea what I'm doing wrong, any help is very much appreciated! #include <iostream> #include <string> using namespace std; int main() int hours, mins, minutes; char day1, day2, choice; cout << "Enter the day of call (Mo/Tu/We/Th/Fr/Sa/Su): " << endl; day1 = getchar(); day2 = getchar(); cout << …

Member Avatar for ddanbe
0
175
Member Avatar for OpenTheTrollGate

bool operator!= (CustomString &str1, CustomString &str2) { std::vector<string>:: iterator s2 = (str2.vec).begin(); for(std::vector<string>:: iterator s = (str1.vec).begin(); s != (str1.vec).end(); ++s) { if( *s2 == *s) { cout << *s2 << *s << endl; return false; } ++s2; } return true; } I don't know why, but this returns true …

Member Avatar for Ancient Dragon
0
122
Member Avatar for OpenTheTrollGate

StringVec func(StringVec & str1, Stringvec & str2) { std::vector<string>::iterator s2 = str2->vec.begin(); for (std::vector<string>::iterator s = str1->vec.begin(); s != str1->vec.end(); ++s) { if(s2 == NULL) { cout << "str2 is smaller than str1" << endl; } ++s2; } } When a iterator goes out of bound, because the vector is …

Member Avatar for OpenTheTrollGate
0
88
Member Avatar for furalise

Hello everyone.. I am a little bit stuck on this small problem. I'm trying to understand callbacks but seem to be no understanding something. It is probably something very simple. I've never used callbacks so am probably misunderstanding something here. The below is pointless but I'm doing it to improve …

Member Avatar for furalise
0
779
Member Avatar for naila.ghafoor.5
Member Avatar for David W
0
136
Member Avatar for abeer06

#include<iostream> using namespace std; int main () { char a; double length; double width; double Area; cout<<"Please\n"; cout<<"\t1- Enter \"S\" or \"s\" to calculate the square area\n"; cout<<"\t2- Enter \"R\" or \"r\" to calculate the rectangle area.\n"; cout<<"\t3- Enter any Key to Exit\n"; cout<<"Please enter the length of square"; cin>>length; …

Member Avatar for abeer06
-1
116
Member Avatar for murnesty

Hi, I'm looking for embedded system or os source code example. Just to learn some common error or good way to write some device process. Probably in C or C++. Is there any good suggestion?

Member Avatar for David W
0
230
Member Avatar for hafza.sana

take an input date of birth from the user and display star of entered date of birth Plz help me in ths programm

Member Avatar for David W
0
151
Member Avatar for learner_new

#include<iostream> using namespace std; int main() { int len1; cout<<"please enter the length of arrayn 1"; cin>>len1; cout<<"creating array now"; int *arr1= new int[len1]; cout<<"please enter the elements now"; for(int i=0;i<len1;i++) { cin>>arr1[i]; cout<<endl; } return 0; cout<<arr1; delete [] arr1; } In the above code, the program stops execution …

Member Avatar for shaykhhamza
0
300
Member Avatar for glao

I am trying to use column major order to a 2d matrix which I am using as 1d. int N=3,R=2; for (int i=0;i<N;i++){ for (int j=0;j<R;j++){ //printf("\nX[%d]=%d\t",i+j*N,res[i+j*N]); //column major // printf("\nX[%d]=%d\t",i*R+j,res[i*R+j]); //row major } printf("\n"); } but the column major doesn not work as it should. Also,if I want to …

Member Avatar for glao
0
329
Member Avatar for mixelplik

OK, I've acheived HULK SMASH levels of frsutration with this one. I simply want to parse a date in the form of ##/##/#### The code below works peicemeal, ie each part SEEMS to work, but if I cout at the bottom the day is dissapearing or spitting out erroneous crap. …

Member Avatar for David W
0
211
Member Avatar for Labdabeta

Hello, I have a file which I need to read which contains some unusual characters (EG: '╠') and I need to be able to read it and convert those characters to numbers. As an example of what I am looking for would be code that reads a file and prints …

Member Avatar for Labdabeta
0
435
Member Avatar for ashley.vanhoesen.7

I am trying to create a palindrome checker using a single stack and pass by reference method. I just have to write the evalPalindrome() method and then I input it into a web application which holds the main. For some reason, however, when the main is calling the pass by …

Member Avatar for David W
0
693
Member Avatar for cnsk90

#include<stdio.h> #include<math.h> int main() { int n,nstart,nstop,nstep,i,j,zNumber; ` printf("Please enter a value of a positive integer nstart: "); scanf("%d",&nstart); printf("Please enter a value of a positive integer nstop: "); scanf("%d",&nstop); printf("Please enter a value of a positive integer nstep: "); scanf("%d",&nstep); printf("Number\t\tzNumber\n"); printf("------\t\t-------\n"); n=nstart; zNumber= double pow(double_n,double_i); while(i<=nstop){ zNumber = …

Member Avatar for David W
0
778
Member Avatar for Yogesh_9

#include<iostream> using namespace std; int main() { int test; cin>>test; while(test--) { int start,end,m; cin>>start; cin>>end; bool arr[end]; for(int i=0;i<end;i++) arr[i]=true; for(int i=2;(i*i)<=end;i++) { for(int p=2;(p*i)<=end;p++) { m=(p*i-1); arr[m]=false; } } for(int i=start-1;i<=end;i++) { if(arr[i]!=0&&i!=0) cout<<i+1<<endl; } } return 0; }

Member Avatar for StuXYZ
1
373
Member Avatar for tolatallest

i need parallel program that can sort 500,1000,1500,2000 numbes in bubble sort,selection sort,insertion sort and merge sort.

Member Avatar for mike_2000_17
0
115
Member Avatar for OceanDesigns

Hi guys im a beginner at programming i started a book for beginners im only on lopps now but as uasuall i googled and wondered off into classes i keep getting this error, i initialized the float variables in the class by using the constructor. I'm not sure if this …

Member Avatar for OceanDesigns
0
116
Member Avatar for glao

If I want to multiple 2d arrays as 1d how should I do it? I mean ,I have a 2d array and I map it as 1d: for(int i=0;i<rows*cols;i++) A[i]=... I know how to multiply 2 arrays as 2d ,but representing them as 1d?

Member Avatar for glao
0
2K
Member Avatar for Mohamed_31

A space shuttle measured the distance between earth and Mars as a very large integer number of centimeters. Write a C++ program that reads such distance as centimeters and displays the kilometers, meters and centimeters equivalent.

Member Avatar for Elixir42
0
147
Member Avatar for tharindu123
Member Avatar for leonardo.hieu

Hey guy. I'm a new beginner in C++. I'm have some problem with my new code I have just written. I try to draw a triangles with from the characters "*". But it isn't work like I want. Here is it. `#include <iostream> using namespace /* Draw a triangles */ …

Member Avatar for David W
0
144
Member Avatar for Gupta_1

hi friend i would like to make a programe in c++(code block) . which include the fallling candy, and the candy is collected by a baby below. so could you help me to make that game in c++

Member Avatar for Ancient Dragon
0
131
Member Avatar for prajwaludupa

well i tried to execute the following code.. #include<process.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<stdio.h> void main() { system("dir"); getch(); } but it did not execute the system command... what went wrong?? plz mail me at [email]prajwaludupardx_369@yahoo.co.in[/email]

Member Avatar for sri.voma
0
677
Member Avatar for ansar.ahmed.7967

how and what statement is compiled by compiler. want to check step by step so that i can understand the logic of a program for example in nested for loop when and how many time inner loop will execute and when outer loop execute. hope understand my question

Member Avatar for NathanOliver
0
115
Member Avatar for Christoffer_S

Hi, First of all, I'm a newbeginner in C++. Ok, basically I'm tring to make a calculator with functions. Every function calculates either addition, subtraction, division or multiplication, pretty simple. Though I can't get it to call these functions! Here, take a look at my code: #include <iostream> using namespace …

Member Avatar for Schol-R-LEA
0
645

The End.