Did you change the values from doubles to ints make them


Questions -

1) Did you download all of the java files and import them into blueJ?

Yes

No

Maybe

2) Did you open up Step2ArrayDeclaration?

Yes

No

Maybe

3) Did you open up Step1STartHere?

Yes

No

Maybe

4) Did you copy over //Declare 2?

Yes

No

Maybe

5) did you change double to int?

Yes

No

Maybe

6) did you change the values from doubles to ints? Make them unsorted

Yes

No

Maybe

7) output the unsorted array using //Declare For Loop 1

Yes

No

Maybe

8) Notice that the for loop has a print inside, so that it is all on one line, and has a System.out.println(); after the for loop to end line

Yes

No

Maybe

9) open up JP8Step4Sort

Yes

No

Maybe

10) copy over //Sort 0, This goes on the top of your code in the import section

Yes

No

Maybe

11) Copy over //Sort 1

Yes

No

Maybe

12) change the array name in 3 locations so that it compiles. Arrays should stay the same as this is the object code you are using to call sort(myArray)

Yes

No

Maybe

13) Copy over //Declare advanced For Loop 1 sorted to output the sorted array

Yes

No

Maybe

14) You will again need to change the array variable name

Yes

No

Maybe

15) tempError should be tempSomethingElse, but not SomethingElse, figure it out. The variable name is a hint

 Yes

No

Maybe

16) Realize that you need to make this output of the sorted array look like the one that is unsorted. Figure it out please :) Remember, you should get a compile error if you are still using myArrayBadName.

Yes

No

Maybe

17) done with end section 1. Run the code and see the result of the int array printing to screen unsorted then sorted

Yes

No

Maybe

18) Copy over //Declare For Loop 5. Notice Declare is Step1.java, please remember this as we are going to be accessing multiple files and each first word depicts which file its from.

Yes

No

Maybe

19) Copy over //Random 1 inside the for loop of previous step. This should delete blue comment.

Yes

No

Maybe

20) Change random1 to randomly change each value of the array, from 5-30. You might want to do #314, #315, and #316 before moving on

Yes

No

Maybe

21) Change the *____+_____ so that it gives a value from 5-30

Yes

No

Maybe

22) delete "int value", replace it with the array of a certain position. You might want to do #313 then #312 in order to do this step. This should make the for loop go and change every value of the array to a random value from 5-30

Yes

No

Maybe

23) when using the = sign, what is on the left gets assigned the value from what is on the right

Yes

No

Maybe

24) copy over //Declare advanced For Loop 2 to output the array to the screen

Yes

No

Maybe

25) you have to change the variables obviously, aka tempHolder, which holds the value of each element of the array and myIntOfBadVariableName, is the array itself

Yes

No

Maybe

26) Create a System.out line to print each value of the array, make sure it is one line outputted and ", " between each value

Yes

No

Maybe

27) Put an end line or two after the loop to separate from other values

Yes

No

Maybe

28) end section 2

Yes

No

Maybe

29) create an int variable and assign it the value 0 at //create a variable tempAdder, I do not give example code for this, you should know how to do this

 Yes

No

Maybe

30) Create an array of type int to hold a running summation of the previous array. In this step you are not actually assigning values to this array just yet. //Declare 1 create a new array to hold a,a+b,a+b+c,a+b+c+d

Yes

No

Maybe

31) when you create the array, make sure you create the array to have the same length as the previous random array

Yes

No

Maybe

32) Change the array variable name to something else

Yes

No

Maybe

33) copy over //Declare For Loop 5

Yes

No

Maybe

34) Use tempAdder variable created in step 45 to store a value used every iteration

Yes

No

Maybe

35) tempAdder=tempAdder+_______;

Yes

No

Maybe

36) realize line in 51 is equivalent to tempAdder+=_________; Have both of these in your code and comment out the code from Step 51

Yes

No

Maybe

