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

Here is the information you need about Microsoft Excel Object Model. I don't know the answer to your question without research, and you can research just as well as I can.

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

The Ultimate upgrade isn't really worth the effort anyway. The only difference between Pro and Ultimate is the ability to encrypt folders and files. Unless you have a lot of super secret stuff on the computer there is no need for it.

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

Great! Just what I was looking for. Thanks for adding that.

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

You have to format a char array that contains the parameters. One way to do that is with sprintf().

For UNICODE you create an array of wchar_t* , for others the array is of type char*.

tchar.h is the header file that has macros illustrated below which make the source code correct whether compiled for UNICODE or not. If you think you want UNICODE then use the macros so that you can switch back and forth without changing the source code. If you google for "msdn scanf" (or for any other function) it will tell you what macro you need for the function, such as _stprintf() replaces sprintf().

Example:

int number = 123;
TCHAR args[255] = {0};
_stprintf(argc,_TEXT("%d"),number);

Read the description for the first parameter of CreateProcess() carefully so that you know what it is supposed to contain.

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

Process A passes parameters to Process B thru the command line, just as if you typed them yourself from the console screen. That means you have to implement the first parameter to CreateProcess() on line 21 of the code you posted. Then Process B can return an integer value back to Process A by using the return N from main(). Process A gets that value by calling GetExitCodeProcess(), which you should put after line 38 of your program.

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

If you make the key field(s) of the table non-duplicate then your program won't need to check for duplicates because the database will return an error.

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

The C standard requires that the char integral data type is capable of holding at least 256 different values, and is represented by at least 8 bits (clause 5.2.4.2.1). Various implementations of C and C++ reserve 8, 9, 16, 32, or 36 bits for the storage of a byte.

Your point is well taken.

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

You also have to do that by the week because many months have two partial weeks. For example the first week in October 2013 has only 5 days instead of 7 and the last week also has only 5 days. So how will you count them if an employee works 6 days/week?

Which days may also be important. If the employee works Monday, Wed, and Friday, he will work only 2 days during the first week of Oct 2013, not 3 days. An employee who works Tue, Wed and Thursday will work all 3 days during the same week.

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

I've hears php has lots of bugs that are volunerable to spyware, viruses, hackers, etc. Ruby might be better substitute for php

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

const int C2 =65.41;

int does not have decimal places. If you want decimals then use float or double instead of int

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

See this wiki article about 4-bit computers

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

bits = sizeof(long) * 8;

There is no guarentee that one byte = 8 bits. There are machines that have only 4 bits to the byte.

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

There is no standard way of doing it, some compilers want quotes for your own headers, while other compilers will accept angle brackets. You need to read the documentation for the compiler you are using to find out how it want it.

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

Here’s what the output from your program should look like

Links do not work.

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

Yes, but we won't do your homework for you. Make some attempt to do it yourself and post the program you wrote so that you can ask questions about what you don't understand.

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

Not really -- I can't duplicate the problem in this thread either.

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

No, it has happened to me when posting in c and c++ forums

int main()
{
   // some test stuff this more is edited.
}

Some More edits here

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

test initial test of this post adlfkjasf ;lsdk ds; sadf;lkf ;lkjas f;sjdhf ;lkjf ;slfkj ;sdlfkf ;sdlfkj ;slafkj ;aslkfj ;lsfk ;lsdf ;ljflkfjafk

[edit1] after some more edits ;laksdmf;lksdf

The problem is somewhat random, doesn't happen all the time

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

Here is a whole chapter on that in this tutorial. Explains it really well.

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

You start with these communications functions. Here is an example program you can download.

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

So, what's your question? What operating system and compiler is this for? It's fairly easy program on MS-Windows, but might be a bit challenging on linux because it supports so many different terminal types.

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

getch(); //conio.h

Bad suggestion using non-portable and non-standard functions, use cin.get() instead.

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

Read your other thread -- I already told you how to do it.

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

You asked the wrong question at the beginning of this thread. Why didn't you say that in the first place, we can't read your mind. You need to use this function to launch Notepad.exe

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

In order to know if it worked or not you have to test the return value of fopen()

#include<stdio.h>
int main()
{
FILE *fp;
fp=fopen("c:\\1.txt","r+");
if( fp == NULL)
   printf("file not found\n");
else
   printf("Success!\n");
fclose(fp);   
return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Then study the link I gave you. You have to learn how to send commnands to the sport score ticker, I have no idea about that. But when using serial ports you have to make sure to set up the port configuration on your computer that matches the configuration on the sports score ticker otherwise it won't be able to get the data you send it, something like an English speaking person attempting to talk to a Chinese speaking person, there needs to be common language.

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

key_chk() returns the char representation of the key that was pressed. For example, if you press 1 then it will return '1', not 1, and that's why the loop doesn't work.

Line 38 should be: if(key == '1')

line 194: When a special key is pressed you have to call getch() a second time to get the key code. The problem is that the key code is the same as one of the other normal keys. The right arrow returns the key code of 'M'. You have to do something more with it if you intend to be able to distinguish between right arrow and 'M', for example make the value negative or add 255 to the int value. Right now, on line 52 you don't know whether the user pressed the right arrow or the 'M' key. But if you make the value negative on line 194 you could test for -77 on line 52 and your program would work correctly.

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

If I just did your work for you then that would be considered cheating.

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

chalk it up to gremlins
65f91022ddc2dacdcf27de286c316186

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

It's easy to create a website -- just use a creater such as WordPress. You can create a basic site with no programming knowledge at all. And there are lots of tutorials, such as WebsitesMadeEasy

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

Well, that's just crappy! I was under the impression it would be more like the Windows 7 start button. Sounds useless to me.

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

MySQL is supported on many platforms (link)

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

Windows 8.1 will be released in a couple weeks, it's supposed to contain the start button because everyone complaints. It will be a free upgrade for all current 8.0 owners.

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

I've seen the same problem -- just happened today and lost some of the edits so I had to go back and edit again. I have to refresh the page after each edit -- which is a real pain in the ass.

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

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