ndeniche 402 Posting Virtuoso Featured Poster

Try this snippet. Might do some magic for you ;)

ndeniche 402 Posting Virtuoso Featured Poster

Works fine too... Try checking for the explorer's settings

ndeniche 402 Posting Virtuoso Featured Poster

You can create a comboBox that will show the user the product options, and for each item index assign a price using a select case decision.

When the client adds something, add the amount associated to the comboBox index to an accumulator variable (such as subtotal , and when he removes, substract the associated value from it.

As for the discount button, I guess it's pretty much self explanatory.

Come back when you've worked your way throughout the code, ok pal?

ndeniche 402 Posting Virtuoso Featured Poster

Works fine for me... maybe the explorer you are using? Or a javascript deactivator, or activex control blocking?

ndeniche 402 Posting Virtuoso Featured Poster

I guess what Chilton is trying to say is that you should compare your do... while loop to MAX_ACCOUNTS, instead of the constant number 10.
So, instead of this

do
{
... 
}while(input != QUIT && counter < 10);

Do this:

do
{
... 
}while(input != QUIT && counter < MAX_ACCOUNTS);

That way you can change the constant value anytime, and you actually use the constant variable you created.

Chilton commented: Yup. +2
Vindal commented: Very Helpful +1
ndeniche 402 Posting Virtuoso Featured Poster

Try creating a css class for a <div> container for the whole page (header, content and footer). This way, all your absolute positions and float properties will be included in that container.

Next, in the navbar class, you got

float:right;
margin-left:-225px;

If you tell it to float right, there's no need to specify a left margin.
Another thing: sicne you're telling the #nav container to float right, tell the <img> element to float left. That way they won't overflow throughout the header.

ndeniche 402 Posting Virtuoso Featured Poster

Why not instead of using javascript for hover images, use css? It might free some resources from the explorer viewing your site.

you can check CSS hovers here

ndeniche 402 Posting Virtuoso Featured Poster

Since you are counting into counter each time an account gets data entered, you can use it as the sentinel for your print loop

ndeniche 402 Posting Virtuoso Featured Poster

Or, you can create a constructor for your class, so that it initializes the class's members so that they don't store garbage.

You then call the constructor when declaring your class array.

Or, as you are doing it, instead of

for(counter = 0; counter < MAX_ACCOUNTS; counter++)
{
accounts[counter].computeInterest();
}

use a new variable for the if loop and use the counter as a sentinel:

for(int i = 0; i < counter; i++)
{
accounts[i].computeInterest();
}
ndeniche 402 Posting Virtuoso Featured Poster

In the first place, you cannot assign a const value in the class header. Second, you didn't declare the variable balance in the void computeInterest() function

ndeniche 402 Posting Virtuoso Featured Poster

That's another solution, though I think the sorting process might make the procedure a little longer and resource consuming

ndeniche 402 Posting Virtuoso Featured Poster

59,425,114,757,512,643,212,875,125

ndeniche 402 Posting Virtuoso Featured Poster

The mod is the remainder of a division, as in 11 mod 3 = 2 or 11/3 = 3 rem 2 As for the most repeating number, you should try nested for loops to go through the array (which might even be of a variable length).

Like this:

#include<iostream>

using namespace std;

int main()
{

	int numbers[12]={8,9,6,7,5,7,3,5,2,5,8,9};
	int qMax = 0; //Quantity of times the maximum repeating number appears
	int temp, compare, max; //temp: stores the quantity of times the compared
                                //number repeats itself
                                //
                                //compare: number to be compared
                                //
                                //max: number that repeats the most times in the 
                                //array

	for (int i=0;i<12;i++)
	{
		temp = 0;
		compare = numbers[i];

		for (int j=0;j<12;j++)
		{
			if (numbers[j] == compare)
			{
				temp++;
			}
		}

		if (temp > qMax)
		{
			max = compare;
			qMax = temp;
		}
	}

	cout<<"The most repeating number: "<<max<<endl;
	system("PAUSE");

	return 0;
}
programing commented: good +1
ndeniche 402 Posting Virtuoso Featured Poster

22,698,374,052,006,863,956,975,682

ndeniche 402 Posting Virtuoso Featured Poster

You can't send a header("location:page.php") command after sending html code to the webpage. You must do it when the page's headers haven't been loaded yet.

Though you can try doing it with a bit of javascript.

ndeniche 402 Posting Virtuoso Featured Poster

8,670,007,398,507,948,658,051,921

ndeniche 402 Posting Virtuoso Featured Poster

what the program does is, instead of overriding, replace the numbers to order them from largest to smallest... Let me explain:

Suppose the original input is | 5 | 7 | 1 | 3 | Enter the loop: is 5 < 7 ? Yes
Since it is, it assigns 5 to a temp variable, assign 7 to the position where 5 was originally located and assign 5 to where 7 was originally located.

So, now we have: | 7 | 5 | 1 | 3 | Move forward. Is 5 < 1 ? No
Move forward. Is 1 < 3 ? Yes
Since it is, repeat the same process as before (switch the numbers)

Now, we have | 7 | 5 | 3 | 1 | KEEP ALWAYS IN MIND: To better understand an excercise, do a desktop test, by running the process with paper and pencil, so you can visually track the program's data flow

ndeniche 402 Posting Virtuoso Featured Poster

We were just off by a few 0.7e21 :P

3,311,648,143,516,982,017,180,081

ndeniche 402 Posting Virtuoso Featured Poster

1,265,237,042,075,997,393,488,322

ndeniche 402 Posting Virtuoso Featured Poster

This post might go better in the JavaScript forum, but here is an idea:

Try javascript to check on that elements value every time the page is loaded:

<!-- Header -->
<script type="text/javascript">
    function checkCounter()
    {
        if (document.getElementById("counter").value == 1000)
        {
            alert("you arrived to 1000");
        }
    }
</script>
</head>
<body>
<form id="counter">
    <input type="text" id="counter" value="1000" onload="checkCounter()"<!-- loaded from the counter's script--> />
</form>
<!-- Body -->
ndeniche 402 Posting Virtuoso Featured Poster

In your css file, inside the mainbody id you got the following:

.mainbody {
margin-left: auto;
margin-right: auto;
margin: 0 auto;
background: url(images/white-frame.png) no-repeat;
height: 702px;
width: 1000px;
}

The width property exceeds the screen's resolution... try reducing it to the body's container's width.

ndeniche 402 Posting Virtuoso Featured Poster

483,162,962,645,010,163,284,885

ndeniche 402 Posting Virtuoso Featured Poster

Somewhere in your code you're assigning a value that doesn't match the destination variable's type. Be sure to double check it

ndeniche 402 Posting Virtuoso Featured Poster

Ok, where you put HOME you should put Main , which I suppose is the name of the parent's class

ndeniche 402 Posting Virtuoso Featured Poster

Always a pleasure ;)

