49,760 Topics

Member Avatar for
Member Avatar for Praveen_10

#include <iostream> #include <cstdlib> using namespace std; // function prototype for add int add (int x, int y); int sub (int q, int r); int mul (int s, int t); int divi (int u, int v); int main () { int a,b; char ch; loop:cout<<"ENTER CHOICE OF OPERATION: + - …

Member Avatar for Praveen_10
0
272
Member Avatar for thanh.truong.1272

I was asked to create a program to find word frequencies, word length in a text file. I am able to use map to do the frequencies part but don't know how to sort the the output accordingly to the length of the words. The example output that I should …

Member Avatar for uonsin
0
560
Member Avatar for jhender4880

I have to take a 5 element array and use a function with pointers to make a new array that is one element bigger and shifted 1 place. I have it working so that it shifts one place but the function isn't making the array one element bigger. Any sugestions? …

Member Avatar for jhender4880
0
220
Member Avatar for Siberian

Hi, I didn't know where to place this thread :) Any recommendations for an IDE app to save snippets of code within the program, I looked online, and there are many options, too hard to pick ! :)

Member Avatar for Siberian
0
323
Member Avatar for pooja_4

hey can any one try out this problem.... 1)Write a program to read a sequence of N integers and print the number that appears the maximum number of times in the sequence. INPUT Input contains two lines. First line in the input indicates N, the number of integers in the …

Member Avatar for Faizal Shariff
1
293
Member Avatar for memo_1

Write a C++ program to perform the following: 1) Input a positive integer total that represents the total distance in meters a person needs to travel. 2) Input a positive integer first that represents the distance of the first jump. This distance should be less than or equal to total/20. …

Member Avatar for Schol-R-LEA
0
99
Member Avatar for admiri92
Member Avatar for rajii93
0
482
Member Avatar for jeevan reddy

I have a server and a client. I wrote handlers for send button and receive. When I send a string I am receiving only first two chars and then some japanese chars of the string on the receive side. I wanna receive the entire string.Please help me . This is …

Member Avatar for jeevan reddy
0
191
Member Avatar for shubham.goel.41995

I want to make a project on online examination which have some similar view like amcat and also have a view which run programs online.

Member Avatar for invadev
0
283
Member Avatar for fatmah

hi , i have a very simple Family tree project using GUI..... and i have two forms ! the first form ask the user to enter the number of child the parent have then in the 2nd form there will be a box as the number of child like when …

Member Avatar for ravi_14
0
113
Member Avatar for ckide
Member Avatar for Dang_1

hi everyone, i need some help. This is my problem. When I input a string to the program, I want the screen console print out '*'. ex: string s; cout<<"password :"; getline(cin,s); when i type "abc123" for the password. The screen console will show "******". I'm sorry about my poor …

Member Avatar for Ancient Dragon
0
489
Member Avatar for ravi_14

i was reading a book and came across this line "C++ matches a pointer of any other type with type void * and prints a numeric representation of the address. If you want the address of the string, you have to type cast it to another type," please any one …

Member Avatar for Ancient Dragon
0
185
Member Avatar for shadowplayer28

when converting iget erros especially in the cin parts because they are automatically passed by something #include<iostream> #include<conio.h> #include<math.h> using namespace std; int p=1; class Bank { public: char name[50],address[90],type; double ein_betrag, aus_betrag; double balance; int costumernr, accountnr, birth, tel; public: void newcostumer(); void newaccount(); void costumerdel(); void accountdel(); void …

Member Avatar for Schol-R-LEA
0
311
Member Avatar for trantran

