wayne brandon

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

Recent posts by wayne brandon

Am I correct in saying that you can only return the characters at index 0 and 6 if they being added to a String in the return?


3 days ago
100 - 93 = 7, yes it is within 10 of 100
100 - 89 = 11, no it is not within 10 of 100
6 days ago
Is it vital to know string indexing (doing the exercises on codebat)

How often will you do what the exercises are showing in a real program / project?

I just wondered if im better moving onto something else and worrying about that when I need to.

1 week ago
hi Campbell,

So the set balance is better done in the constructor? I thought doubles were mostly used for decimal numbers in java. is it float?

1 week ago
ok im thinking that n is the number you are given
so you should - 100 from n
then you should check to see if the difference between the deduction is
greater than or less than 10?

but i dont know how i would put this into code
1 week ago
Hi guys doing a bank account exercise

I have three classes:

Main BankAccount KeyboardUtility

Im trying to get the user to accept the input he has made, and then to run it again if the user is unhappy

i have a method in the BankAccount class called validateUserInput that just reads back to the user what information he has entered but i'm having problems getting the questions to run again if the user says no

i tried putting everything in main into another method called askUserQuestions in the Main class, which meant I had to instantiate Main but the bank account class still couldnt see that method

so I posted all this here to get some advice on the best way to proceed


Main class:



BankAccount class:



KeyboardUtility class

1 week ago
Hi Liutauras Vilda no not yet, you see i try to work on multiple questions at once so that im not waiting for help on one topic and sitting idle. I am busy with a bank account exercise at the moment (Which I have just posted help on (surprise surprise) then will return to this now.

This question was from codebat and gave the Math.abs in a tip just below it.

also forgot to ask:

here is the question

Given an int n, return true if it is within 10 of 100 or 200. Note: Math.abs(num) computes the absolute value of a number.

nearHundred(93) → true
nearHundred(90) → true
nearHundred(89) → false

do you think the question is referring to before 100 and 200? or after them too? how would you read this?

1 week ago
lol yes the hdd standard that was before sata

whats your background Campbell?, where do you work?
you are in the UK right? I lived in London from 93 to 96, good times!!!

is England going to win the world cup?
1 week ago
Hi Campbell I had my own IT/Computer shop for 9 years in a small town in Ireland before moving to the big city of Cork.
I did a boot camp there recently as you know, im now starting a degree track in my community college in two months time (Cant wait)

I still have clients that i see about one to two days a week, right now im trying to recover an old database off an ide hard drive that is sixteen years old lol

sorry for boring you with my life stories
1 week ago
Junilu Lacar yes i appreciate that, number was just used as a quick test when i was messing with Math.abs

Campbell - take yourpoint on google, will only use that link you gave me from now

work is getting in the way of my coding today, so will give this a go later tonight thanks all
1 week ago
in this exercise:

Given an int n, return true if it is within 10 of 100 or 200. Note: Math.abs(num) computes the absolute value of a number.

but after googling the Math.abs method I found this:

Java Math abs() method
The java.lang.Math.abs() returns the absolute value of a given argument.

If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned

but i am not sure how to use this to solve the problem

i tried this for a laugh


but it just returned the number that was int n

1 week ago
Yes I agree as usual, thanks Carey will continue with it tomorrow
1 week ago
I have realised the main problem I'm having and if i can sort this out I think I will make huge headway

I have the following classes:

Main
FantasyCharacter
UserInterface
KeyboardUtility

and I dont know how to make them work together.

I want the program to ask the user for a character name and print it out at the end (Along with other functionality I will add as I go along)

the name instance variable is in the FantasyCharacter class



and i have a setName method in the same class



now you guys have told me to add a UserInterface class to handle my input calling and text display.

but I cant work out how from the interface class I can get an answer into



this is the major problem I'm having is the linking up and communication between objects methods etc etc
well i'm sure this exercise is useful



1 week ago
ok all good thanks will rearrange

what about calling the function to ask again for the name if the user says no, is that sloppy?

lastly will a UI Class (i have created a UserInterface class)
use static methods like my Keyboard class?
1 week ago