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

It's about 2/3 of a year ago, 1/2 of four months ago.

Here's the history chart.

Rapid City SD $1.97 per gallon, mid-grade brand name gas.

That chart only shows the prices for the past 3 months, not a year ago. Prices here were over $4/gallon a year ago.

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

Location: My Town near St Louis Illinois
price in gallons: $2.05 (USD) $3.05 (AUS dollars)

The price of gas is now 1/2 what it was a year ago.

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

www.codeproject.com has thousands of free programs, code snippets and libraries for MS-Windows.

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

lines 26-31 are in the wrong order. Move them between lines 16 and 18. You have to validate the file is opened before you can read it.

If that still doesn't fix the problem then I suspect the file is not where you think it is. On line 14 use getline() and enter the full or relative path to the file.

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

put the code in a library or DLL than only distribute the lib or DLL along with the header file(s) that declares the function prototypes to the users. That is the common way to do it. Example: all the win32 api functions are in DLLs or libraries.

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

i try to read my errors, but no success. i tryed to fix them, no success

Post your attempt to fix one of the errors. Only try to fix the errors one at a time. Correct an error, compile, and correct again if its still wrong. Once that error is corrected go on the the next error.

c:\documents and settings\makhtar\my documents\visual studio 2008\projects\car dealership\car dealership\implementation.cpp(39) : error C2664: 'strlen' : cannot convert parameter 1 from 'std::string *' to 'const char *'

That is telling you that the error occurs on line 39 in the file implementation.cpp. Then it says the function 'strlen' takes an argument that is 'const char *', not 'std::string *' as you tried to pass it. If you look at that line in your program you will see what the error message is talking about -- you passed a pointer to std::string.

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

we don't do people's homework, but we will help if you show is some effort on your part. Post the code you have attempted and ask more specific questions.

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

post the error message(s)

line 3: should be int main() -- functions require a return type.

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

depends. If the file system is going to be all new then you will have to write a cross compiler first that will target the file system.

If you plan to use one of the existing file systems such as that used in *nix or MS-Windows then you can use one of the existing compilers.

I have not written an os, but I would imagine parts of it may need to be in assembly because there are some assembly instructions that have no c counterpart.

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

Even nuttier than Grimjack's post.
That's like saying the Speaker of the House is president for three weeks every 4 years.
Let's read the Constitution, people!

Learn to read -- I said "IF THAT WERE TRUE". I didn't say it was fact. But if it were true (which of course it isn't) then the Speaker would indeed be President during that time.

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

I compiled and did not receive those warnings. Attached are my project files for both the lib and test program, with *.o and *.exe files removed.

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

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.

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

I don't know where this came from, but thought it funny.

Operator: Thank you for calling Pizza Hut. May I
have your national ID number?

Customer: Hi, I'd like to place an order.

Operator: I must have your NIDN first, sir.

Customer: My National ID Number, yeah, hold on, eh, it's 6102049998-45-54610.

Operator: Thank you Mr. Sheehan. I see you live at 1742 Meadowland Drive, and the phone number is 555-1212. Your office number over at Lincoln Insurance is 555-2302 and your cell number is 555-2566. E-mail address is Seehan@home.net. I see you're calling me from home.

Customer: Huh? Where'd you get all this information?

Operator: We're wired into the HSS, sir.

Customer: The HSS, what is that?

Operator: We're wired into the Homeland Security System, sir. This will add only 15 seconds to your ordering time.

Customer: (sighs) Oh well, I'd like to order a couple of your All-Meat Special pizzas.

Operator: I don't think that's a good idea, sir.

Customer: Whaddya mean?

Operator: Sir, your medical records and commode sensors indicate that you've got very high blood pressure and extremely high cholesterol. Your National Health Care provider won't allow such an unhealthy choice.

Customer: What?!?! What do you recommend, then?

Operator: You might try our low-fat Soybean Pizza. I'm sure you'll like it.

Customer: What makes you think I'd like something like that?

Operator: Well, you checked out 'Gourmet Soybean Recipes' from your local library last week, sir. That's why I made the suggestion

Customer: All …

Ezzaral commented: hehehe Very good! +15
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What is the reason that compiler will not detect this error if it is not in single file?

You got it! The compiler only works with one *.c or *.cpp file at a time and creates object code files such as *.o and *.obj. Its the linker that puts the object files together with other libraries to resolve symbol references and create the executable file.

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

