49,761 Topics

Member Avatar for
Member Avatar for ruzzy

hi plz try to solve method of deduct fees that chrges$2.5(using withdraw method)for the forth transaction and resets the number to zero how to resets the transactioncount zero in child class checkaccount #include <iostream.h> #include <conio.h> #include <string> class bankaccounts { protected: double balance; public: bankaccounts() {balance=0.0;} bankaccounts(double b) {balance=b;} …

Member Avatar for deceptikon
0
117
Member Avatar for MachDelta

Hi everyone. I've been struggling with a quicksort implementation here. I think - scratch that - I know i'm overrunning an array (erm, vector) based on how it explodes, but I honestly can't see it and I have no debugger. I slept on it but fresh eyes didn't get me …

Member Avatar for ken_taiken
0
228
Member Avatar for new_developer

Hi everyone, I writing a program in which two methods I want to count when it is called. I don't know how to do this. //parent class void BankAccount::deposit(double dep) { if(dep > 0) balance += dep; } void BankAccount::withdraw(double wd) { if(wd > 0 && wd <= balance) balance …

Member Avatar for L7Sqr
0
92
Member Avatar for Umairuddinahmed

How to write a calculator program in c language using command line arguments??? The calculator only needs to perform basic functions of addition, subtraction, multiplication and division of 2 integers only.

Member Avatar for Lucaci Andrew
0
200
Member Avatar for new_developer

I want to write a simple program to check class and inheritance in Code Blocks but i don't know how to write. I have make new project and add new class named "Car". This is main class. #include <iostream> #include "Car.h" using namespace std; int main() { Car c; return …

Member Avatar for new_developer
0
365
Member Avatar for glenwill101

hello ive been working with c++ for a few weeks now and from yesterday ive attempting to write a console game but i keep getting an error. //where all the noise is coming from class Story{ public: Story(); ~Story(); void mainMenu(); void start(); private: void levelOne(); void judgement(); }; Story::Story(){ …

Member Avatar for glenwill101
0
104
Member Avatar for serdar.ilarslan

Hey guys i am in trouble about BST Tree exercise.. i need to create an array that can take number of elements user want and the user has to enter integers but the program need to get this number in one line ... Here is code that i already wrote …

Member Avatar for serdar.ilarslan
0
321
Member Avatar for Youler

Hi everyone, First post here so feel free to school me if my etiquette needs it. I'm reading a very long string of data (genome stuff AT TT GT AA AG AA ... etc) and comparing it using hamming distance with a similar string. (Naively checking for similarity entry by …

Member Avatar for Lucaci Andrew
0
156
Member Avatar for d.noora

**how we can use recursion in implementing tower of HANIO?? and how does it work i need someone's help ??!!!**

Member Avatar for Lucaci Andrew
0
91
Member Avatar for panatda.tokhume

#include<iostream> #include<fstream> #include<sstream> #include<stdlib.h> #include<math.h> #include<iomanip> using namespace std; int main() { int NUM_Object,NUM_Medoid; cout<<"How many menus u have?"<<endl; cin>>NUM_Object; cout<<"How many Medoids(k) do you want?"<<endl; cin>>NUM_Medoid; ifstream myfile("Nutrient.txt", ios::in); int i,j,k,count; count = 0; float TEMP_num; double Object[NUM_Object][5]; double Medoid[NUM_Medoid][5],Medoid_New[NUM_Medoid][5],SUM_Distance[NUM_Medoid],SUM_Pij[NUM_Medoid], SUM_P[NUM_Medoid],SUM_Distance_New[NUM_Medoid],SUM_Pij_New[NUM_Medoid],SUM_P_New[NUM_Medoid]; long double Distance[NUM_Object][Object]; for(i=0;i<NUM_Object;i++) { for(j=0;j<NUM_Object;j++) { Distance[i][j] …

Member Avatar for panatda.tokhume
0
186
Member Avatar for marius2010

Need to find larger prime number then has been inputed.how to do that: I *cin* 5 the reult it self should be 7...?

Member Avatar for Lucaci Andrew
0
190
Member Avatar for letterG

I'm stuck at comparing the operators, it seems I can only compare the current operator to the topmost of the stack, how do I keep on comparing it til the stack is null or the precedence don't hold true anymore?...i've commented the part where I think my program fails...any help? …

Member Avatar for letterG
0
4K
Member Avatar for robotnik

Hi, im trying to make a C++ project for my class which reads the input from a text file and outputs the mean, median, and mode. but im running into an error i get when i run it. i get this error when i try to build it error C2040: …

Member Avatar for Lucaci Andrew
0
392
Member Avatar for bdl365

1. Create arr, an array of size six. Each element of arr is a random two-digit positive integer. (The program should make a random selection using the function rand.) Print the elements of arr. 2. Compute x as the average of the array. Print x. 3. Compute y as the …

