Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I haven't read the book Dune but the movie is great. I've seen the movie so many times that I wore out the tape (vhs) and had to buy a new copy.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why would anyone indulge in such mindless entertainment? .

Because we humans need a little diversion occasionally. All work and no play makes Jack a dull boy (author unknown)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

:cheesy: :cheesy: my high score in 10 tries was 206.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The way we do it is each place has its own database and the databases replicate the data to a central site. If the internet connection happens to be down then the replication waits until the connection can be restored. You will need a much more sophicated database than something like Microsoft Access can provide. MySql, Microsoft SQL, Sybase and several others will work for you. Be prepared to spend some $$$ for that.

As for table design, you need to find out exactly what data elements that need to be stored. For example, a sales table might have

unique StoreID (probably char string or int)
product ID
sale date (date and time)
sale amount
customer ID (if sale is to a company)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In USA that would be a question most 8th graders could answer. You will be pretty lost in programming if you do not have at least that level of mathametical skills. You should probably take a remedial math course to bone up on algrbra and trigonometry. and there are many specialties of programming that require much higher level math skills.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

. Do you want me to run the loop within a loop or it is suppose to be a sepertate loop.

get the sum as you are doing now, but after the loop finishes, the average is just the sum divided by the number of items. No point in calling a function to get that simple calculation.


>> MOST IMPORTANTLY, i can't figure out that how can i get the average grades in letter

The average used in calculating the standard deviation is NOT a letter grade such as 'A', or 'B', but the numerical average, such as 3.5. The letter grade is not even mentioned in the requirements you posted.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The only time I use this-> is to resolve ambiguous names.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why did you remove those libraries from the link options? what are a few of the missing functions ? You obviously are missing some libraries, but you have to find out which ones.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I also have Visual c++ 6.0. I hope everything will be ok with that.

:eek: :eek: :eek: That compiler is buggy, very old, not very compiliant with c or c++ standards, and has sever million other problems. Microsoft wrote that compiler to write MS-Windows programs, not to learn how to program. You would be better off with pencil & paper than you will be trying to learn the c++ language with that compiler.

Download the latest Visual C++ .NET Express or get Dev-C++ if you want good modern compilers that recognize most (but not all) c and c++ standards. There are no compilers that are 100% compliant, but those two are pretty close.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I.e for each of
the n values, you take the difference between that value and the
average, square that difference, and sum all n squares. Then divid that
sum by n-1 and take the square root of that quotient. This gives you
the standard deviation.

That is how the sd is calculated. It will be a lot easier for you if you just take the requirements one sentence at a time. Below are code snippets of what I think will work -- I didn't compile or test them. But hopefuly it will give you an idea of how to do this.

// get simple average of all scores
average = sum / SIZE;
...
...
// [b]inside a loop[/b], do first sentence. 
double diff = (scopre[i] - average) ;
sum_of_squares += (diff * diff);
///
// after the above loop finishes, do second sentence

n = sum_of_squares / SIZE;
standard_deviation = sqrt(n); // sqrt() is in math.h
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

See revised BubbleSort() and how Array is passed to it.

#include<iostream>
using namespace std;
#include<cstring>
void BubbleSort(  const char *array[] , int size );


int main()
{
const int ArraySize = 10;
const char * Array[] = { "Toronto", "Montreal", "Alberta", "Quebec", 
	"NewYork", "Calgary", "Edmonton", "NewJersey", "Ontario", "California" };


cout << "The unsorted arangement of the town names is: \n"<<endl;
for ( int i = 0; i < ArraySize; i++ )
{
cout <<" " << Array[i] << "\n";
}

BubbleSort( Array ,  ArraySize);
cout << "The sorted arangement of the town names is: \n"<<endl;


for ( int j = 0; j < ArraySize; j++ )
{
cout <<" " << Array[j] << "\n";
}



return 0;

}

