C++ :: Making A Table For 10 Employees
Apr 22, 2014
I have to make a table for 10 Employees to look like this:
Employee ID Gross Pay Net Pay
101 540.58 480.80
158 796.32 630.20
How can I do this? This is my code so far.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void get_emp_rec(int &id, double &prate, double &hours) {
[Code] ....
View 2 Replies
ADVERTISEMENT
Oct 1, 2014
Make a c++ program of the payroll of a company
input values :
a. Name of Employee
b. Position in the company
c. No. of hours worked
d. No. of overtime hours
e. rate per hour
formula:
basic pay = number of hours worked x rate per hour
ot pay = overtime hours x 150% of rate per hour
gross pay = basic pay + ot pay
tot deduc = tax + sss + med
tax can be computed based on the following table:
basic pay tax
10000 or less 1% of basic pay
10001-15000 2% of basic pay
15001-20000 3% of basic pay
20001-30000 4% of basic pay
30001 or more 5% of basic pay
sss = 10% of basic pay
med = 6% of basic pay
net pay= gross pay - total ded
*The payroll should have at least 5 employees in it.*
View 11 Replies
View Related
Dec 5, 2013
My colleague and I have been given a task to create a list with the employes of a company using binary trees. Each employee/node has to contain the following information:
- Employe name
- Rank
- ID Number
- monthly Salary
We have to write a C program (using Codeblocks) which builds the company tree with the information above and afterwards lists all the employes who have a salary bigger then a number specified by the user.
So far so good. We've had a look on the examples on the internet and after finding one which looked friendly enough we started working on that one to suit our needs. Credits for the original source code to: C Program to Implement Binary Search Tree Traversal - Basic C Programs | C Programming Examples
We've reached the point where we're able to insert the required information but being able to list all the employes who's salary is bigger then the number given by the user seems to be rather difficult to achieve. I'll include the code next. We have left almost the entire pieces of the original code and we are aware that the are still things which are not required for our assignment, which only requires to enter the 4 information above and afterwards display the employes with the before mentioned condition concerning their salary.
Code:
# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
typedef struct BST
[Code] .....
View 1 Replies
View Related
Aug 5, 2013
The question involves me writing a program using a overloaded function to calculate the Weekly rate of employees but they get paid hourly and weekly. I get this error but do not know why,
#include <iostream>
using namespace std;
int calcWeeklyPay(int paidWeekly, int annualSalaryWeekly)
//Returns the Weekly salary of weekly paid Employees
int calcWeeklyPay(int paidHourly, int annualSalaryHourly)
//Returns the Weekly salary of Hourly paid Employees
[Code]...
View 3 Replies
View Related
Dec 11, 2013
I'm writing a code that's suppose to do a payroll for my intro cs class. At first it was working fine until I had to add the part that made sure a user couldn't enter a wage value below $6.00 and now it stops the loop right after that part for some reason.
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int const HR = 7;
[Code] ....
View 2 Replies
View Related
Nov 19, 2013
I am having an issue with my sort function. This is one part of the Hash table program. The main issue is that I am trying to sort the pointer table after all of the values have been entered. The ptr_sort function is not a class function and so I am therefore unable to use the class variables psize and pTable. Is there another way I should be trying this? it is a Vector should I use the sort() function from the vector class in STL?
#include "/home/onyuksel/courses/340/progs/13f/p9/util9.h"
#include "/home/onyuksel/courses/340/progs/13f/p9/hTable.h"
#ifndef H_TABLE1
#define H_TABLE1
void ptr_sort ( );
[Code] ....
View 1 Replies
View Related
Jan 25, 2013
If a user enters a string of boolean algebra it will ouput the table.
I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.
How to dynamically create the function, how to implement it.
BTW This is a console function, if that changes anything.
View 2 Replies
View Related
Dec 15, 2014
I have written an SQL statement that would:
1) Count the number of rows in the table booking that are open and where the booking.postcode is "MK",
2) Take a note of the plot (in booking.plot_id), and then update the table plot.jobs with the value count.
For example running the SQL query when booking table has the following rows:
Would see the following highlighted values in plot.jobs being updated to 1:
I managed to resolve it with this code so far (note I am using Connector/Net):
public void RefreshPlot(){
string query =
"SELECT Count(*) AS count, plot_id FROM booking WHERE postcode='MK' AND status='open' GROUP BY plot_id";
var cmd = new MySqlCommand(query, _connection);
var da = new MySqlDataAdapter(cmd);
var dtCounts = new DataTable();
da.Fill(dtCounts);
[code]....
Currently, my code only checks for existing rows in the booking table and updates the plot table. However if the row gets deleted in the booking, then the changes are not reflected in the plot table.
Example: If we delete the row with plot.id=1 and plot.plot_id=4, then booking.plot_id should go back to being 0, if it was initially 1. At the moment, it doesn't. How would I update my SQL statement to better reflect this? In a sense, it should check for "non-existent" rows, i.e. the impact that the row plot.plot_id=4 & plot.id=1 has on booking.plot_id when deleted?
View 6 Replies
View Related
Mar 25, 2013
I have a C# .NET Application which get data from QuickBooks via the ODBC Driver and save the result to C# data table. So, I want to transfer this data table to a mysql table on my own server. That's the code I use:
using System.IO;
using MySql.Data.MySqlClient;
//Add mysql dll on the .NET Tab in Project's references
string connStr = "DSN=QBTest;";
string myServerAddress = "192.168.0.243";
string myDataBase = "CostTest";
[Code] ....
View 2 Replies
View Related
Mar 8, 2015
I am a bit stumped with trying to write some code to get the tableadapter/binding source to "update" a current 'user' to the table.
I have the insert/delete methods working fine, but it's the updating that has got me screwed up.
Example of insert.
try
{
personTableAdapter.Insert(tFirstName.Text, tSurname.Text, Convert.ToDateTime(tDoB.Text), tPhone.Text, tAdd1.Text, tAdd2.Text, tSuburb.Text, tState.Text, tPostcode.Text, TeacherType.Text);
teacherTableAdapter.Insert(Convert.ToInt32(tTID1.Text), tRegNo.Text, tPassword.Text);
[Code]....
I also tried to do the updated string/original string with the tableadapter.update, but that didn't work either.
View 7 Replies
View Related
Feb 27, 2015
Here's my game, what do I need to learn to make a basic GUI? (Easiest way possible for now).
--NOTE, the code was a bit too long for me to post. I can add it if it is necessary. Basically all I want are 4 buttons on the main screen, one that says "Arena," "Store," "Stats," and "Exit."
There will of course be sub menus to each option, but we will get to that later.
View 1 Replies
View Related
May 28, 2013
I have project that is on c++. it runs fine. i want to use it in my C# application as a dll. i have created its dll and but firing exception of "interprocess communication".
Is this a doable task that creating dll of an exe project and using it in C# application?
View 1 Replies
View Related
Dec 17, 2013
So I tried to find some youtube videos on how to make a DLL, I found one, I also found several topics (like on msdn and stuff), but I have this code
header
#include <WinSock2.h>
#include <WS2tcpip.h>
#include <Windows.h>
#include <string>
using namespace std;
#pragma comment(lib, "ws2_32.lib")
[Code] ....
And I'm getting these errors:
1>error LNK2001: unresolved external symbol "private: static char * PathSocket::cBuffer" (?cBuffer@PathSocket@@0PADA)
error LNK2001: unresolved external symbol "private: static unsigned int * PathSocket::socket" (?socket@PathSocket@@0PAIA)
error LNK2001: unresolved external symbol "private: static void * PathSocket::hIDTask" (?hIDTask@PathSocket@@0PAXA)
WHY is there static, and what does dllimport/dllexport does? also there are NO tutorials with variables inside dll >.<
I've been following this [URL] ..... and the video I already lost, however there's no
#ifdef MATHFUNCSDLL_EXPORTS
#define MATHFUNCSDLL_API __declspec(dllexport)
#else
#define MATHFUNCSDLL_API __declspec(dllimport)
#endif
in the video, why do we have to use that? [URL] .....
View 19 Replies
View Related
Nov 13, 2014
I am trying to get this to work without arrays. At the moment all I am trying to do is allow it so that when the user presses 1 the board prints with 1 replaced by X, tell me where am i going wrong. I know its not finished.
#include <stdio.h>
#include <stdbool.h>
char a = '1';
char b = '2';
char c = '3';
[code]....
View 3 Replies
View Related
Oct 13, 2014
So basically I have to write a C program that, when opening the html file in a browser, looks essentially like this: (Size, position, color of the shapes doesn't matter so long as I have one of each shape and the box surrounding them. Words up top dont matter either.)
This is what I have so far:
Code:
#include <stdio.h>
#include <stdlib.h>
#define FILENAME ("A4P1.html")
[code]....
Anyways i can get the individual shapes, but I don't know how to get all the shapes to appear at once..
View 6 Replies
View Related
Oct 15, 2013
i have an assignment where i have to draw a teapot using triangles, and are struggling with the part where i have to color it. Here is an link to the assignment URl....
I have managed to draw the teapot and translated it onto the screen. the part i need support with is making a bounding box for the triangle and coloring it.
View 5 Replies
View Related
May 17, 2013
I'm creating a game in which i.need player to.answer.my question within 10 seconds...
So I need a code for this timer... I don't want code to be paused by sleep or delay functions.. But I need that it waits.for 10 seconds.. and if user types answer in between.. it.reads it
And if player.doesn't answers it within 10 sec.. it displays a message
View 2 Replies
View Related
Jun 28, 2014
One exercise says that, "Define a right triangle class. Make an octagonal shape out of eight right triangles of different colors."
Making such a class isn't difficult. I wrote it as follows:
#include "Simple_window.h"
class right_triangle : public Shape {
public:
right_triangle(Point p, int l, int sh): c(p), _long(l), _short(sh)
[Code] ....
But it sounds that making an octagon using eight right triangles isn't possible!
View 2 Replies
View Related
Nov 23, 2013
#include<iostream>
#include<fstream>
#include<iomanip>
[Code].....
make it sort ascening wise for salaries and have the occupation sort with it.
View 6 Replies
View Related
Sep 20, 2014
I wish to create a simple animation, similar to the pong game but completely automatic (i.e. both sides play against eachother sort of like in a screensaver of sorts).
I am clueless on to even start tackling this, what tools to use and how to use them, to make them do what I want. I have had some experience with C++ scripting while modding Fallout 3, but I'm not sure how similar the scripting system available in the SDK for that game, is to the real thing.
Like I was saying I want to create a simple animation where two AI blocks try to prevent a ball from reaching the wall behind them.
View 3 Replies
View Related
Jun 28, 2014
One exercise says that, "Define a right triangle class. Make an octagonal shape out of eight right triangles of different colors."
Making such a class isn't difficult. I wrote it as follows:
#include "Simple_window.h"
class right_triangle : public Shape {
public:
right_triangle(Point p, int l, int sh): c(p), _long(l), _short(sh) {
add(Point (p));}
void draw_lines () const
[code]...
But it sounds that making an octagon using eight right triangles isn't possible!
View 4 Replies
View Related
Nov 19, 2014
What my ultimate goal here is to make a program that asks the user how many numbers they would like to add followed by asking the user what numbers they want to add. I want the amount of numbers they can add to be infinite and have the loop continue adding the numbers until it reaches the final number. I just need to know how to do this.
Here's my code:
#include <iostream>
#include <string>
using namespace std;
int main() {
//variables
int amount;
float num;
float sum;
[code]....
View 3 Replies
View Related
Nov 11, 2014
I'm trying to write a code that proves a queue like fifo (first in first out). I have four characters :
p(rint),e(nqueue),d(equeue) and q(uit).
The problem is when I press d a first character must get rid of, but not. When I press d the numbers get double.
Example input:
e 2 3 9 8 7
p
2 3 9 8 7
d
p
3 9 8 7
d
p
9 8 7
#include <stdio.h>
void enqueue(int queue[], int newnum, int *tail_p, int maxsize);
void deque(int queue[], int *tail_p, int *elem);
void printqueue(int queue[],int count);
[Code] ....
View 1 Replies
View Related
Jan 16, 2015
Code:
class Robot{
char name[15]; //assign to char n
int x, y , direction;
void ToString(int d);
[Code]......
how do i assign char name[] in the class to char n in the constructor?
View 3 Replies
View Related
Dec 15, 2013
Code:
#include <stdio.h>
#include <stdlib.h>
#define CLASS 4
#define STUDENT 11
#define GRADE 5
[Code] ....
Giving me that error on 75:10
avesub+=grade[k];
and 90:17
donkeypunch+=grade[j][k];
not sure exactly why
View 8 Replies
View Related
Mar 6, 2015
I have a problem with making header files in c, i get the code written only in main.c and then i have to create a files with extension .h and extension .c but how to do it.
View 4 Replies
View Related