49,761 Topics
| |
anybody can help me? How to culculate totalsale for each division.. I've tried many time but failed.. my coding is below [ICODE] #ifndef DIVISIONSALE_H #define DIVISIONSALE_H class DivisionSale{ private: double sales [3]; double totalSales; public: DivisionSale(double,double ,double ,double); double getQuaterSale(int); double getDivisionSale(); void culculateTotalSale(DivisionSale[], int); }; #endif[/ICODE] [ICODE] #include "DivisionSale.h" … | |
Anyone can help me to write a code in C++ to reverse a string. Example: i/p= " string with space " o/p= " ecaps htiw gnirts " Better if we use function or class. Thanks in advance | |
As part of a school assignment, I have to analyze a binary and determine what is does and what it takes to cause the various "branches" (if statements) to be triggered. I performed a strace on the file and the only part that stands out is a gettimeofday call: [CODE]gettimeofday({1303744469, … | |
Hi all, I am constructing a program on TCP sockets. The server should be able to accept connections from more than 1 clients. My programs seem working fine when accepting connections. Now the problem is: when I try to terminate one of the client programs, the server program would also … | |
Hi guys: I am constructing this simply code to read a number of columns in a file, get a number and produce a new file. I am just not certain what is wrong. I used the same standard as an old code of mine so it should work but I … | |
OK im having a problem which I feel should be super easy within windows API gui programming, but I dont know how to go about it the right way. On a givin HWND when a single mouse click is qued and my program recognizes it and my windproc processes it … | |
I've been searching this for a little while now and I'm absolutely unable to figure out what the problem is. This is the code I'm having the issue with: [CODE] std::vector<std::string> TexName; TexName.push_back("mega.png"); [/CODE] and I get... error: 'TexName' does not name a type I've included both vector and string … | |
[CODE] #include <iostream> #include <vector> #include <iomanip> using namespace std; class DAI //DynamicArrayInput { public : void getCountry() { cout << "Country : "; cin >> Country; } void putCountry() { cout << Country << endl; } static int putCount() { return count; } private : static int count; char … | |
Hi. Im a newb programmer. I m wondering... 1.what exactly is an api. I cant seen to find a clear answer 2. How do i use them in c++ | |
Hi i am writing a program to compute the smallest number divisible by each of the numbers 1 to 20. This is what i have so far but it does not cout anything. it just gives me a blank page. Could anyone please help [CODE]#include<iostream.h> #include<math.h> bool div(ull y) { … | |
Hey, so im creating a work example for school and right now i'm working on an "address book" sort of. I have three options the user can select add, view, and delete contacts. I want the "view" option to be able to search for first and last names inside of … | |
Using an appropriate definition of listnode, design a simple linked list class with only two member function and a defult constructor: void add(double x) boolean isMumber(double x) LinkedList(); The add function adds a new node containing x to the front (head) of the list, while the isMember function tests to … | |
Hi , I've written following program that takes a four digits integer from user and shows the digits on the screen separately i.e. if user enters 7531, it displays 7,5,3,1 .Any one can tell me how it can be written better and how to display digit in linear order i.e. … | |
I'm having troubles with a cin statement in my code and need some guidance. I need my code to refresh an array with completely different ASCII characters, then have the user enter a keystroke and have the refresh speed increase by a few hundred miliseconds every time. Now my C++ … | |
I recently received an 'A' on a program I submitted for the programming course I'm currently taking. I'm on spring break and I was hoping to use my spare time to do some studying, so I took my 'A' program and tried to run it in Visual Studio Express, and … | |
[CODE] #include "stdafx.h" #include<iostream> using namespace std; class Shape { public: virtual void fun() { cout<<"in base"<<endl; } }; class Square:public Shape { public: void fun() { cout<<"in Square"<<endl; } }; class Circle:public Shape { public: void fun() { cout<<"in Circle"<<endl; } }; int _tmain(int argc, _TCHAR* argv[]) { Shape … | |
I just cant get my head around it. Is there another way going through a singly linked list without using some kind of helper function? The header file wants me to implement: [CODE]size_t priority_queue::size() { /* code here */ }[/CODE] Now I just could create a helper function that has … | |
ok lets say i have the following text T 2 X F X 2 Y G Y 1 Z Z 2 G 1 I 3 T G E F 2 I E looking at the first line t is the vertex 2 is the number of edges it has and … | |
Hi, I'm building a clustering algorithm and need to visualize how data is distributed and relationed. For this, I'm thinking in histograms (numerical and categorical data) and scatter plots. If possible, a 3D like plot like [url]http://www.opendx.org/inaction/datamining/images/original/mci3.jpg[/url] would be nice, but is not required. I'd like to be able to … | |
In a program I am writing, the one line of declaring an ifstream object causes the program to "crash" and a non-zero return code to be returned. Instead of pasting the full program here, I'll paste a sample program that "crashes" just the same. I put "crash" in quotations because … | |
Hi, I am really confused. Everywhere I read on the internet, I see that the += operator is part of the string class. I want to add something onto the end of the string. Why does my code not compile? I keep getting the C2088 error: illegal for class. If … | |
| |
Hi folks, I am learning C++ programming. Below mentioned program giving segmentation fault ONLY WHEN if I declare 'struct s a;' ABOVE 'struct s *b;'. Can anybody tell me the reason? [CODE] #include<iostream> using namespace std; struct s { int m; }; int main() { struct s a; // if … | |
Hi, I have a question about generating a 1kHz sine wave. First of all, we can't use the sin function so I just made a function that evaluates sin at some point... [CODE]int generate_sin(int t); { int sin; sin = t - ((t^3)/(3*2*1)) + ((t^5)/(5*4*3*2*1)); return sin; }[/CODE] Now, this … | |
[CODE]cout << endl << "\n\n\nWhat would you like to do?"; cout << endl << " Add" << endl << " View" << endl << " Delete\n- "; cin >> todo; transform(todo.begin(), todo.end(), todo.begin(), toupper); cout << todo; bool done = true; while (!done) { if (todo == "DELETE") { system("cls"); … | |
how do i make an array read from a file. i tried google it. but i cant get it to work.[CODE]// theisonewscpp.cpp : Defines the entry point for the console application. // #include<iostream> #include <vector> #include <algorithm> using namespace std; bool myfunction (int i,int j) { return (i<j); } int … | |
Hello I'm learning a bit about data structures for the first time and so far I seem to understand how they work "I think" at this stage. My questions at this point would be. 1. Are data structures essentially classes minus methods which can preform actions on the memebers that … | |
Hello, I have spent numerous hours re-working this code and I hope someone can clear up my confusion! This program asks the user to enter a file name which will then create and display that file with a poem in all caps. The user is again prompted to enter another … | |
This is when I try to output uninitialized characters on the screen. I thought C++ should declare all of them to 0's (or '\0' for characters) when I declare them without initializing? | |
Im trying a practice problem from a textbook and here is my attempt at it, was wondering if I could get some advice both with structurally how to approach the problem, efficency, and any words of wisdom on dynamic memory. This is my study for my final exam which so … |
The End.