I am having some trouble with my class assignment. We need to write a C program that will calculate the employee salary. There are 5 employees that will need to be calculated. We are required to use a loop also.
So far this is what I have but I am receiving errors when running the program.
#include <stdio.h> int main() { int clock_num; /* employee clock number */ float gross; /* gross pay for week (wage * hours) */ float hours; /* number of hours worked per week */ float wage; /* hourly wage */ /* Prompt for input values from the screen */ printf ("This is a program to calculate gross pay.
I already wrote a program that will calculate the gross pay for a set of employees.
I want modify the code by adding multiple functions.
I want to create a separate function whenever possible to break up the program.
For example, I would like have a function for obtaining the hours from the user, another function for calculating overtime hours, another for calculating gross pay and another function for producing the output.
#include <stdio.h> #include <stdlib.h> #define STD_HOURS 40.0 #define OT hour>STD_HOURS #define SIZE 5 int main() { int clockNumber[SIZE] = {98401, 526488, 765349, 34645, 127615}; /* employee ID */
Suppose I want to represent an apartment building in terms of floors and rooms with a single data object. Each floor has the same number of rooms at any given time. During the course of the program, I will need to change the number of floors occasionally and will need to change the number of rooms on each floor occasionally. (Don't worry about the building permits needed to do this.) Now, I also want to be able to iterate over either each floor (think "row") or each room (think "column"). For example, I might want to program the equivalent of "Johnson, go fix all the front doors on the 8th floor" or the equivalent of "Johnson, go fix all the front doors to room B on each floor". (Yeah, I know, for the latter I could iterate over each floor and then access room B but that doesn't feel as "clean" as being able to iterate over a separate room/column.)
Suppose I want to represent an apartment building in terms of floors and rooms with a single data object. Each floor has the same number of rooms at any given time. During the course of the program, I will need to change the number of floors occasionally and will need to change the number of rooms on each floor occasionally. (Don't worry about the building permits needed to do this.)
Now, I also want to be able to iterate over either each floor (think "row") or each room (think "column"). For example, I might want to program the equivalent of "Johnson, go fix all the front doors on the 8th floor" or the equivalent of "Johnson, go fix all the front doors to room B on each floor". (Yeah, I know, for the latter I could iterate over each floor and then access room B but that doesn't feel as "clean" as being able to iterate over a separate room/column.)
I have a 2d array where I manage donations and requests for different foods. I output a menu to the user who picks the options to either make a donation, make a request, fulfill a request, or print a status report of all the donations and requests. What I'm having trouble with is the fulfilling requests option. When the user picks fulfill requests that means that the donations are supposed to be subtracted from the requests. For example if there are 10 donations for grains and 15 requests for grains then after picking fulfill request there should be 0 donations for grains and 5 requests for grains but I don't know how to make the program do that since the values are in a 5 row by 2 column array. The five rows correspond to the five foods and the two columns correspond to donations and requests, respectively. Here's my code so far. Just disregard everything but the third case.
Code: #include <stdio.h>int main(){ int foodbank[5][2]= { {0,0}, {0,0},
i have a matrix containing a lot of points and each point has its coordinates x and y. That is a nx2 size array. I want to sort it according to the first column ascending, with x coordinates. For points that have the same x coord i would like to sort according to y coord. Here is what i did and i cannot get a good result.
Code:
#include <stdio.h> #include <stdlib.h> int main(){ int a[5][2] = {{1,0}, {4,2}, {2,4}, {8,6},{4,8}}; int temp=0; int i=0; int j=0;
I'm using GCC 4.8.1 and I want to implement a XML parser using TinyXML and port it to AngelScript
Now, it says: reference to 'Column' is ambiguous
I've declared a class called xml_parser and I've added everything of tinyxml as it's public member when I call Column(), and also Row(), it give's this error. what should I do?
I have .db3 file, and he has 14 tables,and every table has certain number of columns. Example i have table called "BASIC_INFO" and that table has columns "First Name", "Last Name" and "Age".
How can i get name of table and name of every column,so if i some day add column "Male" i get name of this column too. I need first to calculate number of columns,put that in some integer, and then for example create string array which will contain : array[0] = "First Name" ,array[1] = "Last Name"...
SQLiteConnection myConn = new SQLiteConnection("Data Source=" + DB3Path + ";Version=3;New=False;Compress=True;"); //string query = "Select * From " + DB3Path + ".INFORMATION_SCHEMA.COLUMNS"; string query = "Select * From BASIC_INFO.INFORMATION_SCHEMA.COLUMNS;"; SQLiteCommand sqCommand = new SQLiteCommand(query);
[Code] ....
I tried this too:
string query = "select * from INFORMATION_SCHEMA.COLUMNS" + "where TABLE_Name='BASIC_INFO'" + "order by ORDINAL_POSITION;"; string query = "SELECT TOP 0 * FROM BASIC_INFO";
I am writing a code in which i need to grab a column from a variety of tables. So basically there are 10 tables in which they hey have the same columns inside of them (Submitted and Amount). I need to grab the amount column from all the tables. What would be the c# sql command for that.
Can i set each column in Gridview with different Datasource ? for example I create Gridview with 3 column , can I set each column with different datasource ?
I am new in c programming and my teacher gives me home word to do. the home work is to create dynamic matrix that check if i have same number in row or in column. for example the matrix
1 2 3 2 3 1 3 1 2
is legal matrix and this matrix is illegal
1 3 3 2 1 3 3 2 1
I created the matrix and sent it to function but there I don't know how build the code.
Here is the draft of code that i designed. My task is here to create the matrix, allocate the dynamic memory for it, and to find the biggest sum of the column elements that is located over main diagonal. So main points is correct memory allocation, and the sorting to the biggest sum of column higher than diagonal.
I have two doubts in the following code,the doubts are marked..PLs note that the following code is correct .This is a program to read 2d array using pointer ()i.e Dynamic array ,to calculate its rowsum and column sum and display this array along row sum and column sum.
#include<iostream.h> #include<conio.h> void main() { clrscr(); int *Val,*Rsum,*Csum; int MaxR,MaxC,i,j;
Basically when I type in different widths and heights for the col and rows, the buttons that make up the width get cut off. Something is messed up but I'm not sure what!
InitializeComponent(); int _col = int.Parse(cols); int _row = int.Parse(rows); int width = groupBox1.Width; int height = groupBox1.Height; int bW = width / _col; int bH = height / _row;
var db = Simple.Data.Database.OpenNamedConnection("sqlConn"); DataTable dt = gridRatingEventHistory.DataSource as DataTable; string dateString = DateTime.Now.ToShortDateString(); dt.Columns.Add(dateString); gridRatingEventHistory.Columns.Add(new GridBoundColumn {
[Code] .....
if you look at 1st image 1 you can see what it looks like -- when i hit the button i just want a blank column to show next to the last column however i get image 2 results how can i fix this.
I am getting a excel sheet in datatable with some column "Program,Response,T,Timein".There is 3 condition for filtering datatable.
1.fetch unique program.so i got dis. 2.T not equal to "B". I also got dis. 3.Response should be > 5000. I also got dis data in datatable.
Now in Datatable I have same program name presented 3 times with response>5000 nd T<>B.Now I want to fetch only the maximum respnse among 3 of them. so every time my program should be change and for that program I need to pickup max response so How can I do this? for the same I put two loops
for (int i = 0; i < DataFilter.Rows.Count; i++) { DataRow dr = DataFilter.Rows[i]; DataView dv2 = new DataView();