any computer programmers here?
Old 02-22-2011, 06:33 PM   #1 (permalink)
is not changing this sig until we win a playoff series

everyones a critic
 
th3answ3r's Avatar
 
Join Date: Apr 2010
Location: Toronto
Posts: 2,304
Representing:
Default any computer programmers here?

so i just finished 10 computer sci and decided to fast track and take 11. man the transition is HUGE even thought it doesn't have a prerequisite. i was a beast at turing and vb6 but not i am lost in java. i get syntax errors all the time. very frustrating stuff.
th3answ3r is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 08:25 PM   #2 (permalink)
Psi
Only likes Hockey with 'Fantasy' infront of it

Senior Member
 
Join Date: Oct 2009
Location: Mississauga
Posts: 1,855
Representing:
Default

Ya Java's a pretty good step up, same with C++/C# etc
Not that I can remember any of my programming, I can remember all my cisco stuff, but all the normal programming is gone.
Psi is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 08:43 PM   #3 (permalink)
pensive

feat. Otto Neurath
 
Ligeia's Avatar
 
Join Date: Jan 2009
Posts: 2,072
Representing:
Default

I can do some C++, HTML, CSS, Javascript, and PHP, and can usually figure out other languages for spot use. Is there something you need help with?
Ligeia is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 08:51 PM   #4 (permalink)
is not changing this sig until we win a playoff series

everyones a critic
 
th3answ3r's Avatar
 
Join Date: Apr 2010
Location: Toronto
Posts: 2,304
Representing:
Default

some of the questions im being asked. i dont know what tools to complete each one. how do i know what the smallest # is etc. i dont know what the method is called in java so i cant really google it.

4. Write a program that will determine the number of times an integer can be divded by 2 with no remainder. For example 60 can be divided 2 times.

5. Write a program that will find the smallest number entered. The program will end when the user enters ‘end’.

6. Write a program that will sort 3 numbers from smallest to largest.

7. Write a program using switch/case that determines the number of combos ordered at a restaurant. Assume there are four combos possible (combo 1, combo 2, combo 3, combo 4.
th3answ3r is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 09:06 PM   #5 (permalink)
pensive

feat. Otto Neurath
 
Ligeia's Avatar
 
Join Date: Jan 2009
Posts: 2,072
Representing:
Default

I will give the general code for one to help you get started. Putting it into the Java language is up to you, and should be very straight forward.

Quote:
Originally Posted by th3answ3r View Post
some of the questions im being asked. i dont know what tools to complete each one. how do i know what the smallest # is etc. i dont know what the method is called in java so i cant really google it.

4. Write a program that will determine the number of times an integer can be divded by 2 with no remainder. For example 60 can be divided 2 times.
declare variable num
declare variable count = 0

output "Please enter a number"
input the number that was entered and store it in num

while (num%2 = 0) // this is the modulus operator, which returns the remainder
{
count++
num = num/2
}

output the variable count, which should equal the number of times you divided by 2
Ligeia is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 09:18 PM   #6 (permalink)
is not changing this sig until we win a playoff series

everyones a critic
 
th3answ3r's Avatar
 
Join Date: Apr 2010
Location: Toronto
Posts: 2,304
Representing:
Default

Thanks for the help. I however don't understand what the count is for

Last edited by th3answ3r; 02-22-2011 at 09:24 PM.
th3answ3r is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 09:25 PM   #7 (permalink)
pensive

feat. Otto Neurath
 
Ligeia's Avatar
 
Join Date: Jan 2009
Posts: 2,072
Representing:
Default

Now, the keys to the other problems:

5) Use a while loop to compare an input number against a stored small number.
input num
input smallnum
while (num != end)
{
if (num < smallnum)
{
smallnum = num
}
have the user input another number
}


6) Very straight-forward. Just store the 3 numbers, compare them, and store the lowest as num1, the next lowest as num2, and the highest as num3, ie.
if (numa < numb)
{
if (numa < numc)
{
numlow = numa
if (numb < numc)
{
nummid = numb
numhigh = numc
}
numhigh = numb
nummid = numc
}
numlow = numc
nummid = numa
numhigh = numb
}
else
{
if (numa < numc)
{
numlow = numb
nummid = numa
numhigh = numc
}
}
output numlow as lowest number, nummid as middle number, and numhigh as highest number


7) I'm not sure I understand this question. It seems it is asking you to find out how many orders are possible, then tells you how many orders are possible.
Ligeia is offline   Boss Key Wife Key Reply With Quote
Old 02-22-2011, 09:27 PM   #8 (permalink)
pensive

feat. Otto Neurath
 
Ligeia's Avatar
 
Join Date: Jan 2009
Posts: 2,072
Representing:
Default

Quote:
Originally Posted by th3answ3r View Post
Thanks for the help. I however don't understand what the count is for
count is a variable that begins with a value of 0. You use the ++ operator to increment it.

So, before you enter the while loop, count has a value of 0.

On the first iteration through the while loop, count is incremented from 0 to 1.

On the second iteration through the while loop, count is incremented from 1 to 2.

Basically you are counting how many times you can go through the while loop, because the while loop is testing your ability to divide by 2 without getting a remainder.
Ligeia is offline   Boss Key Wife Key Reply With Quote
Old 03-07-2011, 08:09 PM   #9 (permalink)
is not changing this sig until we win a playoff series

everyones a critic
 
th3answ3r's Avatar
 
Join Date: Apr 2010
Location: Toronto
Posts: 2,304
Representing:
Default

know any hints on the algorithm to reduce a fraction? i can't get the improper fraction to turn into a mixed number and crap as well as implement negative numbers. i noticed the girl converted the fractions into decimals, and using if statements, sorted them into the output. i don't know if that goin work.
th3answ3r is offline   Boss Key Wife Key Reply With Quote
Old 03-07-2011, 08:58 PM   #10 (permalink)
bored.

Senior Member
 
iRaptor's Avatar
 
Join Date: Mar 2009
Location: Toronto
Posts: 1,032
Representing:
Default

Can you make a website?
iRaptor is offline   Boss Key Wife Key Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 04:07 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright RaptorsForum.com 2005-2011

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24