49,761 Topics

Member Avatar for
Member Avatar for zulkefli82

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" …

Member Avatar for zulkefli82
0
117
Member Avatar for pravej

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

Member Avatar for template<>
0
243
Member Avatar for cableguy31

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, …

Member Avatar for template<>
0
340
Member Avatar for littleleaf

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 …

Member Avatar for littleleaf
0
425
Member Avatar for gcardonav

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 …

Member Avatar for gcardonav
0
140
Member Avatar for CodyOebel

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 …

Member Avatar for template<>
0
145
Member Avatar for Gnomy

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 …

Member Avatar for template<>
0
543
Member Avatar for munitjsr2

[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 …

Member Avatar for Fbody
0
289
Member Avatar for Dasini

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++

Member Avatar for griswolf
0
2K
Member Avatar for hawita

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) { …

Member Avatar for StuXYZ
0
89
Member Avatar for Khoanyneosr

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 …

Member Avatar for Khoanyneosr
0
141
Member Avatar for shyla

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 …

Member Avatar for Moschops
0
550
Member Avatar for naseerhaider

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. …

Member Avatar for mrnutty
1
2K
Member Avatar for youLostTheGame

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++ …

Member Avatar for arkoenig
0
136
Member Avatar for sinatra87

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 …

Member Avatar for sinatra87
0
2K
Member Avatar for SourabhT

[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 …

Member Avatar for arkoenig
0
707
Member Avatar for fibbo

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 …

Member Avatar for fibbo
0
365
Member Avatar for israruval007

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 …

Member Avatar for israruval007
0
2K
Member Avatar for luislupe

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 …

Member Avatar for L7Sqr
0
330
Member Avatar for lss123

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 …

Member Avatar for JamesPhillips
0
683
Member Avatar for emanfman

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 …

Member Avatar for emanfman
0
139
Member Avatar for hawita
Member Avatar for Fbody
0
312
Member Avatar for alice_k

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 …

Member Avatar for Moschops
0
719
Member Avatar for gomezfx

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 …

Member Avatar for drkybelk
0
2K
Member Avatar for Khoanyneosr

[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"); …

Member Avatar for Fbody
0
102
Member Avatar for Theisonews

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 …

Member Avatar for Theisonews
0
466
Member Avatar for predator78

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 …

Member Avatar for NicAx64
0
376
Member Avatar for aprilchica3

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 …

Member Avatar for aprilchica3
0
172
Member Avatar for sergent

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?

Member Avatar for NathanOliver
0
109
Member Avatar for TheSassyDragon

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 …

Member Avatar for Lerner
0
282

The End.