Q1 a)label two types of java programs?Ans:Java is of dual utility. Applications and Applets. Applications: Standalone Java programs executed independently of a browser. The execution is done using the Java interpreter. Applets: Programs that are called through an HTML page and run on a Java-enabled browser. User’s PC downloads these Java bytecode from the Internet and run them on their own machines. To run an applet you need a java-enabled Web browser. Netscape Navigator is one of the java-enabled Web browsers b)Define dilate variable. furnish an example of the same. Ans :The object has state and behavior which is expressed by the variables and the methods. And the software objects are the real world objects which models a real world. It would have variables to indicate the current state and its behavior these variables are normally called as dilate variables. For example :A ball has specific characteristics such as diameter alter elasticity etc. We say these characteristics are necessary to the roll’s state of being. We also define a ball by what it does such it can be thrown or rolled or bounced. These activities are considered as the roll’s behavior. And the variables defining them ordain be the instance variables c)Differentiate between Binary search and the Linear search?Ans : Binary examine :1. Binary search searches for the given item in a sorted array 2. In this search reduces to half after every successive stage. Linear search :1. In linear search each element is compared with the given item to be searched for one by one. 2. In this method arrange should not be sorted one d) Assign the value of pie (i e. 3.142) to a variable with requisite data type. Ans : double pie=3.142;e)Explain with an example the if-else-if constructAns : While writing a java program in inspect you have to be your create based on many options then if-else-if statements are used. For eg. StatementIf con1adjust?YStatement 1If con2True?YStatement 2ifelse ifStatement 3elseStatement 4Part of the program for eg if(marks
trueHi equals there -> falseHi equals HI -> falseThis will give error : cannot resolve symbol ,because EqualsIgnoreCase() is not right it should be equalsIgnoreCase()g) Evaluate the following expressions if the values are a=2 b=3 and c=9;Ans : 1) -22 2) 2divide BQ4 create verbally a method to act object of a class and label the above member method categorise salary{ double anntax=0; String name; String communicate; int phone; String sub_speci; double sal; double i_tax=0; public salary() { name=" "; communicate=" "; telecommunicate=0; sub_speci=" "; sal=0; anntax=0; } public salary(String nm,String Add,int ph,String sub,double sala) { name=nm; Address=Add; phone=ph; sub_speci=sub; sal=sala; } public void dispdet() { System out println("name "+label); System out println("Address "+Address); System out println("telecommunicate "+phone); System out println("subject specialisation "+sub_speci); System out println("salary "+sal); System out println("tax "+anntax); } public manifold taxcompute() { manifold t=sal*12; if(t>175000) anntax=sal*0.05; else anntax=0; go anntax; }} categorise dvd { public static void main() { salary teacher=new salary(); teacher taxcompute(); teacher dispdet(); }}Question 5create verbally a program to reason and display the sum of the following series categorise ser1{ public cancel main(int num) { double sum1=0,sum2=1,sum3=0; int i,j; for(i=1;i
Forex Groups - Tips on Trading
Related article:
http://chandanarora.blogspot.com/2007/11/sample-question-paper-with-solution.html
comments | Add comment | Report as Spam
|