49,761 Topics
| |
Write a program that clear the difference b/w increment & decrement operators using binary & unary operators. can anyone help me out in this program ??? | |
Hi all,please help me out,how to find occureces and scale in this situation?And what is wrong with diplay option,once it displays,the numbers are not in the same column. Thank you kindy. #include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int list[12]; cout<<"Enter 12 values:\n"; for(int i =0;i<12;i++) … | |
Hi When I tried to compile like g++ -std=c++11 -W -Wall it gives this error error: ‘stoi’ is not a member of ‘std’ #include <string> #include <iostream> #include <fstream> class Grade { public: // Default Constructor Grade() {}; // Functors // If the given course and the score matches the … | |
I have an application this is alredy license but in this application use my functionlity put custome .afl file this file make in c++ i make this .afl file as trial period.So how to make this .afl file as 7 day trial period.....so plz help me... If any one can … | |
Hello, guys I'm hoping that you can help me. I'm having a problem coding w/ this problem. I find it hard to do this bcoz when I run the program the result always be like this. #include "stdafx.h" #include <string> #include <iostream> using namespace std; int main() { for (int … | |
Hi.here is a question I got for assignment.I am stuck in this for hours and couldnt com up with any logic.Any help will be highly appreciated.Thanks Depth-First-Search Q.No.1 The undirected unweighted graph with one selected vertex is given. Find the number of vertices in the connected component where the selected … | |
This is the prototype I was provided with for my Person constructor: Person(const char * their_name, const char * email, int day, int month, int year); In making my constructor I have tried to use base member intialization, but I am having issues, this is what my constructor looks like: … | |
Hi All, Well I've been stuck for a while here. I'm trying tp write a function called TransfertoSwingID which will transfer a line of data held in a struct contained in a vector to a new vector of structs. Basically as I'm iterating through the vector of structs called "prices", … | |
Hi All, I have doubt in my mind regarding declaration of cin and cout object . As per my understanding cin and cout both object are accessible in main then they shouldn't have protected.in below code snippet i have overloaded both input and output operator and while giving new name … | |
Hi to all,can anyone tell me please why is the code doesn't behave as it should. It dispalys hours and minutes from 19:00-23:59 ,but not from 00:00-23:59? Here is the code. #include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int hours ,minutes ; for(hours =0; hours<24; hours++) … | |
#ifndef POINT_H #define POINT_H class Point { public: Point(); Point(int, int); int getx(); int gety(); void setx(int); void sety(int); private: int x,y; }; #endif //POINT.CPP #ifndef POINT_H #define POINT_H class Point { public: Point(); Point(int, int); int getx(); int gety(); void setx(int); void sety(int); private: int x,y; }; #endif #ifndef … | |
Hello , I am trying to solve some problems from the "Computer Simulation Methods" book. It says > > Write a class that solves the nuclear decay problem.Input the decay constant l from the control window.For l=1 and dt=0.01 ,compute the difference between the analytical result and the result of … | |
#include<iostream.h> #include<conio.h> void main() { int a[10],i,item,flag=-1; cout<<"enter the elements of an array"; for(i=0;i<=9;i++) cin>>a[i]; cout<<"enter the element to be search"; cin>>item; for(i=0;i<=9;i++) if(item==a[i]) { flag=1; break; } if(flag==-1) cout<<"search unsucessfull"; else { cout<<"search sucessfull"; } getch(); } | |
Evil Nation A is angry and plans to launch N guided-missiles at the peaceful Nation B in an attempt to wipe out all of Nation B’s people. Nation A’s missile i will arrive in nation B at the time ti. Missile i communicates with its headquarters by unique radio signals … | |
Write a C++ program that defines class Student with data members: ID, Name, average and array of 5 integer grades. And member Functions: - A private function computeAverage: to compute student’s average( the data member). - A public function getAverage that returns the value of student’s average - Overload the … | |
Hi, I've got a vector of structs populated with the following fields: double double double double (unsigned int) (unsigned int) string I want to take each line in that vector (call it OldVec), and 1. transfer it to a new vector of structures 2. add a string identifier at the … | |
Sometime crashes, sometimes blank text, and sometimes works. I'm passing (I hope) a reference to TextDisplay::update() so It can draw all the text in keyBindMenu which is a vector of std::strings. I'm not sure if I'm handling this correctly. My understanding of this is very weak, but I think I … | |
The second loop after opening the file again the second calculation for count isn't coming out correctly it seems to be doubled, comes out double the normal value when it shouldn't someone help please! #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <cmath> using namespace std; int main () … | |
Hello programmers! I am working on a Tic-Tac-Toe player vs. computer class, which is supposed to have a `run.()` method in order for the game to start. In a `gameWon()` member function, I am checking for a win, either by the player or by the computer. I check to see … | |
#include <stdio.h> #define N 40 void sum(int*p, int n, int d[]) { int i; *p = 0; for(i = 0; i < n; ++i) *p = *p + d[i]; } int main() { int i; int accum = 0; int data[N]; for(i = 0; i < N; ++i) data[i] = … | |
I am trying to read a textfile containing some informations in this format, itemId:itemDescription:itemCategory:itemSubCategory:amountPerUnit:quantity:date. item.txt 1:macbook:electronics:laptop:100:100:18-Oct-13 2:Iphone 5:electronics:handphone:50:50:18-Oct-13 I am able to extract everything except the itemId. Please advise or suggest what I should change/do to get the id. Thanks in advance. my output Id: <----blank! Item Description: macbook item … | |
Tried searching for an answer to this, but not sure even how to explain this question so i will show a code example.(I blame java, better then saying i'm brain damaged) I have no problems with pointers. But can't seem to remember the correct way to call the constructor when … | |
I was wondering if anyone could assist me with an assignment. The problem deals with operator overloading. In this assignment I have to modify a class called "Complex" to a)enable input and output of complex numbers via overloaded>> and << operators b)overload the multiplication operator to enable multiplication of two … | |
Hi What is the difference between using the **fstream** library to read a file....and using something like a procedure below using the FILE* object? There seems to be two ways to read a file? Thanks /* FEOF example */ #include <stdio.h> int main() { FILE * pFile; char buffer [100]; … | |
Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/G9aC9D Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/PfH8f0 Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/4wGayu Here are the input lines: ( … | |
I have a practise problem to write a function that takes 3 dim and dynamicly allocates 3d array with those values and then (PART THAT I DONT GET) : fills the 3-dimensional array with multiplication tables. What am I even supossed to do ?? Here's my code : int main() … | |
I am kind of new creating the A1Z26 cipher generator. But this has a problem. Only the program generates the last two numbers. What's wrong? #include <iostream> #include <ostream> #include <string> using namespace std; int i; // Counter char str1[101]; // A string of characters for generator. string str2, str3; … | |
How can I loop through a data field with a binary search, looking for multiple values? Please, I don't want to know another, more efficient way, I want to do it this way to understand the concepts. Also my data is indeed sorted before the call is made. The data … | |
implement a generic fn mapf with prototype template<class Sequence c , class UnaryFunction) Sequence mapf(Sequence c , UnaryFunction f) for ex if c is a seq containing the seq (3,2,7,6,8) and f is the fn that returns twice it integer agument. then container returned by mafc(c,f) is a list containing … | |
Write a C++ program that calculates the balance of a savings account at the end of a month period. The program should read from a file (bank.dat, downloadable from blackboard) the account number, the current balance and the account type. Depending on the account type, a different annual interest rate … |
The End.