ndeniche 402 Posting Virtuoso Featured Poster

You can use <div></div> s to locate two images wherever you want in the page and use them as backgrounds using the position:absolute; property.

ndeniche 402 Posting Virtuoso Featured Poster

You can pass it through the constructor of the second panel's class constructor, like this:

public GameScreen(String name)
{
...
}

So when you call it from the first panel, you call it this way:

new GameScreen(txtName.Text).show();
HelloMe commented: Straight to the point and without cryptic extra explainations. +2
ndeniche 402 Posting Virtuoso Featured Poster

Try InstallShield

ndeniche 402 Posting Virtuoso Featured Poster

184,551,835,826,033,096,366,333

ndeniche 402 Posting Virtuoso Featured Poster

I agree with Agni:

In the first place, DaniWeb is a place where people search for tech advise or programming solutions. If someone has anything to say, they'll say it by posting a reply to the thread. There's no need to implement a Facebook Commenting API.

Second, Anonymity is a very important part of the DaniWeb society, where members choose to present themselves personally just to those they "trust" or "get along with".

ndeniche 402 Posting Virtuoso Featured Poster

What about passing the variable as a parameter for the other panels constructor?

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys!!

Long time no see!! (Actually, I came back and do dome posts last year, but not that much) Sorry I haven't been around to help solve some doubts and stuff, but I've been a bit busy :P

But I'm back, and I'll stay around for another while!!

Nice to see daniweb again!!

ndeniche 402 Posting Virtuoso Featured Poster

to make it go all the way down the screen there's a trick:

<div style="width:500px;top:0;bottom:0;margin:auto;">&nbsp;</div>
ndeniche 402 Posting Virtuoso Featured Poster

There is an html attribute called "width". You can specify an element's width with this attribute.

Do a quick google search for css and you shall get along pretty good.

ndeniche 402 Posting Virtuoso Featured Poster

Consider reading some about SQL Joins and relating queries:

ndeniche 402 Posting Virtuoso Featured Poster

In the first place, you can't do that:

