49,761 Topics

Member Avatar for
Member Avatar for Foe89

Here's the problem, questions at the bottom. Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Released Running time (in minutes) Include a constructor that allows all 4 of these member data values to be specified at the time …

Member Avatar for Lerner
0
159
Member Avatar for gammavn

I meets some problem with downcast in c++ programming language. Thus, I needs your help. My program has 5 classes. They are Employee (abstract class),Salary:public Employee,Hourly:public Employee,Commission:public Employee and BasePlusCom:public Commission. In main() function,I used vector<Employee*>employees[4]; Then I assigned values to employees. ........ And I used structural syntax BasePlusCom* ComPtr=dynamic_cast<BasePlusCom*>(employees[i]); …

Member Avatar for vijayan121
0
185
Member Avatar for number87

ok basically what my program is about. I am to create a program that allows users to input aircraft/cargo details, add the cargo to the aircraft(up to 20), and a function to display all the cargo on that aircraft. So the main problem i am getting is with the listing …

Member Avatar for minas1
0
120
Member Avatar for insertnamehere8

Hi. This is for a phonebook assignment. Part of the assignment involves searching a 2D array. This is the function that reads the phonebook file. [code] void getData(char name[][NAMESIZE], char telephone[][PHONESIZE], char zipcode[][ZIPSIZE], char address[][ADDSIZE], int& size); ~~~~~ void getData(char name[][NAMESIZE], char telephone[][PHONESIZE], char zipcode[][ZIPSIZE], char address[][ADDSIZE], int& size){ int …

Member Avatar for insertnamehere8
0
220
Member Avatar for Stefano Mtangoo

Hello all, greetings! I'm python guy and I want to access Lame encoder from python. The big problem is I cannot find suitable lame bindings. After loooong googling and metacrawling, I found py-lame. The problem is, when I try to compile it in codeblocks, python.h is missing. I don't know …

Member Avatar for Nick Evan
0
95
Member Avatar for midimatt

Hello everybody, I'm back, started my 2nd year at Uni now and started programming in the wonder that is C++ and enjoying it tremendously. but I've hit a slight problem, not with code but with design. I'm not sure where to put the input/output, sounds weird but I'll elaborate. i …

Member Avatar for ithelp
0
140
Member Avatar for PaladinHammer

Here is the code: [CODE]// All this has to do is take the "names.txt" file, and send it to "backwards.txt" // in reverse order, as an array. No idea why its not working, sent all necessary files with it. #include <iostream> #include <fstream> #include <iomanip> #include <string> #include <ctime> using …

Member Avatar for PaladinHammer
0
230
Member Avatar for delner

I'm trying to do a program involving a base class and subclasses, whose subclasses use each other. In terms of code: [ICODE] Class Space { ... }; Class Room : public Space { Link* l; ... }; Class Link : public Space { Room* r; ... }; [/ICODE] Now I'm …

Member Avatar for Alex Edwards
0
71
Member Avatar for PaladinHammer

Here's the code: [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <string> #include <ctime> using namespace std; string getData(ifstream &fin, string array[]); //string getData(ifstream &fin, string array[]); This is what it SHOULD look like. void outputData(ofstream &fout, string array[], int numNames); //void outputData(ofstream &fout, string array[], int numNames) int main() { …

Member Avatar for Lerner
0
93
Member Avatar for mshefa
Member Avatar for MosaicFuneral
0
218
Member Avatar for afg_91320

im designing a program where it calls a function that uses the linear search algorithm to locate one of the values. function must keep a count of the comparisons it makes until it finds the value. the program then calls the binary search (a sep. function) to locate the same …

Member Avatar for Lerner
0
114
Member Avatar for RavUn

Hello, I know how to create a hash_map and use my hash function with it, but I don't know how to handle collisions. Specifically, how would I implement a chain/buckets with a linked list... it seems like it's built in but I can't find how to do it. [code] #include …

Member Avatar for RavUn
0
134
Member Avatar for mybluehair

Im making a program with lots of repeating code, so I decided to take all that repeating code and change it into an array. problem is, I've never worked with arrays before. I tried to look up alot of tutorials, and I understand it more now, but not enough to …

Member Avatar for Lerner
0
69
Member Avatar for dusse

How can I declarate a matrix of strings? if I write something like the line below, my code do not compile string a[MAX][MAX]; someone can give me a solution? thanks

Member Avatar for Lerner
0
113
Member Avatar for Arctic wolf

Hello everyone, I know there is a build in real time clock inside the computer and I know it's possible to use this clock when you write a program on Assembler(using an interupt that I don't remember at the moment),is there a way to use the real time clock while …

Member Avatar for Arctic wolf
0
646
Member Avatar for StainlessSteelR

