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

move line 11 down between lines 17 and 18.

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

In my area there are places where women can get free birth control stuff. And for men, there is always the vasectomy.

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

GET A JOB was referring to the parents, not the newborn babies! I thought that would be inferred, but maybe not.

If people can't get jobs then do something else with the time instead of making babies. Too many unwed mothers who have nothing better to do then get pregnant.

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

So I guess you're willing to sell the US to China? I don't think so.

According to this research paper, the 1987 estimate was $175 Billion, or $360 Billion adjusted for inflation to 2013 dollars. So where did you get that $320 Trillion from? Most of the land owned by fed government isn't even usable, such as the mountains of Alaska.

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

The us government spends about $60 BILLION per DAY. That cannot go on forever, just like you have to control your own spending the US government needs to do the same. So how are they supposed to control spending? Simple, by reducing the size of government, stop all the pork bills, stop entitlements, and stop foreign aid. Phase out social security administration, require people to get privatized retirement plans. Abolish Obamacare, which is going to cost several Trillion dollars per year. Abolish the War on Drugs -- it's a disaster anyway. Release non violent prisoners, such as those in prison for drug charges and other non violant crimes. Abolish Agriculture department, it's outlived it's usefulness. Abolish Secretary of Interior, which oversees national parks and land management, which can all be privatized. Abolish Secretary of Labor, Secretary of Commerce, Secretary of Housing and Urban Development, Secretary of Transportation, Secretary of Energy, Secretary of Education, and Secretary of Veterans Affairs. Nice to have, but not absolutely necessary. Last, but not least, streamline US military. Why do we need army, navy, marines, air force and coast guard (technically a branch of US Treasure, not the armed forces)? Why not just combine them all into a single military and eliminate all the duplication.

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

Not me -- I don't know the first thing about php.

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

i was hoping someone with government knowledge and the new laws

You won't find anyone here. Not even members of congress have that kind of knowledge.

Dearden commented: not helpful +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Won't do any good -- here's why

And be awful careful about posting ads in the body of a post, a moderator might just hit you with a spammer infraction.

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

Why do people need WIC anyway? GET A JOB.

Dearden commented: rude +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My computer is about 1 1/2 years old and has an 8-core AMD processor -- runs Diablo III online very very well. The more cores the motherboard has, the better (IMO). I also have 2 hard drives, one is 1TB and the other external is 3TB. You need a 64-bit operating system in order to access that much space.

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

Value is of type Decimal class -- it's not a numeric type. You will have to use some of the methods of the Decimal class to add and subtract two Decimal objects.

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

What error(s) are you getting? Post the exact error message(s).

Is secondTemp a textbox? If it is then you have to convert the Value to an int or float before using it in mathmatical equation.

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

why would you write a class eith unused, empty functions??? Just delete the functions.

You can't override a class method from outside a class. You have to do it inside another class that is a child of the base class

class base
{
public:
   virtual void create()
   {
      cout << "Hello from base\n";
    }
 };

 class child : public base
 {
 public:
   virtual void create()
   {
      cout << "Hello from child\n";
    }
 };

Now then, if you don't want base to implement the function then make it a pure virtual function, like this:

    class base
    {
    public:
       virtual void create() = 0; // pure virtual function
     };

In this case, you can not instantiate an instance of base. class base MUST be overriden with a child class.

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

in these case case i need the 'test'(line 10).

That is not the place to declare an instance of the class. Although it compiles, it's just not normal prace to declare instances like that. And you don't normally want to declare global objects either. See main() for an example of the correct way to declare instance of a class.

Please post the entire program. I think you are missing something. This compiles without warning or errors.

#include <iostream>
class test
{
public:
    virtual void created();

    test()
    {
        void created();
    }
};


void test::created()
{
    std::cout << "hello world";
}

