C++ :: Calculate A Person Regular Pay As Well As Overtime
Jun 26, 2013
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main () {
[Code] ....
I'm not sure why my loop isn't running right. I've also used if/if and if/else . Nothing worked
View 2 Replies
ADVERTISEMENT
Apr 11, 2014
When you execute my code you'll notice the regular pay for the first example will calculate to $500 when it is only supposed to calculate to $400. I'm also having a problem adding up the totals of the regular pay and overtime pay to get a total payroll which is displayed in one cout statement. 95% of my code is correct, I'm just having these two issues. To make it more clear hear is my assignment:
The regular working hour for an employee is 40 hours a week. Sometimes employees work over time. When the employee works 40 or less hours, the regular pay is calculated as number of hours worked times the hourly rate. When the employee works over time i.e. beyond 40 hours then the employee's pay has two components a) regular pay (40 hours X hourly rate), and 2) overtime pay (the overtime hours beyond 40 X time and half of the hourly rate).
void compute(incomeInfo *ptrI, int count) {
for (int i = 0; i<count; i++)
if (ptrI->hours <= 40) {
ptrI->regPay = ptrI->hours * ptrI->hRate;
ptrI++;
[Code] ....
View 1 Replies
View Related
Jun 4, 2013
refer to this image: [URL]
program for calculating overtime payment of an employee?
View 11 Replies
View Related
Jul 2, 2013
Code:
#include "opencv2/video/tracking.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include <stdio.h>
#include <stdlib.h>
[Code] ....
The above code is all I have so far. I got confused when I got to the part where my book on C tells me I need to use the cvCalcOpticalFlowFarneback() function to compare 2 consecutive images from the webcam and create the optical flow, and then measure movement between the frames to detect whether or not a person is moving through the room. How to do this, and the OpenCV wiki wasn't very descriptive on how to set it up for beginners. Honestly, the parameters just confused me and I didn't see a return value listed, or how you would get data from it.
View 8 Replies
View Related
Mar 6, 2015
I'm having a bit of problem. I've set the string 'Absent' to all student in a file. However, I want to replace 'Absent' with 'present' when the correct ID assigned to a student is entered. In other words, 'Absent' will only change to 'Present' for a specific person at a time. I'm not sure how to implement this
View 4 Replies
View Related
Feb 24, 2015
Im trying to create a Personchanged EventHandler..
I have this:
public class Pessoa {
private int _idade;
private bool _isDeleted;
public Pessoa() {
// TODO: Complete member initialization
[Code] ....
And I have a error: Delegate EventHandler does not take 0 arguments..
View 10 Replies
View Related
Dec 13, 2012
How to enter person's last name and first name separated by space and comma.
For example henry smith---
Output-->>smith,henry
View 2 Replies
View Related
Oct 23, 2013
I am trying to create a NFA from a regular expression. I have a grasp on reading in the regular expression and being able to make a stack from it. The part I am struggling on is mapping the characters in the regular expression to an integer indicating the variables order in the expression. I am just not sure how to go about this.
My code so far...
Code:
#include<stdio.h>
#include<stdlib.h>
#include "stack.h"
int main(void)
{
char expression[80];//array to store regular expression
[Code] .....
View 6 Replies
View Related
Aug 25, 2014
I have this bit of code that I found here: [URL] and at first regex would work, but then when I hit "[]" it wouldn't. Here's the code:
#include <iostream>
#include <string>
#include <regex>
[Code]....
View 2 Replies
View Related
Sep 5, 2013
So I need to use boost/regex for regular expressions. someone told me that it needs to be built. the first problem is boost doesn't tell you how to build it and the second is i did sudo apt-get install libboost something. I don't remember the exact name of the package. it installed but i dont know how i would build it when its installed.
View 2 Replies
View Related
Dec 11, 2013
writing a program for "Validating the e-mail id without using regular expressions in c/c++"?
View 4 Replies
View Related
Aug 9, 2013
I really do not see the difference between these two declarations:
int myvariable;
int * mypointer;
It is said that when you define a pointer, instead of containing actual data, it contains a pointer to the memory location where information can be found.
But doesn't the other variable declaration do the same? It obviously doesn't have data either. And it must be stored in a memory location as well. So I do not see the difference.
View 6 Replies
View Related
May 22, 2014
In order to parse mathematical expressions I am trying regular expressions and a recursive algorithm, but I have a problem with the four basic operations: +, -, *, /.
Trying to analyze a string like "a+(b+c)", if I use the pattern for a sum "(.+)+(.+)" the program matches it recognizing as subpatterns: "a+(b" and "c". How could I achieve the program to try also the other possibility?
I think that it would be great something like an regex_iterator which worked with regex_match instead of regex_search. I mean, an iterator that iterates over all the possible ways to match a given regular expression and a given string. This way I could loop through all these possibilities until the two subpatterns produced were correct mathematical expressions.
View 3 Replies
View Related
Aug 22, 2013
Its a code in module of my program, where I need to print current time (HH:MM:SS) at regular intervals.
Code:
#include<time.h>
#include<stdio.h>
//#include<windows.h>
void delay(unsigned int t){ // loop for some delay.
[Code] ....
But when I am running this code I expect this to print difference in time due to delay. But it doesn't enter the delay loop, why ?
View 5 Replies
View Related
Apr 9, 2012
<IMG border=0 alt="UserDeviceId = 70813215">
Above is the sample string object from this i need to find the integer value of UserDeviceId.
View 2 Replies
View Related
Jan 5, 2015
I have programmed a program for billing system. I have used parameters and arrays. All the functions are working except a one function. (Regular package function).
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
using namespace std;
void main(int &minutes, int &minutesd,int &minutesn) {
[Code] .....
View 3 Replies
View Related
Mar 14, 2014
I have an EDI file whose structure is given below. This file has multiple records, each record contains a header (e.g EDI.DD.0000000001.20130809), then contents (i.e multiple paragraphs of text) and then footer (e.g End of Report/No EDI Activity). I have to read that entire file using regular expression using three groups.
I am using following regular expression to read the file.
(?<header>[A-Z]{3}.[A-Z]{2}.[0-9]{10}.[0-9]{8}) | (?<footer> (EndsofsReport|NosEDIsActivity)) |
(?<content>(?<=k<header>).*(?=k<footer>))
That expression reads the "header" and "footer" in respective groups properly but didn't pick the contents between header and footer in "contents" group.
I have changed the font of header and footer in below file to understand the format. I am using asp.net 3.5 framework.
//------------------Start of EDI File---------------------//
EDI.DD.0000000001.20130809
ORIGINATOR INFORMATION Company Name: UNITED HEALTHCAR Identification: 9024125001 Originating DFI: 002100002
RECEIVER INFORMATION Receiver Name: HEALTH & WELLNESS DFI Account Number: 0000000000000001 Receiving DFI ID: 434343430 ID Number: Transaction Type: 22 Deposit
ORIGINATOR INFORMATION Company Nam
[Code] ....
View 1 Replies
View Related
Oct 11, 2012
i'm making a program that, given a person's birthdate or any other date, will display the day of the week of the person was born.
There is this part where it says "use a switch statement to make this calculation, If desired month is 12, add the number of days for November, if desired month is 11 add the number of days for october....
So it's suppose to start with "case 12 :...
I can't figure out what to write for the statement....
View 6 Replies
View Related
Jan 17, 2015
lets say we have a valid class with full implementation, X. can this class be declared as forward in Y header file:
Code: class X;
class Y{
X* m_X;
}
but still be used as regular in the cpp file?
Code:
#include "Y.h"
#incldue "X.h"
T Y::function(){
m_X->doSomething();
}
visual studio prevents me from doing it , I wonder if the standard also says so.
View 2 Replies
View Related
Jul 12, 2013
I'm trying to write a program to calculate an approximate value of e using the formula e = 1 + 1/1! + 1/2! + ....... 1/n!...However, I'm always getting nearly 2.291481 as answer.Here is my code :
Code:
//Approximate the value of e
#include <stdio.h>
int main(void) {
int n, j;
printf("Please enter value of n : ");
scanf("%d", &n);
[code]....
I know I'm not supposed to use system("PAUSE"), but this is self-study.
View 8 Replies
View Related
Oct 7, 2013
I'm trying to successfully run a program that calculates your BMI but, although it runs, it is not giving the the correct math. Instead, it gives me the number i've submitted as my weight as an answer. I'm using Visual Studio 2008 and the formula: weight / (height/100)*2
Here is my code
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int weight;
int height;
double BMI;
[Code] ....
View 2 Replies
View Related
Jan 1, 2013
Let's say I want to calculate something like PI using some algorithm, but with the number of digits I want to.
View 1 Replies
View Related
Nov 22, 2014
I want calculate sum of every digit in my zip code so I wrote implementation function like that but, it shows "0" as answers, then I realize it should be call first, I add correctionDigitOf() in to constructor "Zipcode::Zipcode" then My zipcode are all "0' after I do this .....
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <ctime>
#include <cmath>
using namespace std;
class Zipcode {
[Code] ....
View 1 Replies
View Related
Aug 7, 2012
Contributions won't calculate ...
#include <stdio.h>
#include <conio.h>
int main() {
float tax;
float salary;
float taxable;
float taxmo;
float contributions;
[Code] .....
View 1 Replies
View Related
Mar 22, 2013
I was given an assignment for class to calculate the area of a circle using only the radius as a user input and not using Pi in the code. I need to do this by calculating the areas of a series of rectangles under the curve and adding them together. Using nested loops to continuously reduce the size of these rectangles until the approximated area value is within a margin of error less than 0.1%.
Code:
#include<iostream>
#include<cmath>
using namespace std;
int main ()
[Code] .....
View 7 Replies
View Related
Feb 20, 2014
My question is not in c++ programing , but because my aim is to make code that calculate the three angles between two vector i ask my question here
So as the title i have three point that create two vector and I want to get the angles in x,y and z of the point2
I used crosproduct that give me one angle without axe , I don't know in which axe this angle
My aim is the three angles for the 3 axes ....
View 7 Replies
View Related