| | |
Array list or character ? in java
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
this is the answer about the count:
int counter (string s){
count=0;
for (int i=1;int i<s.length();i++)
count ++;
return count;
}
It already is a function that returns the number of character. And your counter has bugs.
Last edited by firstPerson; Sep 18th, 2009 at 8:46 pm.
1) Prove that the area of a circle is pi*r^2, where "r" is the radius of the circle. 2) Problem 2[b]solved by : jonsca
•
•
Join Date: Sep 2009
Posts: 3
Reputation:
Solved Threads: 0
there is another way to solve this one i got it and told my teacher also made the program from it at last minute
12+6=18 which is divisble by 9 %=0
6+3=9 same %=0
so the answer will be 8+1=9 %=0
12+6=18 which is divisble by 9 %=0
6+3=9 same %=0
so the answer will be 8+1=9 %=0
Java Syntax (Toggle Plain Text)
import java.util.Scanner; class Guard { public static void main(String args[]) { int a; int b; int c; int rm; Scanner input=new Scanner (System.in); System.out.print("Enter the digit that the guard has given you:"); a=input.nextInt(); System.out.print("Please enter your password:"); b=input.nextInt(); c = a + b; rm = c%9; if (rm==0 && b<9) System.out.println("Access granted "); else System.out.println("Wrong Password! Access denied"); } }
Last edited by ~s.o.s~; Sep 20th, 2009 at 10:17 am. Reason: Added code tags, please learn to use them.
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
I want to create a a program in which i enter a word and the program counts the number of alphabets used in the word and display as output !!
I know its simple but i am just a beginner and my teacher wants to submit this as assignment
this is the question
2. A man wanted to enter a club but did not know the password that was required. He waited by the door and listend, a club member knocked on the door, the door man said "twelve" member replied "6" and was let in. Second member came to the door, doorman said "six" the member replied "3" and was let in. now the man throught that he had heard enough and walked up to the door, doorman said "eight" the man replied "4" but he was not let in. What should he say? so that he gets in.
![]() |
Similar Threads
- Making MUD. Should map be 4D Array or Linked List? (Java)
- Passing Array element to a list (Java)
- Uses of Array List (Java)
- Open In New Window Php (PHP)
- How to store array? (Java)
- List View (like in VB) in Java? (Java)
- text processing? (Java)
- Inserting array into cookie (PHP)
- Array help (Java)
Other Threads in the Java Forum
- Previous Thread: Urgent! I need to teach someone 'special'
- Next Thread: JText
Views: 1906 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for array, character, java
.net add ajax apple applet applications array automation binary c# c++ char character class classes click code component convert coordinates count data database design development draw dynamic eclipse error event exception file firefox fractal frequency function game google graph gui html image index input int integer java javafx javascript jetbrains jmf jsp julia linux list listbox loop loops method microsoft mobile mysql netbeans newbie number object perl php pointer problem program programming project property python random recursion reference scanner search security set single socket software sort sql string sun swing test threads time transfer tree user vb virtualization web windows