int main()
{
    test t;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What are the error(s) you got? The code you posted is not overloading any functions.

line 3: remove the {} characters because it makes the function an inline function. It should look like this:

virtual void created();

line 10 is wrong. Remove the word "test"

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

line 4: the loop won't work because it's checking if the character string[i] is the same as the first character in pon1. Let's assume the character at *pon1 is the letter 'a'. How many instances of 'a' do you think might be in the string??? There could be lots of them, so testing for string[i] == 'a' will likely be a false positive hit.

What I would do is just truncaqte string at pon1 then you can just simply strcpy() string into stringnew

*pon1++ = '\0';
strcpy(stringnew,string);

At this point you need to move pon1 pointer to the end of the characters that are in name. Example, if name == "time" then increment pon1 until it is one character beyond the end of the word "time". Now you will have the start of the last part to be copied into stringnew array. You can call strcat() to copy all the characters from pon1 into stringnew.

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

I do it without shifting by using a temporary character array. After calling strstr() to find the beginning of the word or string you want to replace, copy the original string from the beginning to the position returned by strstr().

For example, If the original string is "Now is the time for ..." and you want to replace the word "time" you would copy "Now is the " into another character array.

Next, add the word or string you want to replace it with, if any. Lets say you want to replace "time" with "moment". You would concantinate "moment " to the end of the temporary character array.

Next step is to add all the remainder of the original string to the temp character array. In this example "for ...".

At this point the temp array contains "Now is the moment for ...". Now you can do anything you want with this temp array, such as copy it back to the original buffer (note: you can not copy back over a string literal.)

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

What version of MS-Windows and what version of IE? I had problems with IE10 on Windows 7 so I downgraded to IE9.

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

depends on the operating system.

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

Like when u say "conio.h is not supported", so compiler doesn't support ? How can it be ?

conio is not a standard compiler header file. It was originally created by Borland in the 1980s for their Turbo C compiler. Read this wiki article to get more info about it.

The only header files that all C compilers must support are listed here. Anything not listed are non-standard and it's up to the compiler maker whether to support them or not. Almost all non-standard header files also require a library that contains the implementation of the functions in the header file. You generally can not use a library that was generated with one compiler with a different compiler. For example libraries generated with Borland compilers can not be used with Microsoft compilers for two reasons:

  1. The function naming convention is different
  2. Function calling convention is sometimes different.
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Code::Blocks with MinGW compiler is the IDE/compiler I recommend for new programmers because it's not nearly as difficult to learn as Microsoft Visual Studio. Also because at some point you will probably want to move on to *nix, VC++ is only supported on MS-Windows while Code::Blocks is supported on both operating systems.

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

Guys although i appreciate the posts, I asked for anything I could do to increase the chance of getting a job outside going to Uni - not a number of posts telling me why I should go to Uni.

google for "freelance programming", there are several sites where you can bid on jobs. Or try some temp agencies where you get paid only if they assign you to a job (which probably will require an interview with the prospective client).

Other than that you are pretty much at a dead-end without a university degree. There was a time 30 years ago when the job market in IT was wide open and people could easily get jobs without a degree. But that was 30 years ago and times have changed.

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

I believe I could learn more in 3 weeks at my computer than I could in 3 years taking Computer Science.

That may or may not be true, but why deny yourself an education when you have the choice of either putting yourself on the same level as your competition, or setting yourself up for a do-nothing and go-nowhere career. Competition in IT is very stiff, there are lots of people who gladly graduate from college so that they get their foot in the door for a profitable and rewarding career. Without that, your career will go nowhere. Why should any company hire someone who has no formal education when there are lots of other people looking for the same job who have bachelor degrees? Your reasoning for not wanting to go to collete is just plain stupid.

I know a lot about programming and know around 5 languages, and have a vast knowledge of tons of different areas

That means almost nothing when it comes to entry-level jobs. Just because I know how to use a hamnmer and saw doesn't mean I will be any good at building a house. Get an education.

Once you have enrolled in college you can probably take bypass tests to skip and get credit for knowledge you already have.

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

virtual void printf(); means you are going to implement the function in the *.cpp file instead of inlining in the class.

virtual void printf() {} is a do-nothing function, the function name exists but does nothing because there isn't anything betweein the two braces { and }.

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

You should remove virtual keyword for functions that are not inhereted from parent and from the function in parent that you do not intend to overload in derived class.

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

what makes you think it isn't executed? Did you use a debugger or put a print statement inside the constructure to see?

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

what compiler are you using? I get several errors from VC++ 2012, for example on line 59, can not initialize within class declaration. Check your compiler errors and fix them.

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

Created() function without nothing and can be changed outside of class

It can not be change by anything outside the class unless it is a child class of the class in which Created() is declared. Then it's called inheritence. For example you inherit certain traits from your parents, but you can not inherit traits from a neighbor who lives down the street (unless he/she is one of your parents). Same idea in c++ classes

class foo
{
public:
    virtual void Created();
};

class bar : public foo
{
public:
    virtual void Created();
};

int main()
{
     foo f;
     f.Created(); // calls Created in class bar
     f.foo::Created(); // call Created in class foo
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

After you enter an integer you press the Enter key, right? Well, scanf() doesn't remove that key, so it remains in the keyboard buffer.

When you enter a number, scanf() will ignore white space until it reaches the first numeric digit then stop reading the keyboard when it reaches a character that is not a diget.

When you enter a string, scanf() reads all the characters in the keyboard buffer until it reaches the first white space character (space, tab, carriage return, linefeed). So if you previously called scanf() to enter a number, such as "%d" and then call scanf() again with "%s", the first thing scanf() finds is a white space, so it will do nothing.

C-language has no good standard way to clear everything from the keyboard buffer. The easiest way to remove the '\n' from the keybaord buffer is to call getchar() after each call to scanf() with "%d".

shahab.burki_1 commented: Thanks-- the getchar() worked +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it looks quite modern to me !

Except for the black MS-DOS-look editor. Looks like ancient Turbo C editor, which was written 30 years ago for MS-DOS 6. They just added a menu on the left side of the window.

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

Sorry, I don't like the looks of it -- looks like something from the 1980's. Notepad++ is much better.

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

line 49: Useless line because the loop on line 47 stops when EOF is reached.

line 52 is where you would build a string.

Something like this:

#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <string>

void Form1_Load(System::Object^  sender, System::EventArgs^  e) {

            vector<string> Lines; // make this a member of the Form1 class so that it can be used in other functions

             /*Decryption --- When program loads*/

            string line;
             char ch,mod;
             char key = 97;
             const char *name = "Encrypted.txt";
             ifstream fin(name, ios::binary); // Reading file
             if(!fin) //open the encrypted file in a binary mode
             {
                 //MessageBox::Show("Encrypted.txt did not open"); //If file does not exist
             } //or any kind of error

             while(fin.get(ch))
             { // opens the Encrypted file
                 mod = ch + key;
                 if (mod > 255 ) mod -= 255;
            //     fout << mod; //Writes decrypted text to TTO.txt
                 line += mod;
                 if(mod == '\n')
                 {
                     Lines.push_back(line);
                     line = "";
                 }
             }
             fin.close(); //Cose the encrypted file
         }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Solution seems simple enough -- put the lines in a vector of strings instead of writing them to a file. Build a string by adding characters one as a time as they are read and decrypt. When '\n' is reached then you know that's the end of the line and add the entire string to a vector.

char name[100] = "Encrypted.txt";

Why use so much space in that array? All you need is this: char name[] = "Encrypted.txt"; or even better like this: const char* name = "Encrypted.txt";

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

wrong, no angle brackets < and > and put the filename in quotes.

#include "foo.h"

If you want to include a standard compiler header file then it's like this:

#include <stdio.h>

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

Function IRate() needs a loop in order to find out how many years it takes to reach the target value. Before doing this with your program, sit down and do it by hand with pencil & paper. Start out with an initial balance and interest rate. Then with pen & paper figure out how long it will take for the balance to reach the desired target amount. Once you figure out how to do it manually you should be able to code the function to simulate the method you used to do it manually. Just remember, you need a loop to do this, even when you do it manually.

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

Check spelling (capitalization is important, "target" is not the same as "Target")

Delete unused variables.

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

You must declare the variables inside the function in which they are used. You can't declare them in main() then expect to use them in other functions, doesn't work like that.

 double IRate(BankAccount& Checking, double target)
{
    double IR;
    double B; // you need to initialize this to something

    IR = ((Target/B-1)/IR);
    return (Target/B-1)/IR;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You're still attempting to declare a function inside another function. You can't do that! Move lines 15-19 outside main() as I showed you in my first post, then remove the semicolon at the end of line 15.

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

line 16-20. You can not declare a function inside another function.

int year(BankAccount& Checking, double TargetValue)
{
        year = ((TargetValue/B-1)/IR);

};


int main ()

{
    int year;
    double getB;
    double getIR;
    double B = 0;
    double IR =0;
    double IRate;
    double TargetValue;


    BankAccount Checking;    

    cout<<"Welcome to your BankAccount"<<endl;
    cout<<" what is your initial Balance? " <<Checking.getB()<<endl;
    cin>> B;

    cout<<" what is your initial Interest Rate? " <<Checking.getIR()<<endl;
    cin>> IR;

    cout<<" what is your target Value?"<<endl;
    cin >>TargetValue;



    cout << "Your initial account will take to grow to get interest" << endl; 

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

do I actually write foo

No. foo is just a name commonly used to indicate any function name. You will often see

int foo()
int bar()

You will want to replace those names with something more meaningful to your program.

would I have to declare a variable name double target?

You can name it anything you want, but make the name meaningful for what the variable represents. In this case targetValue

and within the curly braces i put the formula for calculation the year?

Yes

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

This function is not part of the account class.

Where is the function, I don't see it? It should look similar to this:

int foo(BankAccount& obj, double target)
{


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

That is not asking you to enter characters, n m and p are just place holders for the three integers as explained in the instructions. The program you posted is missing the third argument -- p -- which you need to implement.

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

what characters do you want it to accept? What are those characters supposed to represent?

I suspect you may have misunderstood the assignment. Post the exact wording of the assignment that asks you about characters.

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

Don't understand the question. Where do you want it to accept characters? In the command-line arguments (argv), in the node structure? And what characters do you want it to use?

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

Also disable the firewall during installation.

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

This works for me. Notice I had to change hwnd parameter in CreateWindowEx()

HWND txtBox1 = NULL, txtBox2 = NULL;
...
...
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int wmId, wmEvent;
    PAINTSTRUCT ps;
    HDC hdc;

    switch (message)
    {
    case WM_CREATE:
            txtBox1 = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("edit"), TEXT("sending"),
                WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | ES_LEFT,
                15, 15, 200, 300, hWnd, NULL, NULL, NULL);

            txtBox2  = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("edit"), TEXT("Receiving"),
                WS_CHILD | WS_VISIBLE | WS_BORDER,
                220, 15, 100, 300, hWnd, NULL, NULL, NULL);
            break;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Most likely because you are using the same hwnd variable for both.

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

I have an Officejet 6500 on a home network that has Windows 7 Ultimate 64-bit, Windows 8, and a couple other Windows/Linux computers. I had no problems installing the device driver about a month ago. But I installed the HP Solution Center from here, not just the printer device driver.

Did you try to uninstall the existing priter device driver before installing a new one?

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

use std::precison and std::fixed modifiers with cout.

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

I've been online here about 1/2 hour and have not noticed any problems.