Member Avatar for Lucaci Andrew
0
89
Member Avatar for andrew mendonca

Assignment 9, Due Dec 2 Design and implement a program that allows the user to keep track of students in a college course. The program will function as a simple database in which students can be inserted, removed and updated. Additionally, the user can display students in order by name …

Member Avatar for andrew mendonca
0
221
Member Avatar for Weliaz

Hey there people! I have a problem with an application which i'm working on! The problematic code: #ifndef CONFIG_H #define CONFIG_H bool LoadConfig(); XMLElement* Element(std::string name); #endif Where the "XMLElement* Element" is the problem. I am using the library TinyXML-2 for this. If anybody could help I would be very …

Member Avatar for Weliaz
0
332
Member Avatar for ralph1992

I have attached a quick class model of what I am trying to achieve (Also, sorry for the mass of code but I figured I'd post everything I have thus far in case anyone saw other improvements I could make). I can give a customer an 'Account' but I want …

Member Avatar for phorce
0
8K
Member Avatar for QuantNeeds

I am not sure why this is occuring. I declared these functions in the header file and it is defined them in the .cpp file but in the main function it does not recognize them. Did I forget something basic or do something illegal? The errors: : error C3861: 'createAndInitializeTextFile': …

Member Avatar for fiqa92
0
4K
Member Avatar for highonbikes

so the assignment I have is for a bank login program. and the function looks like so Client* Bank::login() based off a boolean value this bank command(which has a private: client* to an array of clients) I have to return a pointer to the correct client or NULL. so simplified …

Member Avatar for Moschops
0
131
Member Avatar for adityasingh95

can sum1 pls explain why there isn't any output??? #include <iostream.h> #include <conio.h> void main() { clrscr(); int a[50][50],r,c,ans=0; cout<<"Enter Size of Array:"; cin>>r; r=c; for (int i=0;i<r;i++) { for (int j=0;j<c;j++) { cin>>a[i][j]; } } getch(); clrscr(); for (i=0;i<r;i++) { for (int j=0;j<r;j++) { cout<<a[i][j]; } cout<<endl; } cout<<endl<<endl; …

Member Avatar for L7Sqr
0
237
Member Avatar for acerious

BEGIN SEQ (n) IF (n <= 3) THEN RETURN n * 2 ELSE RETURN SEQ (n - 3) + SEQ (n - 1) ENDIF END For instance, for n = 8, I ran it in a compiler and the final return value is 38. I tried tracing it in the …

Member Avatar for vijayan121
0
139
Member Avatar for dot_binary

Hello! I'm trying to get the contents of a binary file into a char array, my read function is in main.cpp, in the header file is referenced as char fileio(char * bufferZ) , and is called in another .cpp file. The problem is , the code in the function cant …

Member Avatar for dot_binary
0
258
Member Avatar for savinki

Hi, wt is the function that can use to count number of digits in a long integer? e.g. 12345678 -> 8 11 ->2 456 -> 3 6724 -> 4

Member Avatar for Shahzad Ahmad
0
317
Member Avatar for honey_sw816

Many banks and savings and loan institution compute interest on a daily basis. On a balance by $1000 with an interest rate of 6%, the interest earned in one day is 0.06 multiplied by 1000 and then divided by 365, because it is only for one day of a 365 …

Member Avatar for nullptr
0
82
Member Avatar for 78jimm

I am making a game for a school project with gotoxy and getch and 2d character arrays. there is supposed to be a robot type figure that can move left and right by pressing 'a' and 'd'. so far i've been able to make the cursor go left or right …

Member Avatar for ken_taiken
0
298
Member Avatar for Youler

Consider the following. I have a text file with 5 rows of 5 characters each. I want to read in a line and then compare it to all the other lines. I create 2 ifstream objects pointing to the same file, first and second. first reads in the first line. …

Member Avatar for Youler
0
130
Member Avatar for softwaretime

Could someone please help me find out what the problem is with this simple program? This souldn't be happening. Here is the code: #include "stdafx.h" using namespace std; int main () { int numbers[5]; int * p; p = numbers; *p = 10; p++; *p = 20; p = &numbers[2]; …

Member Avatar for softwaretime
0
263
Member Avatar for DestinyChanger

Hi, I'm working on a robotic project in university and searching for a good robot programming language. If C++ can help PLEASE give me some advise that how can i start robot programming in C++.

Member Avatar for saly305
0
2K
Member Avatar for winter7621

**Please help me out** I am trying to do the following: "Create a program that calculates prime numbers from a certain number X to a number Y. Modify the program so as to run two threads at the same time. The first thread will start counting from X to Y …

Member Avatar for ktsangop
0
2K
Member Avatar for dsprep

The End.