49,761 Topics
| |
im using the dev c++ compiler. the same one as at my high school. its a pretty basic program, it just wants me to read in 10 random numbers and show the average of the ten numbers and then list any of those numbers that is above the average. (using … | |
I need to write a program that reads a text file and counts the characters in each line. The program should display the line number and the length of the shortest and longest lines in the file, as well as the average number of characters per line...This is what I … | |
I've created a class PulldownArray, which contains two strings Value and Description. I created an array of this class called PulldownTABLE with the ArrayList^ command in my main program and I then populate it with the .Add method. All this works fine. How do I retrive the Value and Description … | |
Hmmm...I completed my console hangman game last night and it was working fine. I got up this morning and fiddled with it a bit and must've done something I was unaware of and slightly broke the program's ability to recognize either the answer guessed was correct or not. It prints … | |
I want user defined function i.e.power()function programn using function concept in c language. | |
I closed out the other post I had "fill 2d array". The assignment is to read in a file to a 2d array that has the month #, high temp, low temp for each month. Then calculate the aver high and aver low and give the highest and lowest temps. … | |
I am in my last two exercises and need some assistance starting these as I have no idea what I am doing with these... 1. Write a function replace_all(), such that a call newString = replace_all(str, substring, newSubstring); will return a copy of string str with each occurrence of substring … | |
I am using Visual C++ 2010 express edition and i am making classes but when i run i get the error: 1>c:\documents and settings\louisa\my documents\visual studio 2010\projects\ninja wars\ninja wars\game.cpp(71): error C2065: 'm_pScreen' : undeclared identifier [ICODE] In my Game.cpp i have this code void Game::Draw() { Sprite::Draw(m_pScreen, testSprite, 0, 0); … | |
Hey guys I'm having a lot of trouble getting this program to work. I want to keep an inventory of different tools using a random-access file that shows the name of the tool, how many of each tool I have on hand, and the cost. I then want to put … | |
I am trying to write an algorithm to determine the average of a linked list of real numbers with the first node pointed to by first... ptr = first; while (ptr != null_value) { //not sure what to put in here } Can someone take a look of this short … | |
I am working on another linked list problem...really been struggling with this chapter dealing with lists...Here is the instruction for this example... Write an algorithm to search a linked list with the first node pointed to by first for a given item and, if the item is found, return a … | |
Hi there, quick (and I am sure) simple question on a program I have just created. here's the code: [CODE]#include<iostream> using namespace std; int main() { char letter; int counter=0;//set the counter to 0 for (letter=65; letter<=122; letter++) {if ((((((letter==91)||(letter==92)||(letter==93)||(letter==94) ||(letter==95)||(letter==96))))))continue; counter++;//increment the counter in the loop if (counter==27)//counter condition … | |
Hello daniweb forum members! Just a quick question which has hindered my programming greatly. I am creating an online role playing game: vorii - [url]http://www.youtube.com/watch?v=ePNxDlZ2H7Q[/url] And I have come across a problem with the chat interface. The way I have programmed my game is that each player as a place … | |
I can compile and run the program, but cannot output the text file and print the member list result. Anyone can advice the solution? Thanks. 1. Add new member information 2. Print member list 3. Exit #include<iostream.h> #include<fstream.h> #include<dos.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<string.h> #include<iomanip.h> struct student { char Stdid[7]; char … | |
hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { … | |
HI, i am Nishank and have got a project -to make periodic table by using the following a. Data Structure b. Object Oriented Programming in C++ c. Data File Handling through the program the user should be able to: a.view the periodic table b.edit the periodic table c.delete a record … | |
Im trying to access the objects in the vector array that ive created in the bid class. I need to access the first ask bid and then continue to compare the price and the quantity with the first buy bid. I dont understand how on EARTH im supposed access these … | |
Hai friends, Me too have some doubts regarding C++. What happens if a pointer is deleted twice? Which is a better option --pass by value or pass by reference ? | |
Hello guys, My problem is that my code will automatically go through: [code]if((ask[i].getPrice()) <= (buy[j].getPrice())){[/code] where ask and buy are vectors. I need to know how I am suppose to compare them based upon the getPrice()...... Thanks in Advanced. The rest of the code is here: [code] int i=(int)ask.size(); int … | |
Hey all, I've elected to write a console hangman game and I've completed it just fine. However, one thing is evading my logic as to why it wouldn't work. I want it to "appear" to LOAD GAME" at the beginning like so: "LOADING GAME....." The total wait time I want … | |
I have a class which accepts vectors from another class called trader. This is the simulator class: [code] #include<vector> using namespace std; class Simulator { Trader trader; Auctioneer auction; public: void run(); }; void Simulator::run() { trader.setBid(); auction.BidID(trader.getBidID(vector<int>)); auction.TraderID(trader.getTraderID(vector<int>)); auction.Quantity(trader.getQuantity(vector<int>)); auction.Price(trader.getPrice(vector<int>)); auction.Type(trader.getType(vector<char>)); auction.showbid(); auction.matchBids(); }; [/code] In these lines: [code] … | |
Hello, This summer I am looking into doing some research to enhance my undergraduate resume for graduate schools. The research that I am looking into requires that I have the ability to access and manipulate sound files (specifically music) so that I can perform statistical, machine learning and categorization algorithms … | |
This is a small program that is suppose to find out the sum of even numbers entered into an array.... but everything works fine without errors but the output am getting is a negative number.... -1717986920. [CODE]#include <iostream.h> void main() { int sum=0; int i, a[6]; int range; cout<<"Enter a … | |
Ok here is what I want... I want to read the Dictionary file, and output its contents into the dynamic-text.dat file... But it reads the dictionary file and it will not write to the dynamic-text.dat file and I have no clue why... what am i doing wrong.. when I split … | |
Hello, I cannot figure out why my program crashes when it gets to the code below. Everything else in my coding works, except when I go to run this code... [code] void Auctioneer::matchingGame(){ vector<Trader>::iterator it; int i=ask.size()-1; int x=0; int y=0; int bId; int tId; char h; int temp=0; int … | |
Assignment - read an input file that has month, highest temp for month and lowest temp for month. I have to use a function called GetData to fill the array. I define the array as 12 rows and 3 columns. Please could someone look at the code I have and … | |
Hi Would anybody be able to tell me if there is a book or any material ot there explaining what kind of widgets you can get for C++. I'm not sure what kind of widgets are available in terms of functionality. When I say types I mean say textbox or … | |
hey guys, this is what i have so far... this part is from the main.cpp [CODE]double x; cout<<"Enter a number to search for: \n"; cin>>x; list.search(x); if (list.search(x)) cout << "\n" << x << " IS on the list! AT POSITION :" <<endl; else cout << "\n" << x << … | |
i have this code and for an class work task and you have to do a walkthrough table and work out the output. But i dont know how you do a walkthrough table. Can someone help? [CODE] int c = 0, sum = 0; while (sum < 8) { c++; … | |
Hi there, I have written a simple program which I know a solution to, I simply don't understand why the version below doesn't work. I have investigated the answer to roughly how it goes wrong, I just don't know why! Where the problems begin is commented in the last six … |
The End.