51,593 Topics

Member Avatar for
Member Avatar for Marvin_2

Develop a program that prompts the user to enter two (2) numbers. The program will display the numbers based on these conditions; if the first number is less than the second number the program will perform a swap operation on these two numbers and display them, otherwise the program will …

Member Avatar for Marvin_2
-1
97
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
445
Member Avatar for Baba Ki
Member Avatar for iamthwee
-2
112
Member Avatar for Casey890

Okay I have an array but how do I make it descending? I have it able to print out 1, 2, 3 but would rather have it do 1 2 3. code below #include <iostream> //Initalize Iostream using namespace std; void printarray(int arg[], int length) { //Print array function for …

Member Avatar for Casey890
0
156
Member Avatar for samkri

I have class within class public class List { public int RecordCount { get; set; } public IEnumerable<ServiceElementItem> ServiceElement { get; set; } } public class ServiceElementItem { public int ServiceElementId { get; set; } public string ServiceElementBusinessId { get; set; } public string Description { get; set; } public …

Member Avatar for TekknoDraykko
0
3K
Member Avatar for AQ

Hey guys ..!! so today I was solving another problem involving a loop in it and i'm not sure exactly how to apply that condition to repeat it unless the terminating condition becomes true. I tried to do it on my own but its not working. can anyone of you …

Member Avatar for NathanOliver
0
250
Member Avatar for akane.mikazuki

This is supposed to be a Rock-Paper-Scissors game. Everything's just going fine until I inserted graphics. What I was supposed to do is to display the figures I've poorly made whenever a choice is made. I can't really explain it so please take a look at my code, thanks (I'm …

Member Avatar for Schol-R-LEA
0
342
Member Avatar for Bendez Thyna

can someone give me some hint on how to use a array structure in a fuction?? Thank you

Member Avatar for NathanOliver
0
108
Member Avatar for Reg74

Here's the question : /* 4. Modify your showTree() function so that it produces the same output as dumpObjectTree() . QObject::A Stack Object QObject::Mike QObject::Greg QObject::Peter QObject::Bobby QObject::Carol QObject::Marcia QObject::Jan QObject::Cindy */ This is what i have thus far ... if(!childlst.isEmpty()) foreach(Person* t,childlst) { cout << "QObject::" << t->parent()->objectName() << …

0
109
Member Avatar for m..abdullah4

I want to do a program of c++ for power or exponent finding and it looks very diffcult.I could not understand it.Plz anyone help in both method By using loops By using <math>

Member Avatar for NathanOliver
0
84
Member Avatar for pww71

Title: The core of the core of the big data solutions -- Map Author: pengwenwei Email: pww71@sina.com Language: c++ Platform: Windows, linux Technology: Perfect hash algorithm Level: Advanced Title: The core of the core of the big data solutions -- Map Author: pengwenwei Email: pww71@sina.com Language: c++ Platform: Windows, linux …

Member Avatar for mike_2000_17
0
260
Member Avatar for tgreiner

OK, I've seen this error explained at least 100 times on the net. But in every case, it seems to be an error of #including <string.h> instead of <string> or metioning string instead of std::string. But, I've done all those things. And it still does not work. By way of …

Member Avatar for Schol-R-LEA
0
10K
Member Avatar for tentrabyte

#include<iostream> #include<cstdlib> using namespace std; int main() { srand(21); cout << "Unique numbers:"; for (int x = 1; x < 10; x++){ cout << 1 + ( rand () % 20) <<endl; } system("pause>0"); return 0; } Guys this is my program. Can i ask if how can i vertical …

Member Avatar for mridul.ahuja
0
198
Member Avatar for akane.mikazuki

I need help to display on the screen rock when user picks rock, paper when user picks paper, and scissors when user picks scissors. Thanks

Member Avatar for Schol-R-LEA
0
486
Member Avatar for andrew mendonca

C++ Programming Exercise: Implement a command-line calculator that allows the user to enter an expression containing numbers, variables, brackets, and operators. The calculator will also allow assignments to a variable. After the user enters the expression the program will evaluate it and display the value. If the expression is part …

0
145
Member Avatar for AQ

hey guys i was solving a question but there is something which is not working properly.. I'll provide you guys with question statement and my code below.The problem is occuring after the loop like if the avg is more then 0 still it shows the output massege as "terminating". Can …

Member Avatar for AQ
0
137
Member Avatar for ChrisP-C++

im looking to brush up on my C++ coding as its been a quite a few months since ive done anything with it and ive run into a snag with my coding and have spent hours with 2 Compilers (Bloodshed Dev C++ (where code was originally written)as well as Eclipse …

Member Avatar for mike_2000_17
0
376
Member Avatar for James_44

Please help. I really think I'm close to getting this. No I'm just banging my head against a wall. I have to replace a nested if statement with a switch statement. The loop should continue until Z or z is entered. I can't figure out what I'm doing wrong. #include …

Member Avatar for Moschops
0
135
Member Avatar for TheFearful

Hey guys, I just learned the very basics of arrays and I have to write this program of a tic-tac-toe game. The requirements are this: Write a modular program that allows two players to play a game of tic-tac-toe. Use a two-dimensional char array with 3 rows and 3 columns …

Member Avatar for マーズ maazu
0
3K
Member Avatar for Xsmael

I am developing Client-Server application in C++ using Qt framework, but the clients can be android phones and computers(Qt client app) Now i'm having troubles to handle Reception of data on the server side; the server is not receiving data properly. First, I got things working nicely between the server(Qt …

0
384
Member Avatar for negru

I have a C code written in Visual C++ 2010 environment and it compiles without errors. When I try to debug it, after the line with scanf() function it goes to unknown scope and stops the process of debugging. How to fix this? Thanks for replies.

Member Avatar for Moschops
0
222
Member Avatar for cambalinho

i have notice that using the joyGetPosEx() function, when the joystick isn't connected, that the memory, that the application uses, is increasing. so is there another way just for see if 1 joystick is connected to pc?

Member Avatar for cambalinho
0
583
Member Avatar for tentrabyte

How can i create a rounding off program using ceil, floor, srand and rand... thanksss

Member Avatar for deceptikon
0
85
Member Avatar for klewis32

The following code creates a Sorting Array using Pointers and functions correctly. The issue I have is I want the array to sort, but put the zeros at the end. Any help would appreciated. #include <iostream> using namespace std; #include <iomanip> using std::setw; void selectionSort( int * const, const int …

Member Avatar for David W
0
14K
Member Avatar for negru

Which tool for code analysis is the best for complex C programs? I use GCC debugger with Code Blocks 13.12 Thanks for replies.

Member Avatar for Moschops
0
203
Member Avatar for negru

I need help with recursion function. It prints all the prime factors of an input number. My question is how to modify function so that START-GOTO is replaced by a loop? Here is the code: int f(int n,int i) { start: if(n==1) goto start; if(n % i == 0) { …

Member Avatar for Moschops
0
172
Member Avatar for makungu

SCENARIO You must type in a list of numbers and make sure that in the list, there are no identical numbers; in other words, no number must appear twice in the list. When entering a new number, make sure that the number does not exist in the list yet. If …

Member Avatar for deceptikon
0
93
Member Avatar for ghalib951

What is the output of program segment: vecList: push_back(3); vecList: push_back(5); vecList: push_back(7); vceIt = vceList.begin( ); ++vecIt; vecList.erase(vecIt); vecList.push_back(9); copy(vecList.begin( ), vecList( ).end( ), screen); cout << end1;

Member Avatar for NathanOliver
0
191
Member Avatar for can-mohan

Hi Guys, In below code you can see that i am able to execute the functionality of class a , inside the class b through composition and object of b can be used to call the methods declared inside the a class. #include <iostream> using namespace std; class a { …

Member Avatar for can-mohan
0
438
Member Avatar for exoruel

All of us started from being a rookie, and I'm one of those rookies who are new in this course. Maybe its time for you to share your expertise unto the newbies? Hope anyone might help me willingly in my program.Here's the problem: Use Pointers and Functions: Ask a user …

Member Avatar for David W
0
266
Member Avatar for DS9596

How do I write a recursive function to compute (3^2)+(3^3)+(3^4).......+(3^n) ?

Member Avatar for David W
0
405
Member Avatar for can-mohan

Hi guys, I would like to discuss my design with one query. below is the code snippet. It is clear from below code snippet that class pd is privately derived from AbstractClass as both are different classes and there is no relation between them.Now in my class pd i need …

Member Avatar for can-mohan
0
428
Member Avatar for daniel1977

Greetings: I have been struggling to clear this error I have in my code, but I cannot for the life of me find it. Error: End of File detected before Left Brace Attached is my code, appreciate any help. #include <stdio.h> #define SIZE 20 int i, j; int temp[SIZE], pressure[SIZE]; …

Member Avatar for NathanOliver
0
207
Member Avatar for Brown_2
Member Avatar for DS9596

How do I write a program to compute run-time of a recursive and non-recursive functions to find the 43rd Fibonacci number?

Member Avatar for Schol-R-LEA
0
291
Member Avatar for Tycellent

Hey everyone, Got 2 questions here that i'm hoping will be answered. Say i have 2 variables int iValue; int iValueArray[300]; and later on init. them in the constructor Banana::Banana(): ival(0), ivalArray() {} 1. What would the ivalArray() indicate? Would it be the same as initializing every element to null/empty? …

Member Avatar for Tycellent
0
335
Member Avatar for DS9596

I'm not sure if I'm doing this part correctly, the part where I have to make it all lower case then to all upper case, then just first name. #include <iostream> #include <cstring> #include <stdio.h> using namespace std; int main() { char a[3][14] = { "Barack ", "H", " Obama" …

Member Avatar for DS9596
0
1K
Member Avatar for Jazmine_1

Hey everyone! So I need to write two header files and they attach to the main cpp file, but we can not change the cpp file. They have to attach and make the program run. Please help! Main cpp CANNOT be changed! //22 34 56 4 19 2 89 90 …

Member Avatar for Schol-R-LEA
0
249
Member Avatar for Mubashir_1
Member Avatar for ghalib951

`Inline Code Example Here What is the output of the following code: int x; int*p; int*q; p = new int [10] ; q = p; *p = 4; for (int j = 0; j<10; j++) { x = *p; p++; *p = x + j; } for (int k = …

Member Avatar for NathanOliver
-1
132
Member Avatar for nitin1

Why can we virtual destructors but can't have virtual constructors? I have searched like anything. I got confused a lot after reading few articles on web. Please explain with some good example. Thanks in advance.

Member Avatar for serpi90
0
143
Member Avatar for Kenneth_3

I have just finished a merge and sort code for two seperate files. My two inputs are: File 1 Adams C Benton A Jones D Haley A King B Margaret F File 2 Barnes A Charles B Johnson C William D and it keeps doing this for my out put …

Member Avatar for Kenneth_3
0
379
Member Avatar for Reg74

I'm having some trouble attempting to implement the constructors for each class. I have this constructor for the class Transaction. Is this correct ? Transaction::Transaction(QString type, QDateTime datetime) : m_Type(type), m_DateTime(datetime) { } AND how do i implement the constructor for the class Deposit ? Is this correct ? I'm …

Member Avatar for David W
0
232
Member Avatar for shizu

Hi all.. I saw a part of codes which I unable to understand.. pleaase all the expert teach me ya.. below is the part of codes.. UINT A; USHORT B; USHORT *C; CString D; if(!sscanf_s(D, "0x%x", &A)) sscanf_s(D, "%d", &A); *(C + B) = A; //<= what is the meaning..?? …

Member Avatar for NathanOliver
0
160
Member Avatar for vinod111

To print this pattren using c++ code 123417181920 --567141516 ----891213 ------1011

Member Avatar for stultuske
0
129
Member Avatar for Jace_1

HELP:How to transmit data with ZIGBEE using visual studio c++ Two xbee series 2: XBEE 1-connected to a pc(which transmits data to my other xbee) XBEE 2-receives data;connected to a LCD. Thanks in advance.

0
112
Member Avatar for bernardine

how can i put this in a flowchart form? need for my project and where will i put all the void? #include<stdio.h> #include<time.h> #include<process.h> #include<string.h> #include<conio.h> #include<dos.h> /*Placement*/ void order(); void lo(); char *date; /*header*/ char hdr[]="\t\t\t\t Pizza Hut\n\t\t\t\t Billing System\n\t\t\t Philippines Food Corporation\n"; /*opening*/ void main() { clrscr(); int …

Member Avatar for Schol-R-LEA
0
213
Member Avatar for Vahid_1

Hello, I'm just started to study malloc and realloc, so i just wrote this program to copy two string from user input and consenterate them. then ofcource print it. #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *str = malloc(3) gets(str); int sl = strlen(str); str = realloc(str, …

Member Avatar for sepp2k
0
219
Member Avatar for Ogua

write a program to be used in a supermarket to display an item togetter with the price and to add the price and balance shown on the screen where neccessary

Member Avatar for ddanbe
0
122
Member Avatar for bernardine

is void a declaration, and are there more other than the int, char, float, string?

Member Avatar for DaveAmour
0
57

The End.