Question: Hello I program this java project. I've got the below one. Please help me fix it and complete the requirements below. It needs separate class

Hello I program this java project. I've got the below one. Please help me fix it and complete the requirements below. It needs separate class in different files so please bold the class names. And please show copy of some outputs. Thank you so much!!!!

Hello I program this java project. I've got the below one. Pleasehelp me fix it and complete the requirements below. It needs separateclass in different files so please bold the class names. And please

Main.Java

import java.util.Random; public class Main {

public static final int NB_ELEMENTS = 5-- public static void main(String[] args) { int numbers[] = new int[NB_ELEMENTS]; Random randomNumberGenerator = new Random(); System.out.println("ProgramAAH commencing execution." + " "); randomNumberGenerator.setSeed(2); UtilityMethods.FillArrayInt(numbers,randomNumberGenerator); UtilityMethods.OutputArrayToConsole(numbers); UtilityMethods.PrintMaxElement(numbers); UtilityMethods.PrintNbofMaxElements(numbers); System.out.println("ProgramAAH terminating execution" + " "); } // Method main() }// Class Main{}

UtilityMethods.Java import java.util.Random; public class UtilityMethods { public static final int MAX_NUMBER = 1000; public static final int NB_NBS_PER_LINE = 15; public static void FillArrayInt( int array[], Random ranNumGen) { for (int ii=0, ii= MAX_NUMBER/3) array[ii] =array[ii]/3; } } public static int MaxArrayElement(int array[]) { int ii, maxElement; maxElement = array[0]; ii = 1; while(ii maxElement) maxElement = array[ii]; ii++ } return maxElement; } public static int NumberOfMaxElement(int array[]){ int nbMaxElements = 0; int maxEL = maxArrayElement (array); for(int ii =0; ii" +array.length); System.out.println("Element per line og output ==> " +NB_NBS_PER_LINE); if((n>0))&&(n9)&&(n0&&(ii%NB_NBS_PER_LINE==0)) System.out.println(" "); } public static void PrintMaxElement(int array[]){ int maxEl = MaxArrayElement(array); System.out.print(" "); System.out.println("======="); System.out.println("The largest element in this array ==> " +maxEl); System.out.println("============================================="); System.out.println(" "); } public static void PrintNbofMaxElements(int array[]){ int maxElement = MaxArrayElement(array); System.out.print("==============="); System.out.println("===="); System.out.print("The number of times" + maxElement + "appears"); System.out.println("in the array is ==> " + nbOfMaxElements); System.out.print("========================================"); System.out.println("============"); System.out.println(" "); } // Method PrintNbOfMaxElements() } // Static Class UtilityMethods{} }

1. Code for yourself ProgramAAH and execute it. Make sure, as a test, that it produces the same output as shown in Listing 3.19. With program ProgramAAH functioning as it should, then springboard from this working baseline and complete the rest of Programming Assignment 7, which is the next item. 2. Design and implement the necessary methods so that ProgramAAH also does for the minimum values in the array that it now does for the maximum values. That is, the computer, as it executes the program, also outputs what the minimum array element value is along with how many times that element appears in the array. The methods that you implement should be coded in the UtilityMethods class. 1 ProgramAAH commencing execution. 2 3 4 The array is one dimensional. 101 5 13 5 Number of elements in the array ==> 500 6 Elements per line of output ==> 15 7 8 9 183 327 130 151 179 257 189 311 26 218 247 185 319 143 56 10 219 247 254 117 238 217 256 255 1991 308 273 165 214 103 11 186 285 79 289 333 283 132 121 172 231 249 154 174 253 12 315 166 217 132 212 233 330 331 191 204 321 177 159 119 127 13 186 131 150 305 304 305 251 305 135 320 305 238 1 252 247 14 208 314 262 203 119 173 299 230 258 158 310 87 128 306 70 15 257 298 165 318 200 310 300 162 270 248 185 218 183 205 210 16 84 114 173 240 134 183 229 166 205 97 329 327 209 313 255 17 61 160 255 10 61 267 18 242 248 155 231 230 303 213 118 18 56 302 209 155 255 300 201 121 202 78 114 153 114 3 192 19 221 10 293 223 253 322 48 135 248 231 203 217 329 122 38 20 45 192 53 150 123 290 285 297 313 99196 2 254 120 131 21 173 244 190 260 139 79 18 134 246 178 161 309 328 234 161 22 290 220 192 29 131 181 160 320 230 283 122 241 20 241 177 23 205 276 127 224 248 171 122 176 315 207 208 32 35 139 228 24 303 280 300 164 225 223 175 307 175 198 27 18 238 249 77 25 121 331 37 108 245 222 265 116 280 307 270 22 200 169 216 26 263 185 258 183 124 142 202 256 183 293 303 107 275 275 159 27 281 285 238 310 281 268 285 326 200 238 197 196 154 198 187 28 319 172 314 216 188 298 153 309 221 64 127 264 140 155 262 29 209 330 133 266 202 257 101 221 203 286 285 136 322 266 119 30 305 137 300 212 328 185 156 237 135 273 245 250 146 220 291 31 293 238 202 255 114 176 288 305 211 249 229 210 298 275 314 32 194 128 23 292 304 118 170 224 242 285 245 25 264 321 141 33 299 302 167 77 100 227 94 53 261 333 303 13 231 130 216 34 216 158 279 147 198 209152199 139 247 320 209 209 323 168 35 81 113 73 149 330 160 137 260 240 179 185 285 103 181 88 36 153 330 189 263 84 177 136 308 319 302 201 211 269 203 282 37 317 327 159 149 328 113 214 137 196 223 26 330 280 314 132 38 115 255 252 237 117 330 273 300 292 59 299 324 332 261 300 39 136 161 325 330 263 41 179 174 317 200 313 310 306 123 40 289 224 149 244 236 154 247 183 269 118 185 122 281 269330 41 324 302 73 206 173 247 172 257 139 301 292 264 153 206 198 42 276 135 252 187 110 43 44 The largest element in the array ==> 333 46 47 48 The number of times 333 appears in the array is ==> 2 50 51 52 ProgramAAH terminating execution. 45 49

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!