yan cle

Greenhorn
+ Follow
since Dec 15, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yan cle

Campbell Ritchie wrote:Challenge: write code to accumulate ints into an array without using a loop. There is a straightforward and elegant way to do it. You can count elements in the array as you go, but that is awkward and it might not be necessary: you can use the length field of the array instead.



its already done,i did my calculation earlier and i made it,  i may closed this thread aha..
5 days ago

Paul Clapham wrote:Do you mean, how can you display the loop variable "count" after the loop finishes? You can't, not given the code you posted. But when the loop finishes you know that its value is equal to the value of "loop". You could display that.

Or you could just declare the variable outside the loop.



yes, if i put like this
Number of Loop: 5
INDEX [0]: 1
INDEX [1]: 2
INDEX [2]: 3
INDEX [3]: 3
INDEX [4]: 3

this index from 0-4 should display or declare them outside the loop how can i do that? so i can use them if i put if or compare them to the new input
5 days ago

Carey Brown wrote:Your class name 'main' should begin with an upper case letter. Variables should be declared separately. Use Scanner instead of BufferedReader, then you can use nextInt() instead of parseInt().



it should be just bufferedreader
5 days ago
how can i declare my input on the loop outside the loop and im using array, thanks for who's answering this.


how can i display it outside the input[count] outside the loop.
5 days ago
Thanks for all the comments.
3 weeks ago
okay, Thank you.Godbless
1 month ago
but because i go this site is to have an idea, what is the code is. or what to use. aha
1 month ago
thanks im just new, but i will do your advice thank you
1 month ago

Carey Brown wrote:

yan cle wrote:

Carey Brown wrote:You are not tracking which letters you've already counted.

Hint: sort 'c'

But still follow Campbell's advice and work it out with pencil and paper first.



sorry im confuse, im just new to java, and my teacher did'nt taught us about encrpytion, thanks for your answer.


I was referring to your character counts, not the encryption.



what should i do then. i am willing to learn. can you help me?
1 month ago
i didn't write anything i'm just typing and coding sorting out how would i do it, i didnt do any writing and thinking about it, because i really dont know the code or what to use, some of the code he taught us but the statistic he doesnt taught us, or what the code to be use, he just give us this and say use our logic but then again not giving a reviewer, or anything he just want us to make the out on ourself, but here is the problem, i dont know the java coding, im just a newbie and noob about java. sorry, that's, yeah its a self taught code, not because he gives us that code.
1 month ago

Paul Clapham wrote:

salvin francis wrote:I see a small flaw in the encryption algorithm itself.



True... but the requirements (at least those posted here) don't say anything about decryption. So that isn't a problem.



yeah, and the encrpytion is my only problem now and a little bit in statistic . im just figuring out the statistic what could be is missing.
1 month ago

Campbell Ritchie wrote:Welcome to the Ranch

Afraid you have put the cart before the horse. Write down the algorithm you are going to use for one part of the assignment. You shouldn't write any code before you have decided what you are going to do. Don't try to do the whole assignment all at once.



sorry i don't get it. hehe. the other algorithm is not given, he just gave this and we don't even know how to do it, sorry but i'm just new to java, i am nobody but a scratch in java. thanks btw for the comment and advice
1 month ago

Carey Brown wrote:You are not tracking which letters you've already counted.

Hint: sort 'c'

But still follow Campbell's advice and work it out with pencil and paper first.



sorry im confuse, im just new to java, and my teacher did'nt taught us about encrpytion, thanks for your answer.
1 month ago

salvin francis wrote:I see a small flaw in the encryption algorithm itself. If you subtract 1 from vowels and add one to consonants, how will the decryption algorithm work ?
e.g  Both "c" and "e" would result in "d".



yeah that's what he wanted, my teacher give this and yet he doesnt teach us how to do it so, my head hurts aha.. can you give me a little help? im so confuse a
1 month ago
Create a java program that accepts user inputs specially full name and favorite motto/bible verse or any sentence, the program must return character statistics, encrypted code, total numbers of words, character count, and character without spaces. full name format must be in firstname middleinitial surname as shown in the sample output below. the encryption rule is for vowels -1 (e = d), and for consonants +1 (g=h).

sample output
enter full name: Juan P. Pedro
enter motto or bible verse: The quick brown fox jumps over the lazy dog
--------------------------------------------------------------------------------
Character Statistic
T - 1
h - 2
e - 3
  - 8
q - 1
u - 2
i - 1
c - 1
k - 1
b - 1
r-2
o-4
w-1
n-1
f-1
x-1
j-1
m-1
p-1
s-1
v-1
t-1
l-1
a-1
z-1
y-1
d-1
g-1
Encrypted code: Uod!rthdl!csnxo!gny!ktnqt!nwds!uid!m`{z!enht
total number of words: 9
Character count: 43
Characters count without spaces: 35

heres my code and im stuck here i dont know what the next is



i dont know how to get the encrpytion and the statistic is not accurate about what is needed like the i and the spaces it should be 1 per letters in statistic but my output has 2 i  in "time is gold" like this
t 1
i 2
m 1
e 1
 2
i  2
s 1
 2
g 1
o  1
l  1
d  1
please help me thank you
1 month ago