Archive for September, 2009

how to determine the square root using the switch statement in c++?

September 29, 2009 - 9:22 am 1 Comment

i need to make a program that will determine the square root of the input number.. im using the switch statement in c++..

can you also give me the other answer using the other statement…

thanks….

#include <iostream>
#include <math.h>

int main ()
{
int number, result;
cout << "Input a number: ";
cin >> number;
result = sqrt (number);
cout << "The square root of the number is " + result +"." << endl;
return 0;
}

Can I negate a SQL statement?

September 29, 2009 - 9:21 am 2 Comments

I have a particular SQL query now I would like to return the oposite of that query is there a sql statement to do that?

Yup, negate it in the WHERE clause.

Or use a subquery that has all of the records that you don’t want, then you can select the records that don’t match the subquery.

Example 1:

SELECT whatever FROM MyTable WHERE MyColumn is not null (gets all the records wit the not nulled column instead of the records with the nulled column)

Example 2:

SELECT whatever FROM MyTable WHERE MyPrimaryKey NOT IN
(SELECT MyPrimaryKey FROM MyTable WHERE ….)

Select a counterexample to show that the statement is false.?

September 29, 2009 - 9:21 am 2 Comments

Select a counterexample to show that the statement is false. When an odd number is added to the product of two even numbers, the result will be even.

4•5 + 1 = 21. 21 is not even.
4•2 + 3 = 11. 11 is not even.
4•5 + 2 = 22. 22 is even.
3•5 + 4 = 19. 19 is not even.

It’s 4 times 2 plus 3 equals 11. 11 is not even.

Statement from The Palace Regarding The Final?

September 29, 2009 - 9:21 am 7 Comments

" We regret to announce the Question has been deleted. At the time, 335 replies were made. An official count after 210 replies gave Babyboy a lead 102-90 (with 8 spoilt votes). However, since 125 potential votes were not counted, His Majesty is unwilling to declare a winner.

The King had summoned the PM and the Cabinet to the Palace, to seek their advice on how to break the impasse. After careful deliberations, HM’s Government has advised the following method to choose the winner:

Both contestants will be assigned to the teams that will contest the 2007 FA Community Shield. The contestant whose team wins, will be declared the winner.

The Palace invites the 2 contestants to immediately contact the Palace, in regards to their choice of teams before 12noon GMT, today, on a ‘first come, first served basis’.
If no choice is made after the deadline, HM will invoke the Royal Prerogative and assign the the contestants, one of Chelsea or Man United."

Lord Smith,
The Lord Chamberlain
Further Statement From The Lord Chamberlain:

His Majesty unfortunately has other matters of State to deal with on Sundays, as such, he is unable to wait until noon. Accordingly, he has invoked the Royal Prerogative and assigned the 2 Finalists the following teams.

1. Touzours - Chelsea
2. Babyboy - Manchester United

In the event the Shield is shared, the contestants will be declared Joint Winners.

Given under His Majesty’s hand and Seal, this 5th Day of August, in the 2007th year of Our Lord.

To His Majesty King Edward IX:

We regret to acknowledge that such an atrocity has occurred in your very palace. May we suggest that the perpetrator, once found, be punished with utmost severity as you deem fit.

However, we must say that the decision you have made, to declare the winner on the basis of the 2007 FA Community Shield match, is the best alternative for the interests of fair play.

May the best team (and user) win.

PHP-MYSQL UPDATE SYNTAX ERROR?

September 29, 2009 - 9:21 am 3 Comments

I have the following query to update a database table from a form and when I run it, I get a syntax error.

$query = "UPDATE dues SET jan=’$jan’, feb=’$feb’, mar=’$mar’, apr=’$apr’, may=’$may’, jun=’$jun’, jul=’$jul’, aug=’$aug’, sep=’$sep’, oct=’$oct’, nov=’$nov’, dec=’$dec’ WHERE ID=$id";
$result = mysql_query($query);

when I echo mysql_error(); I get the following:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘dec=’Not Paid’ WHERE ‘ID’=1′ at line 1

I have already tried putting single quotes around $id but that didn’t fix it either, I tried removing the commas and it didn’t work either. I tried putting the values in parenthases and it didnt work. I have tried a lot of things and NOTHING has worked. I have no idea what I need to change.

I need help because I usually set up all my other update statements just like this one, (syntax-wise), but for some reason this one wont work.

If you need more details to figure it out, just let me know.

Thank You!!

DEC is a reserved word in MySQL. See: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

Try ….
nov=’$nov’, ‘dec’='$dec’ WHERE ID=$id;

or, possibly better,
nov=’$nov’, dues.dec=’$dec’

If neither of those help, please print out the "real" SQL you execute and update the problem with it - it might be something that is only causing syntax problems once the variables are resolved.

Error on personal statement for ucas?

September 29, 2009 - 9:21 am 3 Comments

I sent my statement yesterday and its waiting to be approved by ucas. Problem is, I re-read my personal statement and when I copied the text from microsoft word, all the words somehow got joined. It happens around 6 times in my statement.. what should I do?

If you applied independently then I’m afraid there’s nothing you can do, but if you applied through your school or college, then the application will have gone to the UCAS coordinator to check through and add your tutors reference. Any good coordinator would read through and check your personal statement, and flag up something like that, and possibly return it to you to amend. If that is the case, go and see them first thing Friday morning. Try not to worry too much, I’m sure if Uni’s are going to make you an offer they won’t be put off by a few words without spaces between them.

What are Sony Corporation’s values, vision, mission statement, goals, strategies, objectives, philosophies

September 29, 2009 - 9:20 am 1 Comment

I can’t seem to find any of them on the internet. Please help, especially with the Mission Statement.

Thanks

According to this web site I found Sony does not have a mission statement. It says up until a few years ago the founders of Sony Ibuka Masaru and Morita Akio were the mission statement.
Hope this site helps!

http://www.bsu.edu/web/amvoorhis/profile.html

What is an appropriate conclusion to draw from the following statements?

September 29, 2009 - 9:20 am 4 Comments

What is an appropriate conclusion to draw from the following statements:
1. Sally is a senior who rides the bus to school.
2. Bob is a senior who rides the bus to school.
3. Javier is a senior who rides the bus to school.

please help asap :/ need the answer for geometry (: thanks

From a geometry perspective, Bob, Sally and Javier are members of the set of seniors who ride the bus to school. You might use this fact in constructing a Venn diagram, for example.

How to insert multiple rows of data using INSERT INTO statement?

September 27, 2009 - 11:15 am 4 Comments

I need to create a dropdownlist that list down countries…
I have a list of countries (starting from Afghanistan….till Zimbabwe )

how to write an INSERT INTO statement so that i can insert this list in one shot….

the table name - tblCountry
the column name - strCountry

can anyone help me with this?

thanks in advance.

the code below is written for MySQL RDBMS:

INSERT INTO tblCountry (strCounty) VALUES (’US’),(’GB’),(’Russia’),…

if you’re running this statement on a production database don’t forget to add LOCK TABLES tblCountry WRITE; before statement and UNLOCK TABLES; after statement to prevent data integrity to be broken.

Is my SQL statement correct? Can you help to take a look and fix please? Thanks! It’s short!?

September 27, 2009 - 11:15 am 3 Comments

Write the SQL statement list the product names of all products that were not ordered in the month of August 2000

SELECT ProductName
FROM Products
WHERE Products.ProductID IN(
SELECT DISTINCT ProductID
FROM Orders, [Order Details]
WHERE not datepart (mm, Orders.OrderDate) = 8
AND datepart (yy, Orders.OrderDate) = 2000 )

SELECT ProductName
FROM Products
INNER JOIN Orders ON Orders.ProductID=Products.ProductID
WHERE not datepart (mm, Orders.OrderDate) = 8
AND datepart (yy, Orders.OrderDate) = 2000 )