C/C++ :: Run Basic Stats On 150 Tables

Mar 7, 2014

I need to run some basic statistics on about ~150 tables that are currently in dBase format. Rather than use excel to do them all individually, i was told to use s+ and write a code to loop through them, but I have never written any code and my experience with spotfire s+ is limited (the stat software i have available) ....

View 4 Replies


ADVERTISEMENT

C++ :: Word Stats Using Loops / Arrays And More

Sep 11, 2014

Write a program that will ask the user to enter some words followed by the word END.

Input the words into an array and then output the following statics:

the list of and the count of how many words were typed (not counting END) -- Test 2
the list of and the count of how many unique words were typed -- Test 3
the list of sorted unique words (in alphabetical order) -- Test 4
the list of sorted unique words along with frequency counts for each word -- Test 5
See the sample run below:

Please type in some words.
Type END and return when you are finished.
red green blue
RED red blue green blue orange red
reg apple banana banana
END

You typed the following 14 words:
red, green, blue, RED, red, blue, green, blue, orange, red, reg, apple, banana, banana

You typed the following 7 unique words:
red, green, blue, orange, reg, apple, banana

Here are those same unique words sorted:
apple, banana, blue, green, orange, red, reg

Here are those same unique words sorted with a count of how many times each was used:
apple: 1
banana: 2
blue: 3
green: 2
orange: 1
red: 4
reg: 1

View 2 Replies View Related

C/C++ :: Program To Calculate Stats Based On Snakes And Ladders

Feb 28, 2014

I have a problem with my code while trying to simulate a snakes and ladders program. The objective of the program is to simulate many games (100000+) to gain statistics:

1. The most likely number of rolls.
2. The mean value of the number of rolls.
3. The most common square, C, on which a token may come to rest. i.e. move on to.
4. The probability of coming to rest on square C.
5. The least likely square on which a token may come to rest and what is the probability of this occurring.
6. The distribution in the number of rolls needed per game presented as a normalised graph.
7. The minimum number of rolls of the die - called Nmin.
8. How many different paths (unique sequences of die rolls) take Nmin rolls to complete the game?

However my program (on Tenacious C) doesn't seem to run at all...

I have run it on internet compilers and other compilers but it must work on Tenacious C.

Below is the code I have at the moment, it works fine when stepped through or ran on a different compiler.

How to create code to answer the 8 points above. For instance, to get point number 2. I must find the total rolls divided by the total number of games, but am not sure how to do this.

Code:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#define NUMBEROFGAMES 10
int GetThePositionOfMovement(int CurrentPosition, int dieValue);

[Code] .....

Attached image(s)

View 3 Replies View Related

C++ :: Hash Tables And Queues

Jun 3, 2013

For my homework I need to create a hash table with a size of 7. I also need to create a queue that holds 3 names maximum for each table position

View 1 Replies View Related

C/C++ :: Tables Initiated With Pointers

May 23, 2014

In my code I have lots of structures. I try to make tables of structures and then get access to elements of the structures to use them all along my code: here is an example to clarify things

typedef struct {  
Fabric **closfabric;  
}Network;  

Net is part of another structure called Switch and Fabric itself is a composed structure. I have done the following

aSwitch->net.closfabric = (Fabric **)malloc(3* sizeof(Fabric *));  
aSwitch->net.closfabric[0] = (Fabric *)malloc(m * sizeof(Fabric ));
aSwitch->net.closfabric[1] = (Fabric *)malloc(k * sizeof(Fabric ));
aSwitch->net.closfabric[2] = (Fabric *)malloc(m * sizeof(Fabric ));  

The compilation returns a segmentation fault because aSwitch->net.closfabric is NULL (0) .

Surprisingly, in other codes the same analogy of using tables made of double pointers works perfectly with no problems and I have no problem of core dumped and NULL pointers.

Why am I getting this problem. It is the case whenever I try to use large dimension tables (tab *** struct for example)...

View 2 Replies View Related

C++ :: Program To Display Multiplication Tables

Feb 8, 2014

I have to write a program to display multiplication tables. I have written the following code:

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

[Code] ....

View 2 Replies View Related

C# :: Update Multiple Tables In One Query?