SELECT * 
FROM certificates,client,contacts,dicipline,email,forms,marketsector,notes,owner,soq 
WHERE product LIKE '%@search_term%'

You can instead call specific columns from each separate table and join them with right joins, like this:

SELECT T1.certificate, T2.client_name, T3.contact_name, T3.contact_discipline,...
FROM Products T1
Inner Join Clients T2
   ON
       T1.product_id = T2.product_id
...
WHERE T1.product_name LIKE '%@search_term%'

Remember to compare table columns herever they are related to join tables.

ndeniche 402 Posting Virtuoso Featured Poster

can you post an example of your tables?

ndeniche 402 Posting Virtuoso Featured Poster

through the relational database, you can access to several tables through common columns, such as elements' ids, registry numbers, etc.

ndeniche 402 Posting Virtuoso Featured Poster

That's because you're not specifying the Connection Property for da.SelectCommand (da.SelectCommand.Connection)

Try

da.SelectCommand.Connection = con
da.SelectCommand = cmditem
ndeniche 402 Posting Virtuoso Featured Poster

What do you mean by "grabbing"?

Btw, you should consider formatting and indenting your code for easier comprehension.

ndeniche 402 Posting Virtuoso Featured Poster

Have you tried inner|outer joins? Perhaps that should do the trick...

Exactly what information is your search engine after?

ndeniche 402 Posting Virtuoso Featured Poster

Hello fellas

I'm actually developing some web applications in Ajax, and have been trying them in my Wamp server for Windows 7. I've been using the php_sqlsrv module since its release, because of its new features.

The thing is, my office has a fedora webserver, and I'm looking for a php_sqlsrv module to work with it. What should I do?

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys...

I'd like to make a login form that popups just like the one here at daniweb, but I don't know what is it called... Can someone give me a heads up, and maybe some code?

ndeniche 402 Posting Virtuoso Featured Poster

Hello mates

I've got a database with tables for Job Department and Job position. Every Positions has a respective Department assigned by the id.

So, when the user selects a Department, the program deploys into the combobox the values of the Positions assigned to that department. The thing is, the position id is not ordered.

If I use the Add() method to add an item, and send the KeyValuePair(Of Integer, String) of each position, when opening the dropdown, it shows me the list as [1, description_pos_1], [2, description_pos_2], etc.

How do I store the key value into the combobox without showing it in the items list?

ndeniche 402 Posting Virtuoso Featured Poster

Found out how to solve it... jsut needed to include a javascript file that wrote the content of the file into the html dynamically... something like this:

<html>
<body>
   <script type="text/javascript" src="http://domain/signature.js"></script>
</body>
</html>

and the javascript file goes like this:

document.write("<style type=\"text/css\">.signature{...}</style><div class=\"signature>content</div>");
ndeniche 402 Posting Virtuoso Featured Poster

Hello ladies and gentlemen

I've been trying to find a workaround this issue, and maybe you can help me find a solution.

I've got a signature footer bar in a html document. This footer bar must display in several websites, in several domains, so i've been looking for an include code to do this for me.

Since it is a code hosted in an external server, i cannot do that with a <!--#include --> ssi inclusion. I couldn't manage to get a ESI include to work either, and I don't want to use a php include, since that would be my only reason to use php, and I honestly don't want to.

So, I thought about doing it through Javascript. I tried it the AJAX way, creating a function to call my external html, and pass it to a <div class="signature"></div> and call the function right after the container, but it didn't work, so I thought maybe calling it live, without using functions, since I'd have to use a trigger to call it via AJAX.

Any suggestions?

ndeniche 402 Posting Virtuoso Featured Poster

I usually prefer an IDE that will aid me on my coding (like with intellisense, documentation, indenting, for instance) since it's easier that way to track my classes, functions, variables, etc, so I use VS2010

ndeniche 402 Posting Virtuoso Featured Poster

Because, in checking the current char, if there's a non-numeric character, the subscript's position is not changing, so it keeps checking the same character oiver and over again. Maybe you could try a validated loop exit?

bool valid = true;
while ((subscript < numChars) && (valid))
    {...
        if(...)
        {...}
        else
        {
            cout<<"Please enter digits only"<<endl;
            valid = false;
        }
    }
ndeniche 402 Posting Virtuoso Featured Poster

Point granted ;)

ndeniche 402 Posting Virtuoso Featured Poster

Exit(0) , is commonly used as a successful exit message. Usually, you don't use it, use instead Return 0; Exit(1) Is used to reference some kind of abnormal program termination.