Mario Jorge

Greenhorn
+ Follow
since Nov 06, 2016
Merit badge: grant badges
For More
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mario Jorge

changed the loop section and now getting out put of

15
0
0
12
0
0
9
0
0
6
0
0
3
0
0
0

its right to a point... the zeros need going... i know its something simples...

6 years ago
Hey - i need to have counter that prints out, in reverse order, every multiple of 3 between 1 and 200..
Make sense?
6 years ago
Howdy,

I have the following code... which outputs fine like this:

1
2
3
and so on...

I need it like this
3 2 1
6 5 4
down to 200

so 200 to 1.. backwards!

Any ideas? Thanks a lot

6 years ago
Hi lads - need help with a question if possible - the exact question is as follows:

a) Using recursion, compute the sum of all numeric values of each character in a string that are in the range a-z, where a=1, b=2, … z=26. Any other character has no value. The method is case-sensitive, so uppercase letters have no value. Call the recursive method from main().

b) Now add a class called StringConverter in its own .java file, which has a recursive static method like the one just created but has an extra parameter called caseSensitive which if set to false will treat uppercase letters as lowercase letters. Call this new recursive method statically from main(). For example if this is called on the string abCde with caseSensitive set to false, it will return 15. With caseSensitive set to true it will return 12.


I have code as follows below - when i run nothing happens... I have 1 hour to submit any help would be greatly appreciated...



&



thanks,
Mario
7 years ago

Carey Brown wrote:You need to create a new Cubiod_test and add it to the frame.



Thanks Carey - that worked
Thanks a lot
Mario
7 years ago
Hi All - Have an assignment to draw a cuboid - I have the below but when it runs - nothing appears.
Can you have a look to see if you can spot something I can not please?

7 years ago
Hey Campbell Ritchie - Thanks for the information and advice.

Will try explain the app better...

It will ask a letter between a-z - that letter is the assigned a number IE A=1, B=2 and so on.
Then your asked for 3 numbers... these numbers are then added together and multiplied by the numbered letter.
So if someone choose A its then 1 - they enter number 2, 3, 4....
the output will be A, 2, 3, 4, 9 (9 is 2+3+4= 9 - then 9X1(A) = 9)

Does that make sense?

Thanka a lot, Mario
7 years ago
Hi Lads - thanks for advice I went a different route but I'm stuck!!

At the moment the output is:
a123i

so if I enter "a" the output should be
a1235 a as we entered it, 1,2,3 as the integers entered and as
multiplication of the ints... but that's where I'm stuck..

If you see "String_5" I'm trying to basically multiple the output
of string_4 but aint happening... any ideas?


7 years ago
Hi All,

Is there an easier way to write a program that prompts the user for a character in the range of a-z (inclusive) and 3 integers in the range of 1-9 (inclusive). The program should convert the character into lowercase and get its numeric equivalent (where a is 1, b is 2 ... z is 26) and multiply the numeric equivalent by the sum of the integer inputs?

I was going to do something like int1=a, int2=b and so on so on but seems a little round winded no?

Thanks for the help,
Mario
7 years ago

Henry Wong wrote:

Mario Jorge wrote:
How many iterations do the following loops carry out? Assume X is an integer variable that does not get changed by the loop body!



It takes only  a minute to write a quick program and see for yourself.  Why don't you just try it?

Hint: I just looked at the first one. And you were incorrect -- which is why I am suggesting you try it yourself.

Henry



Thanks Henry - TBH I never thought of it and you were right I was way off.
But your advice paid off and I thank you a lot.

All the best - Mario
7 years ago
Hi All - I have to answer the below for an assignment in College... but the answers I'm not 100% sure on!!

Might be right... but if you wouldn't mind casting your eye over them... much appreciated.

How many iterations do the following loops carry out? Assume X is an integer variable that does not get changed by the loop body!
A: for (x=1; x<=10; x++) = 9
B: for (x=0; x<=10; x++) = 10
C: for (x=10; x>=0; x--) = 10
D: for (x=-10; x<=10; x++) = 20
E: for (x=10; x>=0; x++) = 10
F: for (x=-10; x<=10; x+ =2) = Not sure
G: for (x=10; x<=10; x+ =3) = Not sure maybe 0?

Thanks a lot - M
7 years ago

Campbell Ritchie wrote:It might be better to use a StringBuilder:-Only one print call so might have faster execution.



Hey Campbell Ritchie - Thanks for above... How would I initialize this? I have succeeded in the majority - new code below the only thing I am not missing the neat output... Do i need to rewrite the whole thing or..? New code below

7 years ago
Hi all - thanks for the help... I think I figured out the majority of it...



Some things I'm wondering... Right now the output is:
Please enter number of rows between the range of 3 to 10: 8
Please enter number of Columns between the range of 5 to 10: 8


Which is right but is there a way to format it so the rows / columns actually line up underneath each other ?

Another thing... I'm to "validate users input" ?
And one last thing I promise.. they want us to use another method user than main... I dont need it tho!!?

Thanks again all

Mario
7 years ago
@Junilu - thanks for advise... I'm sure I will learn to laugh it off!

@Campbell Ritchie - thanks for the welcome
7 years ago
Hi Carey - thanks for replying! They have touched on loops but nothing in depth yet. So nested loop is what I should use? Will do some searching on it and see if I can figure it out... thanks a lot - Mario
7 years ago