void BubbleSort(  const char *array[] , int size )
{
    for ( int next = 0; next < size - 1 ; ++next )
    {
        for ( int j = next+1; j < size ; ++j )
        {
            if( strcmp ( array[next],array[j] ) > 0)
                swap ( array[next] , array[j] );
        }
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I am not familiar with functions and i tried to create it but i fails to run
please post the code so that we can help you. What compiler and operating system are you using?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

file operations like reading, writing etc using C language

what do you want to know about them? Here is one tutorial that I hope will help you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

please post the code that loads the spreadsheet.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Mazatrol.dat is not a binary file but a text file that contains probably some bitmapped representation of the data that needs to be sent to the machine tool. In order for Mazatrol.dat to be useful to you, you will have to find out what all those numbers mean, one way to find out is to read the machine's programmers' manual and find out how it is controlled. But that may be the manufacturer's prepritory (secret) information.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I wonder if it is possible to download into the 68HC11 microcontroller to help me control external device such as on or off lights? Hope that you can help me out. 10z:cheesy::?:
:

That is not possible because VB6 does not generate 6811 assembly language code and requires MS-Windows operating system.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the link doesn't work

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
while(*(p+*p))

Does that really work :eek: doing pointer math using a character in the string. *p deferences the string, so if it happens to point to the letter 'Z', the result of the pointer math would be *(p + 'Z') or *(p+90) which might attempt to dereference the pointer way beyond the end of the string.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I read it in a thread on google group that mixing arrays and pointers interchangbly was not good so just thought I would point it out.
Thank you.

Well, they were wrong. There are millions of programs out there that use dynamically allocated arrays as I posted in my example.

But in c++ programs it isn't necessary because, as mentioned by both of us mentioned previously, c++ has vector class which handles all the messy allocation stuff. And I believe that is how vector class is normally implemented -- dynamically allocating C-style arrays.

There is a lot of difference between something which is an array and something which is used as an array.

Name one. Anything you can do with statically allocated arrays can be done with dynamically allocated arrays -- the reverse however is not true.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The important differentiation here being used as arrays and actual arrays.

Thank you.

But they can be used as arrays. No difference except the allocation method. (and a couple other minor differences).

[edit]I reread your statement again and see the distinction you were trying to make. I believe the distinction should be between statically allocated and dynamically allocated arrays. The are both arrays, its just how they are allocated is the difference. It's a matter of getting the terminology correct. statically allocated arrays can not be reallocated. Others can. [/edit]

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I suspect there are billions of planets in the universe that have water. We earthlins are probably not alone.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have a cat named -- "Cat". They don't respond to names anyway so why bother with giving them cute names. My cat, a male, is the lazyest cat I have ever seen -- I have to catch the mice and give it to him! He was neutered, so maybe that explains his lazyness. I will never ever have a male cat again. Female cats are a lot more aggressive and much better mousers.

I also like dogs -- mine died a couple years ago and do not intend to replace him.

Sulley's Boo commented: LOL @ your cat's name .. cute! +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since the memory is not allocated during run time for arrays, you cannot resize it. The option is to use Linked list or vectors.
Regards
Murthy

what gave you the idea that arrays can not be reallocated? new, malloc, or realloc() can be used to do that. Linked lists and vectors are better opions, but not the only options.

// supplySize indicates the current size of the array.  When elementsUsed equals supplySize then the array must be increased
int supplySize = 25;
// elementsUsed intidates how many elements in the array have been used.  It should be increased each time a new element in the array is used
int elementsUsed = 0;

// array with initial allocation.
BSUPPLYER * supply = new BSUPPLYER[supplySize];

// now increase the array size

if( (elementsUsed+1) == supplySize)
{
   // add one new element to the array
   BSUPPLYER * temp = new  BSUPPLYER[supplySize+1];
   // copy data from old to new array
   for(int i = 0; i < arraySize; ++)
   {
        temp[i] = supply[i];
   }
   // delete old array
   delete[] supply
   // rename old to new
   supply = temp;
   // bump array counter
   ++supplySize;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That is a c++ program so why don't you just use a vector of BSUPPLYER objects

vector<BSUPPLYER> supply;

The vector is an array that will increase and shrink itself as you desire. You don't have to bother about memory allocation.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why do people keep saying VC++ is a language. It isn't. VC++ is the name of Microsoft Visual Studio C++ compiler, not a language.

>>C and C++ are free C# is not.
Again, those are languages, not compilers. Some compilers for each of those languages are free and some are not. Microsoft installs a free C# compiler with every version of .NET framework and it also gives away free its Visual C# .NET 2005 compiler/IDE.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

that compiler are you using? That is borland specific and will not work with non-borland compilers.

What are you trying to accomplish? There are probably other ways to do what you want to do. You can use these win32 api console functions to move the cursor to specific location. Just include windows.h in your program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

We can have our own favorite people in life, or those we dislike, but we shouldn't be saying whether someone is "good" or not.

In an ideal world you are right. But there are many people who leave little doubt that they are not only "bad" people, but they are "evil" people. I have in mind murders, rapists, etc.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When Narue said that compassion and kindness had no place in this world, I felt bad for those good humans

Yes I agree with you. The world is filled with people who have compassion and kindness to other people and animals. I have little respect for people who are otherwise. That doesn't mean I hate them -- I don't hate anyone.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Unfortunately, developers still do have to worry to some extent about CPU and memory usage. Thinks like memory leaks pop up, even if the code is easy to read and/or maintain. ;)

(you forgot to free() what you allocated)

There are still many cases where speed is more important than the programmer's time and salary. embedded programs for example require fastest running code possible, so programmer's can not do sloppy or inefficient work there.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have rearanged my code but I still cannot compile my program.

what are the errors? Pay attention to them. Example:

1. line 20: get_number() is undefined. You have to defined variables and functions before they can be used. Did you forget to prototype it?

2. line 24 has a syntax error. But look at the line above it and you will see that you forgot to end the statement with a semicolon.

3. line 26. parameter 1 is incorrect data type. Expects an array of ints and you are trying to pass an array of longs. Either change the array or change the function prototype to accept an array of longs.

4. The next few errors occur because you failed to end statements with a semicolon. Pay attention to details.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

first thing you need to do is rearrange the program so that it contains valid functions. Pay attention to where the opening and closing braces are located. You can not start a new function before ending the previous one. Try to align the braces as neatly as possible in order to make this easier to see.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

do you know what a "double precision floating point" is? If you don't know what it is then look it up in the index of your text book. It should explain the different data types to you.

in main() function, declare three variables of that type. Write that much of the program, post your program and ask questions if you have problems.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

identifiers and keywords

>>Cin and cout in C++ are keywords or identifiers?
look at the list of keywords in the link I provided, then you can answer this question yourself.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The general theory of OOP is the same in all languages. Its just the implementation that is different. As you continue your VB studies you will see what are the similarities and differences.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Should i need centeralised server like WAN or every day data transfer
If the volume is quite high you will want to use a centralized server. I'm supprised you don't have one already.

>>I need to know the Table design
Since we don't know the exact information you need it will not be possible for us to help you out very much with that. You probably need more than one table.

what's the purpose of the tables? IRS tax reporting? then you need to consult an accountant. If you already have a database for that purpose maybe you can just use the information in that database instead of creating another one.


(1) general store information, such as an account number unique to each store, address, store manager's name, phone number, etc.

(2) Sales table with store account number and sales information. This could be a simple or complex as you need.

(3) Purchases. similar comments as for Sales.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you need to make your program a little more complex. Instead of one big spirntf() line you need to create a loop, for each row, search all rows from 0 to current row-1 to see if it is a duplicate, if not then use strcat() to copy its value into string1 array. Note that you will not use sprintf() at all.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

are you compiling for UNICODE. If you are using VC++ 2005 that is the default.

If yes, then typecasting won't work. you have to use a conversion function to convert from wchar_t* to char*

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

:o...

Tells you how much I know about Windows programming. :cheesy:

No problem -- all of us (except maybe Narue) makes mistakes. :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think you need to use _tcscpy() to do the conversion.

Hope this helps

No. LPCTSTR is defined as const char *. No conversion needed except typecasting to remove the const attribute. Depending upon what is going to be done this may or may not be a good idea.

Example:

int main()
{
  LPCTSTR s = "Hello";
  char *p = const_cast<char*>(s);
  return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In function cmdReadValues_Click() check that file_length > 0. The file in your zip is an empty file.

Otherwise, I don't see any problems with that program. Just make sure you click the Write button first to generate the file.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I wouldn't be so sure! There's a device in development that can interface with a human brain (motor control area), and someone whos paralysed (or just interested in the idea) can move a mouse around and select things. With a bit of work on the resolution of the device; i suppose you could map a full keyboard ^_- Just a brain controlled mouse would be convenient.

I said it is highly unlikely, and you just reinforced my statement. If that device is still under development than it is next to impossible for the general public to have it. But it has great possibilities for those that need it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh,oki than :)
in my country the word engineering has a slightly different meaning

the term "computer engineering" is misused by most people in the USA also. Most people who call themselves "computer engineers" are no such thing -- in USA engineers have to have an engineering degree and pass engineer tests, something like other engineers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I really hate asking this but could someone do this for me? I absolutely despise programing

Nope. If you don't want to do it then drop the class and take something else, such as basket weaving, that you might enjoy better. No point in doing something that you hate.

>>i'm a quadrapelegic

Quadriplegia, also known as tetraplegia, is a symptom in which a human experiences paralysis of all four limbs, although not necessarily total paralysis.

If that is true, how do you do computer programming? If have seen films on TV about quadrapelegic using a computer with something in the mouth to control the keyboard, but it is highly unlikely they can program computers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster


while I'm at it, for the #ifndef stuff, should I be putting the class name in there instead of a TGA_H? I thought I had seen it done that way before...

I always use the header filename, but it doesn'r really matter as long as it isn't duplicated anywhere else.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Computers that do not have VB6 installed need the runtime DLLs

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The 4th thru 7th are calculated values from all the scores in the file. You can't print them out in the case statement, instead print them out after all the rows in the file have been read. You will probably have to add another case statement to do that.

For example, #4

Lowest total points scored by both teams in a single NCAA Tournament game (include game information

You need to have a variable that keeps track of the row with the lowest score. Than after all rows have been read, using another case statement print out the required information.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The while ( In == NULL ) loop actually works perfectly. That's how I've always done that.

I see your logic -- if the file was not found, then ask for a new file name.

I never did understand the stuff to prevent the recursive header thing, I don't really get it yet. I'll have to ask someone to explain that for me.

Its for instances when a .h file is included two or more times, which often happens with your compiler's standard header files. This prevents symbols from being defined more than once.

And why would subtracting '0' from a character convert it to an integer?

lets take the example of '1'. '1' - '0' = 49 - 48 = 1. You can use a good ascii chart to see all the decimal values of the characters. I like to use '0' in my programs instead of 48 because it makes more sense.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

is that 40k in dollars?

£40k is very good wage here in the uk

$40,000 USD is only worth about £20,000 in England. £40K is about $80K here, which is pretty good wages in most (but not all) usa.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I presume SOS may not have the fast internet access we have here in USA. 50Mg can be a lot for slow dial-up modems or whatever people in India use.