Jul 23, 2014

i'm trying to update multiple table values with same column using one query.

Here's what i've tried so far:

mySql.CommandText = "Update tbl_employees,tbl_emp_additional_info,tbl_allocated_deductions,tbl_benefits,
tbl_cashadvances,tbl_deduction_history,"+
"tbl_dtr,tbl_empabsences,tbl_empstatus,tbl_otherdeductions
,tbl_ots,tbl_payroll_history,tbl_rdcomments,tbl_reversed_deductions,tbl_reversed_deduction_paid "+
"set tbl_employees.emp_id=@newemp_id,tbl_emp_additional_info.emp_id=@newemp_id,tbl_allocated_deductions.

[code]...

I've also tried removing all the other "and" operators but still no luck.It doesn't throw in exception yet it doesn't update my tables column values.

View 14 Replies View Related

C++ :: Five Different Tables - Array Sort Exception Return

Dec 18, 2014

I am creating 5 different tables each one has 20000 more elements more than the previous when i try to sort them with the sort algorithm quick sort for the first table tha has 20000 elements runs grate then it throws this exception how is this fixable ?

Exception : terminate called after throwing an instanceof 'std::bad_alloc' this application has Requested the Runtime to terminate it in an unusual way. Please contact the applications's support team for more information. Process returned 255(0xFF) . here is the code that gives this return :

Code:
#include<time.h>
#include<stdlib.h>
#include <string.h>
#include <ctime>
using namespace std;
int * Create_Table(int table[],int N);

[Code] .....

View 10 Replies View Related

C++ :: Enter A Value And It Will Return Corresponding Correct Answers From Tables

Dec 17, 2013

Currently I have to manually look up values on several different tables in different locations. I have 8 or 10 tables with 100 to 500 parts.

I would like to write a program so if I enter a value it will return the corresponding correct answers from the tables.

If I entered 2.5 for a value it would return the following three items from the tables since they all meet the requirement.

Table 2
Part min max
235 2.4 2.9

Table 6
Part min max
589 2.3 2.5

Table 7
Part min max
12 2.3 2.7

What would the best method be for setting up and accessing tables like this? Is C++ good at representing something like this or should I be looking at a different language?

View 3 Replies View Related

C# :: Join Tables In LINQ With Lambda Expressions

Dec 5, 2014

i have stuck in a join and i cant figure out where the problem is, i have those tables

public class Themes
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }

[Code].....

View 12 Replies View Related

C# :: Javascript Data Tables Not Showing On Page?

Nov 10, 2014

The problem is that the data table doesn't show at all. Here is the code:

<%@ Page Title="" Language="C#" MasterPageFile="~/LB/MasterPage.master" AutoEventWireup="true" CodeFile="InsertedInfo.aspx.cs" Inherits="LB_InsertedInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

[Code]....

View 5 Replies View Related

C# :: Using Info From MySQL Tables And Referencing Results

May 8, 2014

Basically I have a few tables in my Database.

So I have one table that is like so:

Item_ID, Name, Parent ID.
1 , jeff , 5

and another table like this:

Parent_ID, parent_Name
5,jackson

What I would like to happen, when I run my code is that I'll get the following

Item_ID, Name, parent_Name
1 , jeff , jackson

DataSet DS = new DataSet();
if (this.OpenConnection() == true) {
mySqlDataAdapter = new MySqlDataAdapter("select Item_ID, NAME, Parent_ID from table1, table2", connection);
mySqlDataAdapter.Fill(DS);
dataGridView1.DataSource = DS.Tables[0];
//close connection
this.CloseConnection();
}

So this spit out parent ID = 5.

I've not worked with Dataset before and I was just wondering what is the best approach? Can this be done via a SQL command or will I have to replace the value(5) with the string(jackson) using a large IF loop to search and replace.

View 1 Replies View Related

C++ :: Radix Sort Not Working - Implementation Using Two Tables

Jun 13, 2014

I'm trying ultimately to do a radix sort. I'm going with the implementation using two tables. One will initially hold the unsorted values then hold the partially sorted values thereafter. The other will be an array of linked lists which will be where the radix sort is done. Here is my code thus far:

Main

#include <iostream>
#include <fstream>
#include "radix.h"
#include "radix.cpp"
using namespace std ;
int main ( int argc , char * argv [ ] ) {
ifstream input ( argv [ 1 ] ) ;

[Code] ....

It appears to be crashing during void insert_into_sorted ( int to_insert , int place ) ; and I'm not sure why.

View 2 Replies View Related

C Sharp :: Combining Multiple Access Tables Using C#

Aug 14, 2012

I'm having a bit of trouble with something. What I'm trying to do is create a new Access table by combining other already existing Tables.

For instance, let's consider Table1 (with columns A, B and C), Table2 (with columns A, D and E) and Table3 (with columns A, F and G), where Table1.A = Table2.A = Table3.A.

From these, I want to create a new table TableResult, with columns A, B, C, D, E, F and G, with all the data contained in them. There's one catch: I want the code to get the names of the other columns, apart from column A.

I've thought about using Union, but I need to actually create a new table by combining the previous tables.

View 11 Replies View Related

C# :: Link Multiple Tables In Crystal Report With Foreign Key

Apr 2, 2014

i have 2 tables with primary and foreign key

Customer Details

EID - Primary Key

PurchaseDetails

PNo-Primary Key
PDate,
EID- Foreigh Key
NetAmount

Report Query written in c#

SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.LT, P.NT, P.EID, P.PTime, C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID

In Report Automattically linked based key.

but report data not showing

View 1 Replies View Related

C# :: Multiple Tables Conversion From Excel XLS File To XML With OpenXML

Apr 25, 2014

I have downloaded this project from here -->> [URL] ....

This one works fine and it's a great commented code to understand even for beginners like myself, but it only works with one table per sheet. Once I add second table in sheet, it throws an error that something is wrong in one of the columns in my spreadsheet: It says: " Error occurs! The error message is: Cannot find column 4. "

Basically, I have this type of tables in my spreadsheet:

So I want that my program would export those two tables in a single .XML file (just read them both). And those two tables should be separated in two XML childs: the upper one should be Order-Header and the lower one - Line-Items, like this:

<ROOT>
<Order-Header>
.....
</Order-Header>
<Line-Items>
.....
</Line-Items>
</ROOT>
ConvertExcelToXML.cs:

[Code] ....

I copied all the code because I think it is the easier way to spot where to change it, to read those two tables in one spreadsheet and export them both in one XML file. How could I achieve this kind of functionality.

View 14 Replies View Related

C# :: Entity Framework - Select Specific Column In Tables

Apr 28, 2015

I need to show in a comboBox thats shows infor from Entity framework but i need to select a specific colum in the tables..

All in C# visual studio xaml form

So I created a var but i get and output: name of programe.NLHEntities

using (var context = new NLHEntities()) {
var blog = context.EtagesChambres
.Where(b => b.TypeChanbre == "Prive")
.FirstOrDefault();
textBox2Type.Text = Convert.ToString(blog);// i put a text box to see what the output would be..
}

View 14 Replies View Related

C++ :: Basic Encryption And Decryption Program

Sep 29, 2013

I am having trouble with an assignment. The assignment consists of a basic encryption and decryption program already written for me, I just have to write the encryption function. What we have to get the program to do is enter an integer and a text, and get the program to increment each letter in the text by the integer given. I did this by using a for loop and incrementing each value in the string by the integer.

However, I still can't get it to decrypt and I need the program to work with only a-z letters (if I increment each letter by 3 and I have the letter Z, it should go to Z+3 = C).

I attached the description of the attachment and below are the codes: The first file does not need to be edited.

Code:
/*******************Programming Assignment 1***************/
/****************Caesar's substitution cipher**************/
/*****************YOU MUST NOT EDIT THIS FILE**************/
/****Substitute alphabets in a string using rotation key***/
/****Leave all other characters unchanged******************/
/****Confirm correct encryption by decrypting**************/

[Code] ......

View 1 Replies View Related

C++ :: Variadic Template Basic Syntax

Jul 31, 2014

I had to learn how to use variadic templates recently, and had trouble finding simple examples that just showed the basic syntax.

So I decided to write one myself. Admittedly, it's a bit on the long side, but that is mostly because it includes five specializations.

insert Code:
// Variadic.C
// Compile command: g++ Variadic.C -std=c++0x
// I used GCC version 4.6.3 on Ubuntu.

// This file contains a basic variadic template with five specializations.
// It is intended for non-software engineers who are looking for a simple
// example of variadic template syntax.

[Code] ....

View 3 Replies View Related

C :: Basic Array Pointers Program

Feb 4, 2014

Code:

#include <stdio.h>
void Swap(int *x, int *y);
int *Largest(int *array, int size);
int main()
{
int a, b, i;
int c[10];
int maxaddress;
}

[code]...

My swap function works fine, but I am trying to find the ADDRESS of the largest element in my array and I am getting an error using gcc on my "return &largest;" and my printf line in my main function.How can I fix this and return the address of the largest?

View 8 Replies View Related

C++ :: Basic Encryption / Decryption - While Loop

Jul 14, 2013

while(!in.eof()) {
in >> ch;
char d = int(ch) + 10;
out << d;

[Code] ....

The first while loop would be to encrypt it, and the second would decrypt it, the decrypting is not giving the original content. For example:

in = Hello
encrypt...
decrypt...
out = Hellooo

View 2 Replies View Related

C++ :: Calculating Net Pay - Adding Basic Procedures?

Nov 18, 2014

So I am currently in the middle of learning c++ and I decided to jump ahead of the book and tried to do add procedures. My goal is to have main calling other procedures such as welcome message().

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

#define MIN_HOURS 0.00 // minimum hours per week
#define MAX_HOURS 60.00 // maximum hours per week
#define MIN_RATE 0.00 // minimum pay rate
#define MAX_RATE 99.99 // maximum pay rate

[Code] .....

View 5 Replies View Related

C++ :: Configure Netbeans Basic Settings

Nov 22, 2013

I want to configure netbeans 7.4 settings for c++.I'm posting here because netbeans forums are close to dead. How to do the following things :-

1) When you create a new project of a 'new application' type, main.cpp is already there with some code. I want that main.cpp to be completely empty when I create a new project.

2) When you compile/build your program and run it, the output is shown in a small log window at the bottom. I want it to be shown like in a black output terminal (console ?) just like in Visual Studio or CodeBlocks. (I have some reasons for not using them instead, so don't bother about me not using them)

3) When you click the green 'Run' icon in the upper toolbar, the project is compiled/build again and then runs afterwards. I want it to just run without compiling. (Compiling/Building should be done by 'Build' icon, just like in CodeBlocks or Visual Studio)