37) Make sure that the array that you are using is the random array created from Section 2

Yes

No

Maybe

38) in line 2 of //Declare For Loop 5, it should look like ____________=tempAdder;

Yes

No

Maybe

39) Realize when you have multiple lines of code that need to be ran after a loop, you need { //code //another line of code //even more lines of code } This is already setup for you, don't worry

 Yes

No

Maybe

40) Copy over //Declare advanced For Loop 1 to output the new array

Yes

No

Maybe

41) change the array in the for loop

 Yes

No

Maybe

42) Change tempERROR so that it is not an error

 Yes

No

Maybe

43) output the array with using ", " to separate the values

Yes

No

Maybe

44) Check the output and manually add it to make sure that your code works

Yes

No

Maybe

45) Realize that there are two acceptable ways to do this array, one where you just look at the old values of a,b,c and another way to do the oldArray[0], newArray[0]+oldArray[1], newArray[0]+newArray[1]+oldArray[2],newArray[0]+newArray[1]+newArray[2]+oldArray[3], ... which is much harder. Extra credit if you do the new and old combo along with the old array only way. This harder way will take more lines of code. I will not help with this at all, it is extra credit, do not ask me for help. It will also take another array, and another for loop, dont forget to reset your tempAdder if you do this. Yes I know you don't even need to use tempAdder, no I do not care which way you solve it. Do not let anyone else see your solution, this would be plagiarism on both parties and will be reprimanded. You are responsible for making sure that others do not copy your code.

Yes

No

Maybe

46) End section 3

Yes

No

Maybe

47) we are now going to basically do the same thing as the previous code, except for a,a*b,a*b*c, ... copy over //Declare 1

Yes

No

Maybe

48) steps //56,54,51,49 are going to be combined into one for loop instead of two. Copy over //Declare For Loop 6

Yes

No

Maybe

49) tempHolder no longer exists and you must use something else

Yes

No

Maybe

50) Make sure the array is an array of longs and not ints, as multiplying gets to be big numbers

Yes

No

Maybe

51) you have to change both int's and not just 1

Yes

No

Maybe

52) Update the length of the array to not be 5

Yes

No

Maybe

53) reset the tempAdder variable to a value that will not effect the product above the for loop

Yes

No

Maybe

54) Realize after the 6th or 7th value, they will be negative numbers. Just ignore these values and the ones later. You have now surpassed the length of a long and changed the sign bit.

Yes

No

Maybe

55) You should be able to go about positive array values before you go negative, give or take 2 positions depending on your random values. There is something that is causing data loss, you need to fix this. Figure it out, good luck!

Yes

No

Maybe

56) End section 4

Yes

No

Maybe

57) We should be using the same array created in section two for this section. Read the 9 lines of code to see what is outputted to the screen. We are going to be picking a random value in the original random array. Then, we are going to find that value in the sorted array and output it from the sorted array and not the original random array. Every time you run the program it will pick a different value from the array

Yes

No

Maybe

58) Copy over //Random 1, use this to pick an array position in the original random array to find in the new sorted array

Yes

No

Maybe

59) change value to arrayPositionPicked

Yes

No

Maybe

60) make it a random value from 0 to arrayLength-1

Yes

No

Maybe

61) the variable that you made in step 101 should be named arrayPositionPicked

Yes

No

Maybe

62) Change the array position 0 to arrayPositionPicked so that it outputs to the screen the value at that random array position

Yes

No

Maybe

63) Create a variable of type int and assign it a value of -1 so that you know that something is wrong if you see -1

Yes

No

Maybe

64) assign the value of the element in the array at that random array position to the int variable created in the previous step

Yes

No

Maybe

65) //output the old unsorted array, look at your previous code in order to do this, you should be able to figure out how to do this by now.

 

Yes

No

Maybe

66) copy over declare 1 to create a new array of same length as unsorted array, of type int

Yes

No

Maybe

67) change the array name

Yes

