When I call the member function in the main function, two functions are working fine but the third one(print()) is not. The program stops after executing the read_ages function and nothing printed on the screen. This is really strange and I could not find any problem after spending hours and had to post it here.It is a very simple program but I cant find the bug. It is a multiple file program and I am using MinGW as a compiler.
//File 1
#include<vector>
#include<string>
class Name_pairs {
private:
std::vector<std::string>names;
std::vector<double> ages;
[Code] ...
//I haven't made the sort function yet since I am stuck with the print(). Seems //like the compiler is skipping the print() function.
error C3867: 'WordParsor::Form1::PutUpfrmIO': function call missing argument list; use '&WordParsor::Form1::PutUpfrmIO' to create a pointer to memberc:userskingc++wordparsorwordparsorForm1.h... and the suggestion fix generate another error.
One person suggested the gcroot<> object wrapper... but I do not know how to modify/declair the function or its argument type.
I have written a C++ program in which a user need to input a character. My problem is it's working fine for the first time but as it goes through the code second time, it skips the cin statement and takes the previous defined value. how can i make cin statement work for the second time also?
im a newbie C user and im having a little trouble in these for loop of mine im using. the first iteration is all fine but on the second and succesive iterations the first gets statement is skipped. im making a program that would ask the user to input multiple informations for atleast 5 people. i was also asked to use structures.. here is the code i have come up so far.. ive been stuck in it for like 3 hours now.
the problem that I'm running into is that the compiler skips to the end when I put my initials in //User input > "Initials"
I'm using Microsoft Visual C++ 2010 Express.
Here is the assignment:
Plan and code a program to do the following. You found an exciting summer job for 5 weeks. It pays $15.50 per hour. You will input the number of hours per week that you worked and then compute your total earnings. You must pay taxes of 14%. After paying taxes, you will spend 20% of your money on cloths and 5% on school supplies. After buying clothes and supplies, you will use 25% of the remaining money for savings.
Input
Your 3 initials and the hours for each of the 5 weeks. Use the following numbers of hours for your first test 25, 30, 20, 23, 22.
Calculations
Gross pay is the rate of pay times the sum of all hours you worked. Use CONSTANTS for each of the following rates:
Tax rate 14% of the gross earnings Clothing 20% of earnings after taxes School supplies 5% of earnings after taxes Savings 25% of earnings after taxes and expenses
Output:
Output your initials, total hours worked, gross earnings, taxes, net earnings after taxes, clothing expense, supplies expense, amount going to savings and amount left to spend. Output must be aligned to the right as shown with 2 decimals in all numbers. Sample output:
Initials ABC Total Hours Worked 120.00 Gross Earnings 1860
Taxes paid 260.40 Net Earnings 1599.60
[code]....
Turn in:Be sure your output file contains user prompts and what was entered by the user. In addition to the results of your program processing. Run with above listed data.
Here is my code
#include <iostream> #include <iomanip> using namespace std; int main() { double Initials, TotalHours, GrossEarn, TaxesPaid;
I am supposed to write a program that reads lines from files and see if the first character is an odd number, if so it will out put the remaining characters to output file, else itll seek to the beginning of the next line, this is what i came up with but its not working as it should, im not sure if its the version im using or the program I wrote, the commented part below was another algorithm I was trying to use.
#include<fstream> #include<iostream> using namespace std; int main() { char c; int i =0;
[Code] ....
My text file was as follows: input.txt 3Ali 4Sami 6Rashid 3Aya
output was unexpected , although some was relatively write but not as I wanted...
I am trying to put pieces of a csv file into an array, but i only want to put certain pieces of it. This is the information that i have
Player,Current Team, Age , Nat , Position ,From,To,Transfer fee Gareth Bale, Real Madrid,24,Wales,RW,Tottenham,Real Madrid CF,91000000 Edinson Cavani,PSG,26,Uruguay,CF,SSC Napoli,PSG,64500000 Falcao, Monaco,27,Columbia,CF,Atlético Madrid,Monaco,60000000 Neymar, FC Barcelona,21,Brasil,LW,Santos,FC Barcelona,57100000 Mesut Özil, Arsenal,24,Germany,AM,Real Madrid ,Arsenal,50000000 James Rodríguez,Monaco, 21,Columbia,RW,FC Porto,Monaco,45000000
With this i want to skip the name and team but need age.
I wrote a program which detects a pattern in an array then returns a valve (x) for each time it does. now i tried to call function patt in main so that i can print x but it doesn't let me do it.
#include <stdio.h> int patt(const int SIZE, char str[], int i, int c); int main(void) { const int SIZE=21; char str[SIZE]={'1', '0', '1', '1', '0', '0', '1', '0', '1', '0', '1', '0', '0', '0', '1', '0', '1', '1', '0', '1'}; int i, c=0;
I want to write a function and be able to call it during execution (say during a while(1) loop). Is this possible without having to parse an input string to extract the function and parameters I need or is that the only way?
i think my function call is not working and i dont know how to fix it. Basically i want it to output my getstudent function and once i get the information i want it to output with the displaystudent.
I'm not a programmer, at least, not a good one. I'm a researcher and I need to implement this function and test it and use it for my research. I tested some clustering methods in JAVA and Matlab and also I want to test it on C. I don't know too much about programming, especially about C, I know nothing. I tried to implement some basic methods but I failed.
It's all about K-Means Algorithm. I'm working on a disease and I'm trying to find ways to early diagnosis. Anyway, these are details. The thing is, I found a 'free to use' function but I don't know how can I use it. I tried to learn something from Net, I downloaded a compiler, I paste the code and I get many errors... And I heard that I have to do some "calling function" stuff but I don't know how to..
The code is in the link below: URL....It's not imperative that using this function, it can be another one but it had to written in C.