I'm having some problems with a program that invovles arrays. I have a program that is suppose to read data from a file fish.txt about fisherman. The a function is suppose to print the number of fish that need to be thrown back because their is a maximum of 14 …

Member Avatar for VernonDozier
0
169
Member Avatar for techgenie

Hi guys I am working on a Lottery program to generate 6 unique numbers. So far I have the following: CLASS LOOKS LIKE THIS: [code=cplusplus] #include "stdafx.h" #include <string> #include <ctime> #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers class Lottery // Lottery class definition { public: …

Member Avatar for skatamatic
0
283
Member Avatar for gisek

Hi, Recently I came up with an idea of making my own program for tagging mp3 files. I realised I'm lacking in knowledge. For now I need the following information: 1. After typing a path to a main folder, I'd like to read the names of the folders inside. 2. …

Member Avatar for james_zheng
0
198
Member Avatar for egsonas

Hi everyone, I'm writting old "Battle ship" game. I know, that is very funny, but I want my own version, with one objects and inheretancy levels. Here is a plan what I'm reaching for: ---------------------------- object: A-level: - aship - keeps common parameters of floating things B-level - ship - …

Member Avatar for VernonDozier
0
252
Member Avatar for Lokolo

[code] int numOfMonths = numOfYears * 12; float monthlyRepayments; float actualRate = (rate/100)/12; //monthlyRepayments = (borrowAmount*(pow((1+actualRate),numOfMonths))*actualRate)/((pow((1+actualRate),numOfMonths))-1); monthlyRepayments = (100000 * (pow((1+actualRate),180) * actualRate))/((pow((1+actualRate),180))-1); [/code] Ok this is the actual equation: (100000*(1+A1)^180*A1)/((1+A1)^180-1) btw A1 =0.06/12 So the commented line is original one I tried, didn't work. So I tried just putting …

Member Avatar for Lokolo
0
148
Member Avatar for minas1

Hi. I made some headers I want to include in every project from the include directories. So I'll be able to do [I]#include <hello.h>[/I] instead of [I]"hello.h"[/I], and I won't need to place them in the same directory every time. So I did this: [IMG]http://i38.tinypic.com/2n1bdj8.jpg[/IMG] [IMG]http://i34.tinypic.com/33a4d1g.jpg[/IMG] but it doesn't work. …

Member Avatar for cikara21
0
234
Member Avatar for CodeBoy101
Member Avatar for kiwihaha
0
12K
Member Avatar for f.ben.isaac

I got some newbies questions, i hope to hear from you... Feel free to answer any! I will appreciate it so much if you answer them all :-) 1. Do AV's generally (windows security specifically) trust application written under .NET more than the ones written written under MFC & Win32 …

Member Avatar for ArkM
0
122
Member Avatar for KDan

Hi everyone!! First of all am quite new to cpp especially under linux. I am currently working on a small project under Linux and am having to deal with large number of data(larger than 1 GB). numerous number of operation is to be done with these data. for example: sorting, …

Member Avatar for james_zheng
0
170
Member Avatar for Judas

Using Dev-C++ Im a newbie to c++ Is it possible to save files using a variable as the filename. What i want to do is setup a text based program like a mud and be able to go from room to room and have it display room discription and available …

Member Avatar for cikara21
0
1K
Member Avatar for AutoC

Hi, I need help with implementing cyclic codes.Its much like crc.I've found a lot of software implementations for crc but havent understood them.I've looked at a crc guide which gave, [code] So to implement CRC division, we have to feed the message through a division register. At this point, we …

Member Avatar for vijayan121
0
154
Member Avatar for Kainan54
Member Avatar for Freaky_Chris
0
161
Member Avatar for Undermine

[code] #include <iostream> #include <cmath> using namespace std; int main() {//begin main double hypot(double,double); double base; double height; cout<<"Program to compute the Hypotenuse of a given right triangle. \n"<<endl; cout<<"Enter the base: \n"<< endl; cin>>base; cout<<"Enter the height: \n"<<endl; cin>>height; cout <<"The hypothenus of given triangle is " << hypot(base,height) …

Member Avatar for ArkM
0
102
Member Avatar for anbuninja

need help with this assignment. im having trouble with if and else. I enter package A and then it ask me for the hours twice. just run it if you dont get me. here are a few examples of how running the program should look, please help me!:S example 1 …

Member Avatar for WaltP
0
134
Member Avatar for mybluehair

I have writen a program that includes ALOT of code. I update this code and work on it everyday, and with so many lines, I get confussed. a big chunk of my code goes like this: [code] cout << "\nNext:\n"; cin >> string2; if (string2 == "end") { cout<< "ok, …

Member Avatar for MosaicFuneral
0
89

The End.