View 3 Replies View Related

C++ :: Make Basic GUI From Scratch Without Using Any Programs?

May 26, 2013

I have learned the basics you need to know about c++ so I was wondering, how do you make a GUI from scratch without using any programs like qt, daniweb, ect. Is there like a ongui() or something?

View 6 Replies View Related

C/C++ :: Basic 2D Array Displaying Output?

Feb 23, 2014

I been for trying to create 5x5 2d array that

basically display first column, last column , and diagonally (like " N " display). but i cant get it to work.
this is what i have so far.

int _tmain(int argc, _TCHAR* argv[]) {
char Test[5][5];
for (int i = 0; i < 5; i++)

[Code]....

View 4 Replies View Related

C/C++ :: How To Do Basic Animation With GTK3 And Cairo Only

Apr 22, 2014

Let assume i have a gtk window with a drawing area and a button in it....

When the application is run it will show ball... when the button is pressed it will start bouncing from one side to other... When the button is pressed again it stop bouncing...

Also the window shows the current XY co-ordinates of the ball in the bottom left corner(inside the drawing area)...

I want to use C , GTK3 and CAIRO only...

I have googled and found animation example not with GTk3 but GTK's previous versions instead...those doesnt work with GTK3..i have also read cairo's official,zetecode's tutorails and some other sites..but nowhere found any solution to my problem...

I know how to do so with OpenGL and it's very easy...but i cannot apply the same logic with cairo and gtk3...please dont suggest to use GtkGlExt...i don't want to use it...

View 1 Replies View Related







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