49,761 Topics
| |
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 … | |
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]); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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() { … | |
How do I write a C++ class program to convert temperatures from Celsius to Fahrenheit and vice versa? | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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: … | |
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. … | |
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 - … | |
[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 … | |
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. … | |
How do I change the icon of the exe. in console mode? (as part of the exe itself) :?: | |
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 … | |
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, … | |
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 … | |
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 … | |
| |
[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) … | |
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 … | |
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, … |
The End.