What do you mean "it didn't work" ? Do you take your car to the repair shop and tell the repairman "it doesn't work" ? You have to be a lot more descriptive of the problem, and post an example project.

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

Whose class is Cryptographer ? Is it registered ?

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

That was tried before in the Carter administration and didn't work out very well. Reagan repealed it. BTW gas has been cut in half what it was a year ago -- it was $2.05/gallon here yesterday.

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

This poster may be Sarah Palin.
I can understand ignorance, but to think that the USA goes three weeks every 4 years without a president is hard to believe.

Even if that were true we would still have a President -- The Speaker of the House Nancy Pelosi would assume the duties (because the VP's term expires at the same time as the President's).

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

You need to read the error messages, look at the line, and learn how to fix the problem. For example:

line 39: why are you calling strlen() to get the length of std::string? You don't have to do that -- just call std::string's length() function for (k = 0; k<(mercedes.mj.length() ); k++)

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

Here are some zip files that may or may not be useful

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

Since there are hyphens in the string that function won't work because it will return false on detecting the first hyphen. You need to check that the string consists of 3 digits, hyphen, 2 digits, hyphen, and 4 digits, and that all the digits are not zero.

Or you could buy for $24.99 this library. :) But I doubt that your instructor wants you to go that far in validating SSN.

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

first sort the array by the desired column

Because there are 20 rows, the 1st quartile will consist of rows 0-4 (5 rows), the 2nd quartile is rows 5-9, 3d is rows 10-14, and the 4th is rows 15-19.

The problem I see with your assignment is: "what are you supposed to do with that information?" Do you just print (display) the values in each quartile, create 4 arrays and copy the values into them? Or something else?

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

Is that even possible? How can a computer program know if sound is actually coming out of the speakers or not? But maybe there's some interface with the sound card API that will indicate that ???

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

Learning to spell and proofreading your posts would also be helpful.

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

The attachment just consisted of a few useless characters.

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

for a text file you just rewrite the file, leaving out the text you want to delete.

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

You could start by doing some of the exercises that people post here. Such as this one. Read though the threads here and pick out a few programs that you think you can write.

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

I'm not saying you can't do it in c++, but it will bring a lot of baggage (such as stl classes) that you may not want or need. C will be tighter code, smaller code, and often faster code.

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

This is an assignment to demonstrate your knowledge of c++ classes. If you know absolutely nothing about them then you probably have not paid attention in class and/or bothered to study your textbook.

Start out by defining a class with the attributes and methods mentioned in the assignment. Here is a start

class Inventory
{
   // your code goes here

};

The rest is up to you. When you have some code of your own you can post it here and ask whatever questions you may have about it.

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

In descriptive statistics, a quartile is any of the three values which divide the sorted data set into four equal parts, so that each part represents one fourth of the sampled population.

With that definition, all you have to do is sort the array, then use the array element that represents 0-25%, 26-50%, 51-75%, and 76-100% of the elements

The way I understand this, say you have an array of 16 sorted numbers. The quartiles will be the values at array element numbers 4, 8, and 12

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

C is probably a better language than C++. Lots of operating systems have been written using C.

>>The next question I have is where to start.
Here are some google links you should read

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

USA citizens do NOT cast votes for President/VP candidates. They vote for electors
http://en.wikipedia.org/wiki/U.S._Electoral_College

Rather than directly voting for the President and Vice President, United States citizens cast votes for electors. Electors are technically free to vote for anyone eligible to be President, but in practice pledge to vote for specific candidates[2] and voters cast ballots for favored presidential and vice presidential candidates by voting for correspondingly pledged electors.

[2]^ Electors are not required by federal law to honor a pledge, however in the overwhelming majority of cases they do vote for the candidate to whom they are pledged. Additionally many states have laws designed to ensure that electors vote for pledged candidates. See The Green Papers

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

Never heard of it. Good search indicates Prospero is a character in one of Shakespear's plays.

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

If your program is being compiled for UNICODE and the string is non-English, then more than likely it can not be converted. If English, then there are conversion functions.

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

The senate and house are something like UK's House of Lords and House of Commons. Each state has two Senators in the Senate. The number of people in the House depends on population of the states. All bills (or laws) must be approved by both the Senate and the House before it can be signed by the President.

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

Yes I voted, but I had to wait until after work because I didn't have enough time before I started working. Thankfully I live in a smally town so the lines were very very short at 4:00 pm afternoon. I heard on the radio that the lines in St Louis streatched over a block.

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

