Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

jon ninpoja

Ranch Hand
+ Follow
since Jul 25, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jon ninpoja

yes you are just not smart enough...have a nice day!!!
5 months ago
i just cant get around how to do a guess the number with a while loop

here is my code

but it just loops
i knopw you can do this with simple if statements but trying to use a while loop

6 months ago
hi jeanne

yes i realise that i dont need every value stored in a variable
i have just created a total
and total = total + numberAdded
or total += numberAdded

trying to work out how to get the highest value in the numbers now
6 months ago
really battling with the logic in this for loop exercise

Prompt the user for the number of numbers they want to enter. Read in each of the number. When all the number have been entered display: the average, the highest number, the number that were divisible by 3, and the total

what i cant work out is how to store each user input in a variable within the loop and not allowed to use lists

any push in the right direction would greatly be appreciated
6 months ago
are there exercises on this site?

looking for some to do with if else if else

i had some good ones about drivers ages and years driving and whether they qualified for insurance
looking for some online but havent found anything good

7 months ago
thanks jeanne

yes changed or to and ...its working perfect now
so the and checks it as 1 condition
but or is allowing different results in right?

whats up with all the <b> </br> etc never seen it before
7 months ago
have this question to do

Design and implement a program that will accept a person’s age, number of year driving, and whether or not they drink. The program will determine whether they are eligible for car insurance or not. A person under 22 is not eligible. People 22 and up to 30 are eligible if they do not drink and are driving 3 years or more. People over 30 are eligible if they have at least 6 years driving experience. You need to display an appropriate message to the person who is applying for insurance.

its all working except for over 30 which seems to be running the first if for some reason can somebody please help me understand what is wrong

here is my code

also can somebody tell me how efficient this code is...and how would be the best way to write this...thanks

7 months ago
also is there a way to add a currency symbol like $ or € to the format so that it puts it before the float
7 months ago
i have a load of strings with floats and ints that need to be formatted to 2 decimal places and moved across the screen

i know that this line formats subTotal to 2 decimal places

is there a way you can use a variable like this

and apply it to multiple variables?

i tried a few things but just got errors

or does this line have to be applied to every line you want to format


7 months ago
ok think i have it now

tell me what you think...
7 months ago
actualFreeFlights = teachers - teachers + freeFlights

think this solved it...but please let me know if im right...or did i miss something

7 months ago
now this:

produces this:

how many students?100
how many teachers?100

its minuses 5 from teacher...and 5 free flights is what it is...i know im close
just cant see it.
7 months ago
hi guys

if there are students and teachers flying to Kingston Jamaica for holiday and...

Flights are $297.67 per person travelling
There is one free teacher’s flight for every 20 students
There is no reduction if a free flight isn’t availed of
Any extra teachers pay full price

now the thing is that if there is no discount nothing must print it only prints out the discount when a free flight is available and deducts it from the grand total at the end

so i was trying to work it out on paper first...

when dont you want reductions to print (ie when isnt there one)

a) when there is less than 20 students
b) when there are no teachers
any others?

here is the code i have written so far,but i just cant get my head around how this would work

7 months ago