- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
33 Posted Topics
Is it OK to have if statement in the constructor Thanks [CODE] public class CTime { private int start_hour; private int end_hour; private int start_minute; private int end_minute; public CTime(int h1,int m1,int h2,int m2){ if(h1>=7 && h2<17 && h2*60+m2>h1*60+m1){ setStartHour(h1); setStartMinute(m1); setEndHour(h2); setEndMinute(m2); } }[/CODE] | |
I do have a dataset with id date code 1 02/02/2012 A 1 02/07/2012 B 1 02/21/2012 A 2 02/02/2012 C 2 02/09/2012 A and I have to create a grid with the days in february and insert the code in the coresponding days id 1 2 3 4 5 … | |
Hi ,I am trying to implement merge sort with list and I have this error in this code [COLOR="Red"]invalid use of void expression[/COLOR] list<string>::iterator LIST_ITER; sz is the size of the list beg beginning of the list end end of the list Thank you in advance [CODE]void merge_sort(LIST_ITER beg, LIST_ITER … | |
Hi,I am trying to verify form input for length(before that I would like to trim it) How can I do that for user Thanks [CODE]function verify(){ var user=document.getElementById("user"); var pass=document.getElementById("pass"); var msg= ""; document.write("Length "+user.length); if(user.value == ""){ msg+= "Please enter a username!\n"; user.className = "inpBoxError"; } if(pass.value == ""){ … | |
I have this problem with xsl if I entered the state and the city is working fine ,but if I miss one or the other doesnt work Thanks [CODE]<?php $city=$_GET['city']; $state=$_GET['state']; $dom = new DOMDocument; $dom->load('Sample.xml'); $xsl = new DOMDocument; $xsl->load('asn6.xsl'); $xslt = new XSLTProcessor(); $xslt->importStylesheet($xsl); if(isset($city)) $xslt->setParameter(NULL, 'city', $city); … | |
Hi ,traing to explode list like 1. one.gif 2. two.gif [CODE]$datain= file_get_contents($filename); $lines=explode("\n",$datain); for($i=0;$i<sizeof($lines);$i++) { echo $lines[$i].'<br>'; $images=explode(":",$lines[$i]); }[/CODE] | |
I am confused with the optimized quick sort little help please [CODE] public static void quickSort(int []A,int p,int q){ while(p<=q) { int r = partition(A, p,q); quickSort(A, p, r); quickSort(A, r+1, q); } } static int partition(int []A, int p, int q) { int a=A[p]; int lp=p-1; int rp=q+1; while(A[rp]<a) … | |
I am trying to fill up the array den and it is giving me java.lang.NullPointerException Why is that Thanks [CODE]public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter an amount:"); float amount= input.nextFloat(); int denom, i=0; int [] den=null; do{ System.out.print("Enter denominations: "); denom=input.nextInt(); den[i]=denom; i++; } while(denom!=0);[/CODE] | |
| |
Hi ,I am trying to implement stack with linked list ,but when I run it show up NullPointerException How can I avoid that with try and catch Thanks [CODE]public char pop() { try{ ListNode returnNode = top; top = top.next; } catch (Exception e){} return returnNode.value; }[/CODE] | |
Hi ,I want to go back after the else to the if statement(step2),how can I do it [CODE]public class main { public static void main(String[] args) { gcd(12,23); } public static void gcd(int m,int n){ int uPrime=1; int vPrime=0; int u=0; int v=1; int mPrime=m; int nPrime=n; int counter=0; if(mPrime%nPrime==0)//step2 … | |
Hi,I have to write code in java and in the description is this symbol u' Can anybody tell me what is the meaning of it Set (u') | |
Hi ,I am learning java ,and wondering why is this return in this method Thanks [CODE]public void updateDisplay() { if (curIndex<0 || curIndex>=appObj.array.size()) { display.setText(""); return; } display.setText( appObj.array.get(curIndex).toString()); }[/CODE] | |
HI I have method object appointment ,and inside this object I have another object time and I want to get startHour method(inside the time object) (method startHour(inside TIME(object)inside Appointemt(object)) How can I do that :@ Thanks | |
Hi ,I am trying to catch exception if integer is out of certain interval ,how can I do that. Lets say that float variable has to be in the interval 2 to 5 in all other cases exception Thanks | |
Hi ,I have super class vehicle,truck extends vehicle,and I created array in test class full with objects from vehicle and truck,how can I call method from vehicle,is this the way (truck)object1[1].getMethod() | |
HI,I am having trouble understanding if I have to ADD F4H and B1H(hex) ,what will be CF and OF (flags).Could somebody explain. Thanks | |
Hi I am trying to put letters in array ,before that I am converting capitals to lower case.Putstr,getch,putint are predefined macros Thanks [CODE] .386 .model Flat include Cs266.inc .data array DD 128 dup(?) promt DB "Enter a string of at most 128 characters: ",0 count DD 0 .code main: mov … | |
Hi ,I am trying to print this ,so far unsuccessful,I am printing only the first row Thanks [CODE] 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10 11 12 … | |
Hi,I am trying to do if statement in Assembly but it doesnt work.Could you help me putstr is predifine macro Thanks [CODE].386 .model Flat include Cs266.inc .data mes1 DB "First Greater" mes2 DB "Second Greater" var1 DD 22 var2 DD 9 .code main: mov EAX,var1 cmp EAX,var2 jge else jmp … | |
Hi ,I am trying to count all characters in entered text ,putch and putint are macroses for printing int and char What I am doing wrong Thanks [CODE] .386 .model Flat include Cs266.inc .data count DW 0FFH .code main: mov BX,count here: getch cmp EAX,-1 INC BX je exit putch … | |
Hi ,I am new in Assembly and I am trying to print the first element of array putint is macros include in Cs266 [CODE] .386 .model flat include Cs266.inc .data Arr DW 1,2,5,9,12 .code main: mov AX,[Arr] putint AX ret end [/CODE] | |
Here I am creating the objects and try to print them,I have differnt classes for date and Employee.The objects EmplObj and EmplObj2 ,are created but I have problem when I tried to print them ,it is printing only the first one [CODE] public class tester { public static void main(String … | |
Hi,I am new in Java ,and I was wondering if somebody can explain what is the right way to create new object.Is the only right way the case 3,Am I only overwriting the arguments in the same object in case 1 and 2 Thanks [CODE] public static void main(String[] args) … | |
Hi,I have a question ,which one is a better way to set constructor [CODE]public Employee(String name,double hours,double perHour,Date dateOfHire){ id=++count; setName(name); setHours(hours); setPerHour(perHour); this.dateOfHire=new Date(); } [/CODE] or [CODE] public Employee(String name,double hours,double perHour,int day,int month,int year){ this(name, hours, perHour, new Date(day,month,year) ); [/CODE] | |
Hi everybody,I have java exam tomorrow and one of the question is going to be tracing code,unfortunately I am not vary good at that.My question is if anybody knows web site on the net with similar questions and answers Thanks yesterday the professor give us this example [CODE]public class A … | |
Hi,if I have array of objects {first(name,age),second(name,age)} How can I access first (name) in java Thanks | |
Hi I need help with bubble sort ,Why doesnt work Thanks [CODE] public void printList(){ System.out.print(patientsList.get(0).getFirstName()); for(int i=0;i<patientsList.size();i++){ for(int j = 0; j < patientsList.size(); j++){ for (int b=(j+1);b< patientsList.size(); b++){ int first=patientsList.get(j).getPriority(); int second=patientsList.get(b).getPriority(); if(first>=second){ int temp=first; first=second; second=temp; } } } String fname = patientsList.get(i).getFirstName(); String lname = … | |
Hi,I have myfile.csh first second third ..... How can I find how many variables I apply to the file Thanks | |
Is there method in Java to compare the strings first letter and sort the alphabetical or I have to substring and compare them with bubble sort Thanks |
The End.