If you want to follow the election results tonight you can visit http://election.cbsnews.com/election2008/

Right now Obama has 67% of the votes that have been counted.

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

I know this post was from a while back, but I just had to comment it. Because I work in a nursing home and believe me, he's really not that old. You should see the people I take care of. ;)

Yes, I know -- those poor souls in nursing homes are in really bad shape both physically and mentally.

I will correct my statement -- I am now 100% sure I will vote for Obama today. It will have to be later this afternoon though because I have to work today. Unfortunately I think I will have to wait in voting lines a loooooong time.

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

This is homework assignment and gayatri apparently wants us to do it for him/her.

The code you posted will have undefined behavior. cube(++x) could result in different answers on different compilers, so the ourput can not be determined exactly.

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

When you are creating 2d array, you are first creating a regular array. But inside the array, the contents aren't ints or chars, but rather addresses that points to other blocks of memory that contains the actual values.

If you declare a 2d array like this: int array[2][4]; the compiler creates one continuous block of memory that consists of 2 * 4 integers. The indices of the array are not addresses but, like 1d array, are actual integers. When you reference a single element of the array, say array[i][j] the compiler does the math for you to determine the exact element. Most likely it will calculate (array + (i * 4) + j );

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

function prototypes normally are placed after all includes and before the first function.

There are two ways (in C) and three ways in c++ to pass parameters.

  • pass by value -- the object is just a copy of the value in the calling function.
  • pass by reference -- in c++ this is the actual object declared in the calling function
  • pass by pointer -- this is a pointer to an object declared in the calling function

Pass By Value -- only a copy of the variable is passed to the function. Any changes made to that variable by the function are not visible to the calling function.

Pass By Reference/Pointer -- The function receives a pointer or reference to the object and any changes made by the function are also made in the calling function.

To clarify these concepts for yourself you should write small programs that demonstrate the use of those parameter types. Testing on your computer for yourself is worth thousands of words in a textbook or online at a website.

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

C and C++ are not the same language, so don't expect C compilers to act the same as c++. There are many differences that you will encounter.

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

Apparently the file isn't where your program thinks it is. Type the complete path to the file and it should open ok.

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

If the path contains spaces then cin >> path will not work because >> stops at the first space. To use spaces call getline(cin, path)

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

you don't initialize variables in header files becuse the variables don't exist. You have to declare variables in *.c or *.cpp files. You can, however, use the extern keyword with variable in header files, but again they can not be initialized there.

// myheader.h file
extern int myint;

Then in one, and only one, *.cpp file you declare the same variable but without extern keyword. You can also initialize it then.

// myprogram.cpp
#include "myheader.h"

int myint = 0;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Tomarrow night it will be President-Elect Obama.

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

You have to pay close attention to the compiler's error messages. Look at the first error message, the compiler will tell you which line the error is on. The list of errors may be different from compiler-to-compiler, so you need to tell us what compiler you are using and post the list of error messages.

Example: I compiled with VC++ 2008 Express. The very first error message is on line 320 else if (dashstart == 1 && charcount == 9 && (i > 9 && i < 12)) and the error message is that the variable i is undefined. To correct that you have to find out where i is declared and correct it to declare it globally to the whole function. If you go to line 233 you will see that variable i is declared in the for loop for(int i=0; i < length - 1; i++) . When declared like that, the variable is only in scope while the loop is executing. You need to declare i up above that loop so that it can be used and referenced by the whole function.

Fixing that error makes the entire program compile without further erorrs.

int i = 0; 
	for(i=0; i < length - 1; i++)     // for each character
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also note that a warning is different from an error. Code will compile and run with 100 warnings but it wont compile or run with even a single error. Warnings are little helpful hints given by the compiler. .

Not necessarily true -- many, if not most, warnings that people get are really errors, depending on the warning level you set with your compiler. Your goal should be to get 0 warnings and 0 errors. The more you clean those things up and avoid the warnings the easier it is for you to fix the real problems.

The latest Microsoft compiler has a nasty habbit of declaring many standard C functions depriciated with they aren't. I just use the pragma to turn off those warnings.

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

Obviously you don't believe in this message.

You are right -- I don't. Unless things have changed since I was on active duey, active duty members of the armed forces were forbidden from publically expressing political views. And that utube clip would have landed that soldier in the brink (prison) for awhile. So I think it was just another contrived McSame campaign gimmick