C++ :: Find Total Gross For Department Entered

Apr 24, 2013

I am trying to find total gross for department entered but it keeps giving me a total gross for every department and I don't want that. I think its maybe just one word I am missing but not sure. Here's my code

// display record by searching by dept number
void searchByNumber(Staff s[] ,int row) {
double GrandTotalPay=0.0;
clrscr();
cout << "this is Search

[Code] ....

View 2 Replies


ADVERTISEMENT

C++ :: Adding Total Cins Entered?

Sep 30, 2013

If I entered multiple cin say for variable x, how do I total them all up at the end?

Example: x being the variable.

cin 45
cin 50
cin 22

The total would be 117 but how would I write that in c++?.

View 3 Replies View Related

C/C++ :: Find Max Number Entered By User And Terminate When Negative Number Entered

Jul 15, 2014

I am trying to find the max number entered by the user, and it should terminate when a negative number is entered. For my code, it will just end when the user inputs a lower number than the previous. i.e.- 10 20 15 "The highest number is 20" when it should be "10 20 5 40 15 -1" "The highest number is 40". No arrays or do/while loops either.

#include <iostream>
using namespace std;
int Max(int x);
int main() {
int x;

[Code] ....

View 9 Replies View Related

C# :: Using Check Boxes To Find Total Value?

Mar 1, 2015

Basically, I am designing a form that shows all of the services a mechanic performs, and then it is supposed to calculate the total based on the selections made.

HOW do I use those check boxes to calculate a total? I am supposed to use value-returning methods that solve for the parts cost, flush charges, tax charges, misc costs, etc. Ive attached a picture of the form thus to make sense of what I'm trying to describe.

View 5 Replies View Related

C++ :: Void Functions - Passed By Value To Find A Total

Dec 4, 2014

I missed last class on doing void functions because I got sick and im completely lost! ive being using the texts book example for a reference but its not running !

The output should look similar to this:

how much was your shirt?
20
shirt 20.00
tax =1.20
the total 21.20

Code:

include <iostream>
#include <iomanip>
using namespace std;

void getShirtCost(double shirtCost);
void calculate(double shirtCost,double taxAmount, double total, double taxamount) ;
void printReceipt(double shirtCost, double taxAmount, double total, double taxamount);

[Code] ....

View 1 Replies View Related

C++ :: Create A Program That Will Find Total Of All Elements In Array

Aug 28, 2013

I need to create a program that will find the total of all the elements in array. I need to use for loop and the array size is 10.The output should be like this: i used user input

Input array 0 : 2
Input array 1 : 4
Input array 2 : 6
Input array 3 : 7
Input array 4 : 8
Input array 5 : 9
Input array 6 : 10
Input array 7 : 12
Input array 8 : 16
Input array 9 : 20

Sum of 10 numbers in an array is = 94..Press any key to continue..I have a code but the output is not like that. Here is the code,

// Program to store 10 integers array
#include <iostream>
#include <stdio.h>
using namespace std;
int getArray(int x[]);

[code]....

View 16 Replies View Related

C :: Find The Largest And Smallest Number Entered By User?

Mar 6, 2015

How to find the largest and smallest number entered by a user. So far I'm able to add, find the average and count how many numbers are entered.

I'm just having trouble with find the max and min. I tried if statements and it breaks the program will it wont let me exit the while loop or the program will do a force close after entering a value.

Code:

#include <stdio.h>
#include <stdlib.h>
int main(){

int maxNum=0, minNum=0, value, count=0, sum=0;
double average;

[Code] ....

View 4 Replies View Related

C++ :: Find And Delete All Vowels In A Word That Is Entered By User

Mar 26, 2013

The program should find and delete all vowels in a word that is user entered. This is what I have so far and I know it should be essentially this format I just don't know how to set enteredword and word equal to each other.

#include <string>
#include <iostream>
using namespace std;
void vowelremover(string&);
int main () {
string word;

[Code] ....

View 3 Replies View Related

C++ :: Find Unequal Elements In Array Entered By User

Jan 12, 2014

I would like to know the algorithm or flow for finding unequal elements in an array entered by user. I tried using for loop but didn't get the expected output

Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
int a[10],b[10]; //array of integer elements

[Code] ....

View 6 Replies View Related

C++ :: Program To Find And Delete All Vowels In A Word That Is User Entered

Mar 25, 2013

The program should find and delete all vowels in a word that is user entered. This is what I have so far and I know it should be essentially this format I just don't know how to set entered word and word equal to each other.

Code:

#include <string>
#include <iostream>
using namespace std;
void vowelremover(string&);
string word;
int main ()
{//string word;

[Code]....

View 3 Replies View Related

C :: Write A Code To Find All The Prime Numbers Before A User Entered Number

Apr 9, 2014

I am trying to write code to find all the prime numbers before a user entered number. I started with a working program and when I tried to create a function, it got all messed up.

Code:

#include <stdio.h>
int is_prime( int num );
int get_positive_integer(void);
int main( ) {
int upper; /* upper limit to check */
int num; /* current number to check */
int isprime;
/* used to flag if number is prime or not */

[Code]...

It says the error is on line 23

View 6 Replies View Related

C :: Array Add Total Rows And Total Columns

Apr 16, 2013

Code: i am trying to display the information in the array as a table and add the total rows and the total colums separately

#include<stdio.h>
int main(void)
{
int row, col;

[Code].....

View 1 Replies View Related

C++ :: Calculating Gross Pay - Arrays

Dec 4, 2013

I am just learning arrays, I modified my program to use arrays but now it wont calculate the gross pay well it seems it does but not correctly. The gross pay is coming back as "-9.25596e+061" it worked fine before I added arrays. I do have a text file with the following input :

John Doe 1404 45 20 H
Bobby Jill 1404 45 20 S

#include <iostream>//including library (directive header file)
#include <windows.h>//makes console look pretty
#include <fstream>//Library to read files
#include <iomanip>
using namespace std;
int main() {
SetConsoleTitleW(L"Payroll System");//Set Console Title

[Code] .....

View 2 Replies View Related

C++ :: Net Pay By Pass Referencing A Gross Pay Overloaded Function

Oct 23, 2014

I need to return taxes paid and net pay by pass referencing a gross pay overloaded function. Are the values returned from calling the overloaded function file stream objects? Can they be passed simply through a pass-by-reference function?

//Read Data from File, gather info and calculate pay, output data to file
while(counter < x) {
inFile >> last_name >> first_name >> hours_worked >> hourly_pay;
outFile << first_name << " " << last_name << " ";
outFile << calculate_gross_pay(hours_worked,hourly_pay);
counter++;
outFile<<endl;

[code].....

View 8 Replies View Related

C/C++ :: Program That Will Read Gross Salary Of Employee And Calculate Net

Sep 14, 2012

I have tried different programs and nothing works for this.Write a program that will read the gross salary of an employee and calculate the net

View 1 Replies View Related

C++ :: Program To Take Number Of Hours Worked And Output Workers Gross Pay

Sep 21, 2014

ok so i did a program that will take the number of hours worked in a week annd the number of dependents ans inputs and then outputs the workers gross pay, each withholding amount, and the net take home pay per week.

The Program should come out as this:

Regular Hours :34
Overtime hours: 0
gross pay : $323.00
social tax: 19.38
federal tax: $45.22
Statte tax: $16.15
Number of dependents covered: 2
additional health insurance expence: $0

Net take home pay: $236.25

The employer pay rate is 9.50
the employer worked 34 hours "regular hours 40 or less"
if any hours are paid at over time rate of one and one half time that from the gross pay, 6% of social is with held, 14% form federal income, 5% from state income, 6$ per week from union dues, and if worker has 3 or more covered dependent, then an additional 10$ is wothheld to cover the extra cost of health insurance

heres my program:

#include <iostream>
using namespace std;
int main () {
int regHours; // Regular Hours
float hourlyPay, gross, otime, socialtax, federaltax, statetax, uniondues, dep, health; // gross income, overtime, social tax, federal tax, state tax, union dues, depen covered, health insurance

[Code] .....

the program runs but theres still errors in it, it did not make some of the calculations right.

What formula do I use to calculate overtime hours if there was over time?
What formula do I use to take out union dues from total income?
How to I set the number of independents covered to match the health cost if it was 3 or more?

View 1 Replies View Related

C++ :: Total Is Not Adding Up?

Jan 14, 2015

Every time I run if(color=="1") it's supposed to add 1 to redTotal. However, every time I run if(color=="1") if get 1 for redTotal every time.

(Write a program that provides the option of tallying up the results of a poll with 3 possible values. The first input to the program is the poll question; the next three inputs are the possible answers. The first answer is indicated by 1, the second by 2, the third by 3. The answers are tallied until a 0 is entered. The program should then show the results of the poll—try making a bar graph that shows the results properly scaled to fit on your screen no matter how many results were entered.)

Code:
#include <iostream>
#include <string>
using namespace std;
int main()

[Code]....

View 4 Replies View Related

C/C++ :: Getting Total Value Of 2 Arrays?

Mar 9, 2014

I am trying to write a function that accepts two arrays as arguments.

The result is to get all values in both arrays and return the total value to the calling program.But when I run the program the total value is not what I expected.

#include <stdio.h>
#define MAX 3
int array_1[MAX], array_2[MAX], count;
int total(int narray_1[], int narray_2[], int lenght);
int main(void) {
for (count = 0; count < MAX; count++)

[code]....

View 1 Replies View Related

C :: Average And Total Of Six Integers

Jan 22, 2013

"Write a program that prompts the user for an integer number from the keyboard, and store it in a variable num. After each number is typed in, add num to a total.

Do this six times, each time adding num to a total. (Be sure to reuse the same variable named num for each of the six numbers entered.) When all six numbers have been entered from the keyboard, calculate an average. Display the total and average calculated. "

Here is what I have so far:

Code:
#include<stdio.h>
int main() {
int num, total1, total2, total3, total4, total5, total6, avg;

printf("Enter first number:");
scanf("%2d",&num);

[Code] .....

View 2 Replies View Related

C++ :: How To Total The Values That Are Put In During The Loop

Oct 23, 2014

How to total the values that are put in during the loop. For this program I need to add up the values the user inputs and then display them after the loop. Here is what I have:

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
const int firstQuiz = 1, lastQuiz = 4;
int quiz, quizGrade;
for (quiz = firstQuiz; quiz <= lastQuiz; quiz++)

[code]...

View 4 Replies View Related

C++ :: Can't Total Up The Results Calculated

Apr 8, 2013

i am doing a sales commission program to run a counter on the commission calculated, but the answers can't show on the counter

here's what i've done so far:
#include <iostream>
#include <iomanip>
#include <cmath>

[Code].....

View 2 Replies View Related

C# :: How To Add Number To Previous To Get Total

Feb 7, 2015

decTotalAmountOwed = decAmountOwed + decAmountOwed;

This is what i've tried so far. The numbers are supposed to be added together once placed in listbox.

View 8 Replies View Related

C++ :: Program That Can Draw Total Of Passed Value

Feb 4, 2014

Draw the total of a passed value, or value in general, without checking how many values there are individually.

Here's a pseudo-example:

int aliens = 10; // This should be changed as desired.
void drawaliens(int value) {
aliens.draw(value); // Instead of having a test of how many to draw, draw the amount there is from one check
}

I want to draw the amount of aliens passed or called to the alien draw function.

However, I don't want the function to check every possible value of aliens which could be passed before drawing, and just check the value once and draw that value.

IF x ALIENS, DRAW x ALIENS instead of...

IF 1 ALIEN, DRAW ALIEN(1);
IF 2 ALIEN, DRAW ALIEN(2);
IF 3 ALIEN, DRAW ALIEN(3);
.... and so on.

If there can be hundreds of aliens, it seems impractical to check every single possible value before drawing, and just check the value and draw that value.

View 2 Replies View Related

C++ :: Printing Total Number Of Even / Odd Integers

Feb 28, 2013

The program requires the user to enter 10 integers then print the total no. of even integer,highest even integer, lowest even integer then total no. of odd integer,highest odd integer, lowest odd integer

I already got the total no. of even integer and total no. of odd integer. But I don't know how will i get the highest even integer, lowest even integer and highest odd integer, lowest odd integer.

View 2 Replies View Related

C++ :: Cout Total Element In Array

Feb 28, 2013

I am beginner in C++ programming. I having a problem to show the output of all the element i store at a array called total_price. the output become unreadable.

#include <iostream>
using namespace std;
int main () {
float price[1]={0};
int qty;

[Code] ....

View 6 Replies View Related

C++ :: How To Search And Display The Total Between 2 Days

Apr 25, 2013

how to search and display the total between 2 days without using lots of code

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved