Computer Questions for CSE students
The selection procedure depends on-
- Time of your answers submission
- Correctness of your given answers.
To win a prize attempt the following question answers.
2. Write the function of for loop. Give one example.
3. Explain the use of conditional operator with the help of an example.
4. Why the if( ) statement is known as a conditional control statement? Explain your answer with the help of an example.
5. Why do……while( ) statement is known as “Enter looping” statement? Explain your answer with the help of an example.
II. Fill in the blanks. [10]
1. ----------- symbol is used as unsigned right shift operator.
2. & is used for -------------------------- .
3. ------------------ Symbol is used for bit wise XOR.
4. The symbol , (comma) is used as ------------------------- .
5. << symbol is used as --------------------------- .
6. If int a = 23 and b = 7 then the value of a % b is --------------.
6. -------------- is the symbol for ternary operator .
7. If int a = 5 , int b = 2 and int c = a / b . then value of c is ----------------.
8. If x = 3 and x = (++ x) + (x++) then value of x after evaluation is -------- .
9. If a = 34 , b = 23 and int k = (34 > 23)? a : b ; then value of k is ------.
10. The symbol ( ~ ) is used for ---------------------
The prize will be sent to your mobile phone as a flexi load/balance transfer.
Contestant must submit their answers with cell number [for Bangladeshi contestant only]
Send your answer only to this email: ahmmad.cse@gmail.com
Labels:
Computer Questions for CSE students
Posted by
Unknown
0
comments
Data Update task of DBMS
An SQL UPDATE statement changes the data of one or more records in a table. Either all the rows can be updated, or a subset may be chosen using a condition.
The UPDATE
statement has the following form
UPDATE
table_name SET
column_name = value [, column_name = value ...] [WHERE
condition]UPDATE
to be successful, the user must have data manipulation privileges (UPDATE
privilege) on the table or column, the updated value must not conflict with all the applicable constraints (such as primary keys, unique indexes, CHECK
constraints, and NOT NULL
constraints).In some databases, as PostgreSQL, when a FROM clause is present, what essentially happens is that the target table is joined to the tables mentioned in the fromlist, and each output row of the join represents an update operation for the target table. When using FROM you should ensure that the join produces at most one output row for each row to be modified. In other words, a target row shouldn't join to more than one row from the other table(s). If it does, then only one of the join rows will be used to update the target row, but which one will be used is not readily predictable.
Because of this indeterminacy, referencing other tables only within sub-selects is safer, though often harder to read and slower than using a join.
Examples
Set the value of column C1 in table T to 1, only in those rows where the value of column C2 is "a".UPDATE T SET C1 = 1 WHERE C2 = 'a'In table T, set the value of column C1 to 9 and the value of C3 to 4 for all rows for which the value of column C2 is "a".
UPDATE T SET C1 = 9, C3 = 4 WHERE C2 = 'a'Increase value of column C1 by 1 if the value in column C2 is "a".
UPDATE T SET C1 = C1 + 1 WHERE C2 = 'a'Prepend the value in column C1 with the string "text" if the value in column C2 is "a".
UPDATE T SET C1 = 'text' || C1 WHERE C2 = 'a'Set the value of column C1 in table T1 to 2, only if the value of column C2 is found in the sub list of values in column C3 in table T2 having the column C4 equal to 0.
UPDATE T1
SET C1 = 2
WHERE C2 IN ( SELECT C3
FROM T2
WHERE C4 = 0)
You may also update multiple columns in a single update statement:UPDATE T SET C1 = 1, C2 = 2Complex conditions and JOINs are also possible:
UPDATE T SET A = 1 WHERE C1 = 1 AND C2 = 2
UPDATE a
SET a.[updated_column] = updatevalue
FROM articles a
JOIN classification c
ON a.articleID = c.articleID
WHERE c.classID = 1Or on Oracle-systems
UPDATE (
SELECT *
FROM articles a
JOIN classification c
ON a.articleID = c.articleID
) AS a
SET a.[updated_column] = updatevalue
WHERE c.classID = 1
References
http://dev.mysql.com/doc/refman/5.0/en/update.html http://www.postgresql.org/docs/8.1/static/sql-update.html
Labels:
data update,
Data Update task of DBMS,
DBMS,
tasks of dbms,
update data
Posted by
Unknown
0
comments
An election is contested by 5 caddidates.The candidates are numbered 1 to 5 and the voting is done by marking the candidate number on the ballot paper.Write a program to read the ballots and count the votes cast for each candidate using an array variable count.In case, a number read is outside the range 1 to 5,the ballot should be considered as a ‘spoilt’ and the program should also count the number of spoilt ballots
Write a program to read the data and determine the following (a)Total marks obtained by each student.(b)The highest marks in each subject and the roll no.of the student who secured it(c)the student obtained the highest total marks
import java.io.*;
class StudentResult
{
for(i=0;i< 100;i++)
{
total=0; for(j=0;j< 4;j++)
{
if(j==0)
System.out.println("Enter Roll number\t");
else if(j==1)
System.out.println ("Enter 1st subject marks\t");
else if(j==2)
System.out.println ("Enter 2nd subject marks\t");
else if(j==3)
System.out.println ("Enter 3rd subject marks\t");
result[i][j]=Integer.parseInt(br.readLine());
if(j!=0) total+=result[i][j];
}
result[i][j]=total;
}
}
public void showResult()
{
System.out.println ("Mark sheet");
System.out.println ("\nRoll 1st 2nd 3rd Total");
for(i=0;i<100;i++)
{
for(j=0;j< 5;j++)
{
System.out.println (" "+result[i][j]);
}
System.out.println ();
}
System.out.println ("\n\n");
System.out.println ("Roll number with total");
System.out.println("\nRoll Total");
for(i=0;i<100;i++)
{
for(j=0;j<5;j++)
{
if((j==0)||(j==4))
System.out.println (" "+result[i][j]);
}
System.out.println ();
}
for(i=1;i< 4;i++)
{
for(j=0;j< 100;j++)
{
if(j==0)
{
maxm=result[j][i]; maxr=result[j][0];
}
else if(result[j][i]>maxm)
{
maxm=result[j][i];
maxr=result[j][0];
}
}
if(i==1)
System.out.println ("\nMaximum marks in sub1 is :"+maxm + ""+maxr);
else if(i==2)
System.out.println ("\nMaximum marks in sub2 is :"+maxm + " "+maxr);
else if(i==3)
System.out.println ("\nMaximum marks in sub3 is :"+maxm + " "+maxr);
}
for(i=0;i< 100;i++)
{
for(j=0;j< 5;j++)
{
if(j==4)
{
if(i==0)
{
maxm=result[i][j]; maxr=result[i][0];
}
else if(result[i][j]>maxm)
{
maxm=result[i][j];
maxr=result[i][0];
}
}
}
}
System.out.println ("\nMaximum total is :"+maxm + " "+maxr);
}
}
#### What is HTML?Hyper Text Markup Language
- Hyper Text is the method by which you move around on the web — by clicking on special text called hyperlinks which bring you to the next page. The fact that it is hyper just means it is not linear — i.e. you can go to any place on the Internet whenever you want by clicking on links — there is no set order to do things in.
- Markup is what HTML tags do to the text inside them. They mark it as a certain type of text (italicized text, for example).
- HTML is a Language, as it has code-words and syntax like any other language.
How does it work?
HTML consists of a series of short codes typed into a text-file by the site author — these are the tags. The text is then saved as a html file, and viewed through a browser, like Internet Explorer or Netscape Navigator. This browser reads the file and translates the text into a visible form, hopefully rendering the page as the author had intended. Writing your own HTML entails using tags correctly to create your vision. You can use anything from a rudimentary text-editor to a powerful graphical editor to create HTML pages.
Labels:
How does html work,
html,
html langluage,
Hyper Text Markup Language,
What is HTML
Posted by
Unknown
0
comments
Why is Java known as platform-neutral language?
Plateform neutral or platform independence, means that programs written in the Java language must run similarly on any supported hardware/operating-system platform. A programmer should be able to write a program one time, compile it one time, and then be able to execute it anywhere; holding true to the Sun Microsystems slogan, "Write Once, Run Anywhere. "ava was designed to not only be cross-platform in source form like C, but also in compiled binary form. Since this is frankly impossible across processor architectures Java is compiled to an intermediate form called byte-code. A Java program never really executes natively on the host machine. Rather a special native program called the Java interpreter reads the byte code and executes the corresponding native machine instructions. Thus to port Java programs to a new platform all that is needed is to port the interpreter and some of the library routines. Even the compiler is written in Java. The byte codes are precisely defined, and remain the same on all platforms.
Java is used in many facets, from the digital displays on our microwaves and refrigerators in our kitchen to the digital displays on our telephones, fax machines, and copiers in our office. It is used on the web (via applets
Labels:
java is a platform-neutral language,
platform-neutral language,
Why is Java known as platform-neutral language
Posted by
Unknown
0
comments
A least five major C++ features that were intentionally removed from JAVA
Labels:
c++ and java,
C++ Features Not Found in Java,
different between c++ and java,
java tutorial
Posted by
Unknown
0
comments
A least ten major different between C and JAVA
JAVA to MS Access Connection (JDBC-ODBC bridge)
Labels:
java database connectivity,
JAVA to MS Access Connection,
jdbc,
JDBC-ODBC bridge,
odbc
Posted by
Unknown
0
comments
Java program for condition check within two numbers
import javax.swing.JOptionPane;
class Addition1
{
public static void main(String args[])
{
String result="";
String fN;
String sN;
int n1,n2;
fN=JOptionPane.showInputDialog("Enter the first number");
sN=JOptionPane.showInputDialog("Enter the second number");
n1=Integer.parseInt(fN);
n2=Integer.parseInt(sN);
if(n1==n2)
result=result+n1+"=="+n2;
if(n1>=n2)
result=result+"\n"+n1+">="+n2;
if(n1<=n2)
result=result+"\n"+n1+"<="+n2;
if(n1!=n2)
result=result+"\n"+n1+"!="+n2;
if(n1
result=result+"\n"+n1+"<"+n2;
if(n1>n2)
result=result+"\n"+n1+">"+n2;
JOptionPane.showMessageDialog(null,result);
}
}