No

Maybe

68) change the array length to arrayLength

Yes

No

Maybe

69) copy over //Declare advanced For Loop 3

Yes

No

Maybe

70) Change the array name in the advanced for loop to the old unsorted random array from section 2

Yes

No

Maybe

71) //assign each value of this array to another array....... This line should be used to take the value of the array in the for loop and assign it it (array from step 108). Realize because it is not a basic for loop you are going to have to create a variable counter and increase it in order to assign a value to a different array.

Yes

No

Maybe

72) It should look something like this ________[_____]=___________;

Yes

No

Maybe

73) create a count variable and declare it before the for loop made in step 111, you need to use this in the line of code above

Yes

No

Maybe

74) x++; is equivalent to x=x+1; and this is your hint to the line of code that should replace //increase a variable by 1

Yes

No

Maybe

75) assign the value stored in the random array at position of the random value created in this section to the variable initialized to -1 in this section.

Yes

No

Maybe

76) If you are still having trouble.... from step 114) ____1____[__2___]=_____3______; 1 is an array. 2 is your counter variable that increases++. 3 is the temp value from the for loop.

Yes

No

Maybe

77) Sort the new array by copying over //Sort 1 and change the array name

Yes

No

Maybe

78) copy over //Sort Compare 1, use a basic for loop to find the value in the sorted array

Yes

No

Maybe

79) change HAHAHAHA yea right;get real;code it to code that will loop through the entire sorted array. This cannot be an advanced for loop

Yes

No

Maybe

80) Change the output to be "You're welcome. I'm going to LET IT GO: "+var

Yes

No

Maybe

81) var should be the value from the new sorted array accessing via the index position of the element in the array

Yes

No

Maybe

82) "output other value" should be outputting the variable declared in the for loop. You must add in a String that tells you what it represents

 Yes

No

Maybe

83) no reference to the old sorted array may be used. No outputting the value from the variable initialized to -1 in this section. Only from the newly sorted array can you access the intended output value

Yes

No

Maybe

84) The /*sweet*/16 value inside the if statement should be the variable that we created to hold the value that was randomly picked in step 117, do #321 If Statements if you have troubles with this if statement

Yes

No

Maybe

85) Output the newly sorted array using either a for loop or an advanced for loop

Yes

No

Maybe

86) End section 5

Yes

No

Maybe

87) //Declare 1 , create a boolean array, not an int array, change int to boolean

Yes

No

Maybe

88) Change the array length to the array length of the other arrays

Yes

No

Maybe

89) Change the name of the array

Yes

No

Maybe

90) copy over //Random 1 to pick a random value from 2-9

 Yes

No

Maybe

91) Change the variable name to divisorNum created in the previous step

Yes

No

Maybe

92) copy over //Declare For Loop 7

Yes

No

Maybe

93) The for loop is used to iterate through every array position of the array you are checking to see if it is divisible or not

Yes

No

Maybe

94) The array we are checking to see if it is divisible or not is the array we just recently sorted

Yes

No

Maybe

95) Make sure that we are iterating through every array position using the value created in the for loop

Yes

No

Maybe

96) inside that for loop there should be an if statement, check #322 Modulus

Yes

No

Maybe

97) the conditional of the if statement should be if the value in the array is divisible by the random number created

Yes

No

Maybe

98) if divisible, set to true, if not, set to false.... ________[___]=true/false;//This is located below the if or else statement

Yes

No

Maybe

99) "it", as in the if statement should look like this if(________[________]%________==________)

Yes

No

Maybe

100) if(AAAA[BBBB]%CCCC==DDDD)//What is AAAA?

array postion

the remainder value that means the number is divisibile

what you are dividing by

the boolean array

Code comments

a can of soda

the sorted int array

instantiation

101) if(AAAA[BBBB]%CCCC==DDDD)//What is BBBB?

a can of soda

the remainder value that means the number is divisibile

the sorted int array

