Results 1 to 3 of 3
- 03-05-2013, 12:37 PM #1Member
- Join Date
- Mar 2013
- Rep Power
Truncate and If statement with "is not a whole number"
Our prof. gave us this pseudocode...he wants us to research and transform it into an actual program...
i'm having a big problem on this part of the pseudocode
if(Interval is not a whole number) then
how can i use a if statement in determining if it is a decimal or a whole number??
and how do i use truncate??
truncating it into ones twos or threes...
this code has an array of 14 names i didn't include them
Set Interval to N
while(Interval is not 1)
Set Interval to ((Interval/3)+1)
If(Interval is not a whole number) then
Set start to 1
while(start <= Interval)
set Unsrt_Indx to (start + interval)
while(unsrt_Indx <= N)
if (Arr[Unsrt_Indx - Interval] > arr[unsrt_Indx] then
set str_indx to unsrt_indx
set temp to arr[srt_indx]
while((str_indx >start && (arr[str_indx-Interval] > temp))
set arr[set_indx] to arr[str_index- interval]
set str_indx to (crt_index - interval)
set arr[str_indx] to temp
set unsrt_indx to (unsrt_indx + interval)
please help!! :)
i possible help me transform this into a program :)
- 03-05-2013, 01:46 PM #2
Re: Truncate and If statement with "is not a whole number"If you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 03-05-2013, 02:47 PM #3
- By klspepper in forum New To JavaReplies: 0Last Post: 12-07-2012, 09:29 AM
- By Googol in forum New To JavaReplies: 3Last Post: 10-30-2012, 04:06 PM
- By soccermiles in forum New To JavaReplies: 18Last Post: 04-20-2010, 04:44 AM
- By trueblue in forum New To JavaReplies: 3Last Post: 05-25-2009, 09:50 PM
- By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 08:35 AM