I am writing a class that uses different policies stored in classes I want to declare this class by simply selecting the policies by writing `my_great_class<policy45, policy22, policy12>` (There can be a varying number of policies) which would translate automatically into: struct empty_class{}; struct policy12: empty_class{ // code... }; struct …

Member Avatar for trantran
0
607
Member Avatar for s11109753

A.3 Car rental 3 This program is for a car rental agency. Your program will have to compute the total cost of a rental. This agency has two types of cars, and the rates per day are as follows: All cars come with a basic insurance that covers damage to …

Member Avatar for vmanes
0
130
Member Avatar for smitsky

I'm having trouble displying the contents of a queue. When I pop the queue here: for( int i = 0; i < diskQueue.size() + 1; i++ ) { cout << left << setw(0) << "--d" << i+1 << left << setw(4) << " " << left << setw(14) << diskQueue.front().getFilename() …

Member Avatar for smitsky
0
218
Member Avatar for ivan3510

Hi! This is just an example code: #include<iostream> using namespace std; int& example() { int a=5; return &a; } int main() { cout << example(); } But I'm getting this error: Error: invalid initialization of non-const reference of type 'int&' from an rvalue of type 'int\*'

Member Avatar for ivan3510
0
201
Member Avatar for ashley.vanhoesen.7

I am writing a program to input data from a file, format it and then output to another file. For some reason when i make the file I get this error: ----jGRASP exec: make g++ -ggdb -c Billionaire.cpp iostream:39:0, from Billionaire.cpp:7: c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream: In constructor 'Billionaire::Billionaire()': ostream:384:7: error: 'std::basic_ostream<_CharT, _Traits>::basic_ostream() [with …

Member Avatar for ashley.vanhoesen.7
0
4K
Member Avatar for smitsky

Hi. Can someone explain why this isn't working? #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; int pmem, plen; int dmem, dlen; int cmem, clen; class PCB { public: PCB() : pid( 0 ), …

Member Avatar for smitsky
0
139
Member Avatar for smitsky

Hi. I'm trying to access some data in a List using an Iterator, but I'm getting an error message: #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, …

Member Avatar for smitsky
0
219
Member Avatar for gu mi nam

this code was error.please help me fix it include <iostream> include <conio.h> include <algorithm> using namespace std; int a[]={1,5,7,4,9,8}; BST*binary_search_tree; struct BST{ int value; BST* left; BST* right; }; int search_bst(BST* node,int key){ if(node==NULL) return -1; if(key<node->value) return search_bst(node->left,key); if(key>node->value) return search_bst(node->right,key); else return node->value; } void insert_bst(BST* &treeNode,BST* newNode){ …

Member Avatar for gu mi nam
0
397
Member Avatar for smitsky

Hi. Can someone tell me why the following code is giving me an error message? Thank you. #include <iostream> #include <list> #include <string> #include <iomanip> using namespace std; /** * Global Variables */ int printer; int disk; int cd; int num; string k; int pmem, plen; int dmem, dlen; int …

Member Avatar for smitsky
0
420
Member Avatar for catastrophe2

Hello I have to do a sorted list code according to some instructions. a friend and I worked on this, and we pretty much ended up with the same code, his worked, but mine isnt, even though its exactly same! I have been trying for hours figuring how to make …

Member Avatar for catastrophe2
0
1K
Member Avatar for utsav.srivastava.56

Write a program that reads an MxN matrix A and prints its elements in spiral order. You should start from the element in the 0th row and 0th column in the matrix and proceed in a spiral order as shown below. 1→ 2→3→ 4 ↓ 5→ 6→ 7 8 ↑ …

Member Avatar for David W
0
66
Member Avatar for printf.me

create a code that will read a file for an input which is a matrix,(rows and columns of the integers) and be able to output the transpose of it. original matrix 3X4 transpose matrix 4X3 1 2 3 4 1 5 9 5 6 7 8 2 6 0 9 …

Member Avatar for David W
0
97
Member Avatar for <iostream>

Write a C++ program that would display the menu of a restaurant and will accept orders, compute for the total amount and compute for customer change after entering the given cash. The program should be looping and will end once the user answers No to the question: Another Customer (Y …

Member Avatar for rubberman
0
132
Member Avatar for nitish.mohiputlall

here are my codes: #ifndef STUDENT_H #define STUDENT_H class student { public: void enterDetails(); void enterModule(); void displayDetails(); private: char name[100]; char studID[100]; char address[100]; char module[100]; }; #endif i want to add a 2d array "M[row][col]" in my class but i don't know how to do it anyone help?

Member Avatar for Edward_3
0
179
Member Avatar for cavin.gm
Member Avatar for <iostream>

guys help with this. sorry about my post earlier. im just new here in daniweb comm. i dont know the rules yet. i have a problem . i don't know the correct equation for this one. i don't get the correct answer .please help. amount=amount+price*quant; is this correct? #include<iostream> #include …

Member Avatar for David W
0
150

The End.