array postion

the boolean array

instantiation

what you are dividing by

Code comments

102) if(AAAA[BBBB]%CCCC==DDDD)//What is CCCC?

the remainder value that means the number is divisibile

a can of soda

what you are dividing by

array postion

the sorted int array

Code comments

instantiation

the boolean array

103) if(AAAA[BBBB]%CCCC==DDDD)//What is DDDD?

 

the boolean array

Code comments

the remainder value that means the number is divisibile

the sorted int array

instantiation

array postion

a can of soda

what you are dividing by

104) You should know what code outputs the array by now. Output the boolean array :) ....boolean not int......

Yes

No

Maybe

105) End Section 6

Yes

No

Maybe

106) copy //Random 1 and create a variable that holds a random value from 5 to 15. This is the length of the short array

Yes

No

Maybe

107) copy //Declare 1 to create a short array of length defined in the previous step

Yes

No

Maybe

108) short is different from int

Yes

No

Maybe

109) this should be of length random value created in step 174

Yes

No

Maybe

110) change the name of the short array

Yes

No

Maybe

111) //assign values to entire short array....... create a basic for loop to loop through the entire short array and randomly assign a value from 1 to 200 to each element. And yes, I am not telling you where the for loop code is, and yes, I am not telling you where to get the random code.

Yes

No

Maybe

112) Remember, dont typecast it to an int, typecast it to a short

Yes

No

Maybe

113) You cannot use shortarray.length in the for loop for the previous step, but it does have to be a variable

Yes

No

Maybe

114) You will run into issues if you use a advanced for loop, so do not do this

Yes

No

Maybe

115) It would be great if you can assign the values and output them in the same for loop

Yes

No

Maybe

116) sort the short array

Yes

No

Maybe

117) output the sorted array

Yes

No

Maybe

118) repeat previous few steps to make a byte array with values from 12-120 of length 16-25, where these are random values... aka //when done copy below to ............ to //when done copy to here

Yes

No

Maybe

119) you are going to need to change all short occurrences to byte

Yes

No

Maybe

120) Remember, the typecasting of short and byte should be for everything on the right not just the Math.random()

Yes

No

Maybe

121) change the random values

Yes

No

Maybe

122) change the array names for each instance

Yes

No

Maybe

123) change the amount of times the for loop is ran

Yes

No

Maybe

124) end section 7

Yes

No

Maybe

125) create a long array of length = the greater length of either short or byte array. to do this....

Yes

No

Maybe

126) check to see which length is greater between the short and byte array, set the long array to this length via that variable

Yes

No

Maybe

127) to do this, you initialize the array without an = sign

Yes

No

Maybe

128) inside the if, you instantiate the array by saying =new long[x];

Yes

No

Maybe

129) this should be an if else

Yes

No

Maybe

130) copy over //Sort Compare 2

Yes

No

Maybe

131) change true to a conditional to check to see which element is larger between the short and byte array

 Yes

No

Maybe

132) you will need to somehow handle the issue of one array is shorter than the other. Once the one array runs out of elements, just assign the values from the longer array. Note that one array is always longer than the other to make programming this easier. BE VERY CAREFUL about who you show your code to. Plagiarism is not allowed. Allowing someone else to look at your code in this section, if they copy it, both parties are doing plagiarism. There are several, several ways to do this.

Yes

No

Maybe

133) the element value of the long array should be outputted in the same for loop

Yes

No

Maybe

134) make sure when you output the arrays you put a println to keep every array on their own line

 Yes

No

Maybe

135) make sure that each section has at least 1 empty line to separate them

Yes

No

Maybe

136) Edit autolayout

 Yes

No

Maybe

137) write pre post summary, name date period, change file name, only submit the one java file

Yes

No

Maybe

Attachment:- Assignment File.rar

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Did you change the values from doubles to ints make them
Reference No:- TGS02704968

Expected delivery within 24 Hours