49,757 Topics

Member Avatar for
Member Avatar for moods125

#include <iostream> #include <iomanip> using namespace std; //global constants const int SIZE = 12; //function prototypes bool getAverageRainFall(double rain[SIZE]); bool getExactRainFall(double rain[SIZE]); void displayResults(const double actual[SIZE], const double average[SIZE]); void printMonth(int month); // PRECONDITION: month holds an integer 1-12 // POSTCONDITION: the corresponding month (Jan, Feb, ..., Dec) has been …

Member Avatar for moods125
0
197
Member Avatar for americanfire

Hello, I need help with re-ordering the values in ascending order in the array Unordered. However, I cannot use sort or swap functions. The values in array Index are used as indexes of array Unordered to put the values into the sequence shown in Ordered. I am writing this code …

Member Avatar for americanfire
0
142
Member Avatar for confusedndazed

Hello all, I'm very confused on this K factor stuff.....I understand that...1*2*…*k indicates the product of consecutive numbers and therefore: 1*2*…*5 is actually 1*2*3*4*5 = 120 But I'm not sure how to write that as a code. I have the following information: /* pseudocode for Binomial Coefficients */ int binomial(int …

Member Avatar for confusedndazed
0
150
Member Avatar for MegadanX5

Hi everyone, this is my first post on this site and I was wondering if anyone could help me with this. I'm sorry if my coding style is strange, I'm relatively new at this. The program is supposed to prompt the user to guess a number between 1 and 1000, …

Member Avatar for MegadanX5
0
158
Member Avatar for confusedndazed

Hello people, this is my second attempt to get help for the same code. First post is unsolved. I apologize for any confusion in my posts but I'm confused myself so it's somewhat hard for me to properly explain that which I don't even understand....:$.... I have been given the …

Member Avatar for lotrsimp12345
0
116
Member Avatar for PDB1982

Ok....I'm stuck again...I'm wondering if there is a way to sort the following code, so that I can pick out the highest value. I don't believe that I can make it into a list, since they are in parallel arrays. I'm hoping not to have to do a long set …

Member Avatar for PDB1982
0
118
Member Avatar for gsingh2011

I need to save an object to a file and then reload it later on. I think this is called serialization but I don't know. I have made a simple example below that I need to fix. [CODE]#include <iostream> #include <fstream> #include <windows.h> using namespace std; #define MAXV 1000 class …

Member Avatar for Ancient Dragon
0
113
Member Avatar for DanielL5583

I am making a modification for Half-Life 2 where the player has the clip sizes and reserve ammunition from the original Half-Life. I know it can be done, but finding it is hard enough. Does anyone know what codes to change to change the magazine sizes and reserves, to make …

0
41
Member Avatar for fatboyandy

Hi everyone This code works fine but the asterisks that print to represent the percentage is wrong. The example given was there was a total of 14 grades across the A-F range, but "A" had 1 and 1 should represent 4 stars one the chart. Whats wrong???? [CODE] #include <cstdlib> …

Member Avatar for Murtan
0
113
Member Avatar for nightninja12

i have to write a program database with investors names, ammounts invested, city, and the phone numbers. i have one binary search tree, unsorted where the key is the name and ammount, and a heap sorted by the ammount invested. now i need to display the top 3 cities (with …

Member Avatar for lotrsimp12345
0
100
Member Avatar for lotrsimp12345

i believe that it checks every nodes height and makes sure that the left -right is 1 or 0 or -1. It is supposed to return tree if tree is balanced which means that left-right is 0 or 1 or -1 at every node. [CODE] template <class KT, class DT> …

Member Avatar for lotrsimp12345
0
63
Member Avatar for micke
Member Avatar for donaldw
0
268
Member Avatar for miag

[CODE]#include "queue.h" #include <cstdlib> using namespace std; void queue::sort() { Node *nodeLeft, *nodeRight; double temp=0; int nofswaps=1; if(size>1)//check that at least two nodes exists in the queue { while(nofswaps>=1) { nofswaps=0; do { nodeLeft=pFront;//nodeLeft first time points to the first node of the queue and then points to next node …

Member Avatar for gastonci
-4
91
Member Avatar for simplyscottif

so I've got a lot of it done, I just need a hint as to the next step. So far I have the user entering a bank account, interest rate, and account balance. I need the user to enter an amount of years and the program will go through that …

Member Avatar for Murtan
0
223
Member Avatar for pac-man

I'm trying to configure my application so that a user without wxWidgets installed on their computer can compile the code. I'm not sure how to do this although I believe I have to use .DLLs? Has anyone got some info on how I can do this? Thanks in advance.

0
46
Member Avatar for Mclovin1234

Hi i am doing a program that has to add up the percentage for example if i get one question wrong it adds to the percentage and after i answer 20 questions i would get the final mark but i dont get why it doesnt work. [CODE] void multiplier(int difficulty)// …

Member Avatar for JasonHippy
0
99
Member Avatar for stevee1984

Hi all, and must say a great looking forum! I wish to start developing c++ apps on Linux and would like to know what GUIs are supports out of the box on Linux, especailly the main distros anyway? QT, KDE, GTK, etc? I basically want to write gui apps that …

Member Avatar for stevee1984
0
120
Member Avatar for lonprog

I have a project that I'm working on in C++ where I have to Search for Multiple Occurrences of a String in a Text File. Does anyone have code out there on how to do this? Thanks

Member Avatar for mrnutty
0
116
Member Avatar for mybluehair

So I have a game in c++ console, and it's pretty big now. (over 3 megabytes) I've been using strings in the code forever, but now, I need to make a separate exe program from scratch that will update the game when needed. Big problem - this new program is …

Member Avatar for Nick Evan
0
93
Member Avatar for arsenal23114

Hello all, on an assignment my professor has asked us to "paint" a few different shapes on a canvas. (square, rectangle, circle, ellipse) to keep it simple, I had no problem breezing through the square and rectangle. to help you understand, here's a bit of code from one of the …

Member Avatar for mrnutty
1
90
Member Avatar for CppBuilder2006

what's wrong with this code in VC++ 2008 Ex [CODE] #include <conio.h> #include <iostream> using namespace std; class Allocate { private: void* v; unsigned n; __int8 dummy_ret; void* Alloc(unsigned& n) { void* ret; if(n == 0) ret = 0; else { ret = new(nothrow) char[n]; if(ret == 0) n = …

Member Avatar for CppBuilder2006
0
81
Member Avatar for merse

Sorry about my primitive questions but I cannot find a good summary about this basic topic. So I would like to write my own libraries: mylib.h and mylib.cpp. I need to include some standard libraries. But I dont want to overload them, what is the solution? I have to use …

Member Avatar for Narue
0
146
Member Avatar for punchinello

Why would the following things be advisable? Prefer a plain int over a short int or a long int. Prefer a double over a float or a long double. Prefer plain char over signed char and unsigned char. Why ordering members of a struct by size can minimize wasted space …

Member Avatar for Narue
0
80
Member Avatar for rsaska

I am trying to write a program that 1. opens letterFile containing letters on each line 2. reads in first line of letterFile 3. save the pointer position of letterFile in pos 4. opens numFile containing numbers on each line 5. as it goes through numFile, outputs the letter from …

0
68
Member Avatar for lmkamvazina

I need someone to help me with a programme and the specifications are these: The task is to create a customer order system for an oil company who sells oil products to its customers. The customers are companies using the oil products in their machines or in their manufacturing processes. …

0
48
Member Avatar for bamcclur

So I pretty much finished a memory management simulator, and it worked for the test cases my professor gave me, but when I added a test case it didn't work as it should have. The main issue is, the first job will start, and finish, but the wait time wont …

0
50
Member Avatar for stari07

Hi all, I have a problem in sorting a fortran data and I don't know fortran. Its quite big data and its not in column arrangement. the sample is below : 3.900000000E 2.180E 0.000E 2.653E 1.763E2.339E-01 0.000 0.6983 0.2814 0.0001 0.0080 0.0067 0.0019 0.0007 0.0000 -3.6431 1.4826 7.3919 7.476000000E 5.000E …

Member Avatar for NicAx64
-1
305
Member Avatar for xagutxu

Hi! I am trying to implement a server-cgi with C++, but I don't know which is the best way for the cgi to communicate with the mysql server. In the mysql web, I have seen that there are "connectors", but I don't really know which is their functionallity. Should I …

0
66
Member Avatar for xagutxu

Hi! I am trying to implement a server-cgi with C++, but I don't know which is the best way for the cgi to communicate with the mysql server. In the mysql web, I have seen that there are "connectors", but I don't really know which is their functionallity. Should I …

0
75
Member Avatar for bgavran3

Okay, I have a simple problem. I want to print the value of N twice and then increase it (this is just a chunk of a bigger program, ie the one in which it makes sense to do that), however, the output is "1 0". [CODE] #include "stdafx.h" #include <iostream> …

Member Avatar for amrith92
0
134

The End.