49,761 Topics
| |
For this assignment, I am supposed to get a starting population, an annual death rate, an annual birth rate, and the number of years to display. I am then supposed to use these values in the formula n = p*(1 + b)*(1-d), where n is the projected population, b is … | |
This is homework so I am not looking for a better way to do this. I am only asking for a second pair of eyes to spot my mistake. I have a function that takes a two-dimensional array and fills the first row with the elements from a one-dimensional array. … | |
//write a program whih takes input until user enters a negative number. print the sum of given inputs. #include <iostream> using namespace std; int main () { int a[10]; cout << " enter numbers " << endl ; int i = 0 ; while ( i < 10) {while (a[i] … | |
#include<iostream> #include<cstdlib> #include<string.h> using namespace std; template<typename X>class list { X *l[10]; public: void insert(X *ele); void display(); }; template<typename X>void list<X>::insert(X *ele) { static int i; l[i]=ele; i++; } template<typename X>void list<X>::display() { static int i; cout<<"\nThe Name #:"<<i<<"\t"<<*l[i]<<endl; i++; } int main() { string s; list<string> l1; cout<<"\nEnter … | |
I have a task to disply user entered values in a single line while using cin and cout objects. Any one can help me to understand this?? My question is when a user enter a value in any veriable, cursor sholud not move to the next line... Please help if … | |
I have an assignment due at 8:00PM. I've had a ton of work to do this week and haven't really got to learn the topic before the assignment. I'm just trying to get the points for the assignment and learn the stuff after its due. Problem: You are to create … | |
In my program the commands are on left hand side , I want to move thses buttons to middle of window on click of mouse. I wrote this code n=but buttons are disappearing. Any solution case WM_LBUTTONDOWN: RECT buttonScreenRect; GetWindowRect(hButton, &buttonScreenRect); POINT buttonClientPoint; //buttonClientPoint.x = hButton.left; buttonClientPoint.x = buttonScreenRect.left; buttonClientPoint.y … | |
#include<stdio.h> #include<stdlib.h> #include<iostream.h> #include<string.h> void main(){ FILE *fp1,*fp2; char *a,*b; int num; fp1=fopen("myfile.txt","r+"); fp2=fopen("myfile.txt","a+"); cout<<"enter the number of names you want to enter \n"; cin>>num; a=(char*)malloc(80); b=(char*)malloc(80); while(num){ gets(a); fputs("\n",fp2); fputs(a,fp2); num--; } cout<<"\n diplay the names"; while(!feof(fp1)){ fgets(b,80,fp1); cout<<b; } /* //code to search string a in file ... … | |
I have search though multiple similar topics but still can't find the answere. Would you please help ? The error is : **invalid initialization of reference of type 'ArrayT<float>&' from expression of type 'const Arrat<float>'** The above errors occur when I tried to do the following code , with operator* … | |
Guys, can you help me with my project I can't see what's wrong with my program. The errors are: Line 138: Expected primary-expression before "int" Line 138: Expected ';' before "int" Line 158: Expected '}' at end of input #include<iostream> using namespace std; int telephone_bill() { int choice, min, tbill, … | |
Hello! I am coding in windows form application c++/CLR I need help with coding a way to read everything in a folder, put the names of the files and put the names in a combobox. These files are for now images (.jpeg). And I would also like that, when I … | |
**I Have Problem Making This Program .Anybody please make this program for me.THANKS** Write a program to calculate a^b without using any built in function. The values of a and b are to be taken from the user. | |
Hello, I am trying to interface with a laboratory instrument using C++. I realize that my C++ experience falls short of desirable for this task; I am a self-taught amateur C# programmer delving into C++ and much of the code I have written is new to me. However, I have … | |
I have been looking for Prim Algorithm on daniweb.com website and I found multiple threads dead but still unsolved. Few people needs expalination of Prim Algorithm and others need its working code. Well, to help everyout out, here is a link to working Prim's Algorithm code which is easier to … | |
#Include<fstream> #include<> #include<iostream> #include<string> using namespace std; int main() { string str="time is a great teacher, but unfortunatly" "it kills all its puplis. Berlioz"; ofstream outfile("ali.TXT");//ERROR for(int j=0;j<str.size();j++) outfile.put(str[j]); cout<<"file written\n"; //system("pause"); return 0; } please correct my code"ofstream outfile("ali.txt")" | |
**** Hey guys, I really need help on this. I just submitted my exam but I won't get feedback till next week. I'm hoping that you guys can help me review. Thanks! Question 1 For each non-static data member of a class, C++ allocates only one memory space. Question 1 … | |
when i uncoment this line 144; i have error , and i debug and it was good, can anybody help me why i got this kind of error mybe should i declare List<employ>* list2, but it must wrok good like normale way List<employ> list2 #include<iostream> #include<fstream> #include<string> using namespace std; … | |
In this exercise, you will create a program that adds, subtracts, multiplies, or divides two integers. The program will need to get a letter (A for addition, S for subtraction, M for multiplication, or D for division) and two integers from the user. If the user enters an invalid letter, … | |
| CSCI 15 Assignment #3, introduction to classes/objects. 100 points, due 10/21/13 A mixed expression is an expression of the form a + b/c, where a, b, and c are integers, b >= 0 and c > 0. By convention, b/c is always non-negative, and has the property that 0 <= … |
Good day! I would like to ask on how to reverse arrays and putting it on another array of char? string str; int k=0, count = 0,namelength, acc=0; char name[80]; char extract[80]; char reversing[80]; for(int j=0; j<strlen(extract);j++){ reversing[strlen(extract) -j]= extract[j]; } for(int w; w<=strlen(extract);w++){ cout << reversing[w]; } Is it … | |
class test { virtual void created(){}; //i must do these. //or when i call the function the compiler give me an error test() { void created(); } }test; void test::created() { cout << "hello world"; } these code have 1 error. but how can overrride the created function? | |
Hi All, I want to grab TV Tuner Raw Samples for implementing FM receiver. I need to have mechanism to Tune desired frequency and then grab Samples of that frequency, in this case it would be IF samples and then implement FM receiver over it. I have already seen various … | |
Hello Guys, Is it possible to connect C++ Console app to MS Access? | |
I m trying to convert C code to C++. Facing some difficulties help me out! //This is struct typedef struct index { int id; char word[20]; int count; }indexs; // Function prototype void fileScanner(FILE * ifp,int i); void fileRead(FILE *ofp); int findString(char s[],char u[]); int searchEntry(indexs [],char key[],int n); void … | |
| CSCI 15 Assignment #3, introduction to classes/objects. 100 points, due 10/21/13 A mixed expression is an expression of the form a + b/c, where a, b, and c are integers, b >= 0 and c > 0. By convention, b/c is always non-negative, and has the property that 0 <= … |
hi all, i want to start building an authentication server which authenticates the clients to the e-commerce web site . do i need -for example- apache server,or WAMP and then write my code on it, i've not did a server side prgramming before.iam going to use Qt . i don't … | |
Hi, I m facing difficulties in replacing this C code with C++? For e.g : Can we use Fopen in C++? Please suggest me changes here to make it c++ equivalent! How to write this in C++ --> void fileRead(FILE *ofp); void fileScanner(FILE * ifp,int i); void fileRead(FILE *ofp); int … | |
I have to write a fn squeeze(const string &s, char c) for ex squeeze("haaaaah" , 'a') should give the output hah | |
hello fellow programmers, i am doing an assignment for class and i am having a bit of trouble. So the assignments reads Given two sorted (in ascending order) lists of size M and N, write an O(M+N) algorithm to find the sorted (also in ascending order) union of the two … | |
I am new to classes and was trying to create an elmentary program to understand classes and objects. I ve created three files 1) header file for class declaration 2) class definition .cpp file 3) class implementation main .cpp file I cannot understand the error I am getting. Please help. … |
The End.