Question: Phase 1 - Numbers (15 points) Below is a simple form. Type your email address in the box, and press the submit button. This will

Phase 1 - Numbers (15 points)

Below is a simple form. Type your email address in the box, and press the submit button. This will produce the name of an array, the name of an input file, the name of an output file, and a list of integer numbers. The first number in this list will be an exact count of the remaining numbers in the list. So if the first number in the list is 500, there will be 500 additional numbers in the list. Copy and paste the number data, including the count, into a plain text file with the name of the input file that is given. Your objective in this phase is to write a console program which does all of the following: Open and read the first line of the input file (refer to sections 12.10, 12.11 in the textbook), then create an integer array with the name of the array given and a size to match the first line of the file. So if the first line of the file contains 500, the array will have 500 "slots". Read the remaining numbers into the array. After reading the remaining numbers into the array, pass the array to a method named sort, which takes the array as a parameter, and sorts it from low to high. Use the selectionSort method on page 272 of the textbook, just be sure to change the name of the method to sort.

When the sort is complete, open and write a file (refer to section 12.11, "File Input and Output" in the textbook) with the name of the output file, output the count to the file first, followed by the sorted list of numbers (one per line). Finally, use a simple loop to compute sum of all the scores in the array. After computing the sum, compute the average of the numbers in the array (not including the count). Output this average as the last line of the output file. Be sure to use a double data type for the sum and average variables.

Your information for this project is:

The array name is numbers

The input file name is numdata.txt

The output file name is numDataOut.txt

This is just simple test data, get your program working with this data before trying the larger data set.

12

3991

10507

3982

7891

3213

9616

4937

11496

6441

8093

11307

6726

900

10150

3888

2158

11465

5748

510

8843

10154

1010

1643

2890

1559

3637

524

11441

5890

9138

10949

2017

5498

977

514

10769

4474

11860

8915

8702

5473

2454

3481

5768

5445

929

10504

9410

10462

909

9275

4814

4360

8965

9959

6253

1089

5480

980

2466

9785

3325

3118

10165

9957

11406

6633

3661

8291

11129

11790

5567

10863

3324

7762

3959

6878

3265

2038

11783

8929

3646

6711

5165

4912

1422

359

3331

8366

2399

5199

8111

7901

2472

2293

7411

3545

712

11054

941

2142

3895

7024

7855

5121

3890

1176

1090

11826

5617

917

9797

3843

5050

5579

2072

1652

10831

1279

8472

1477

11133

3031

1938

8061

8998

11328

11956

6933

5313

9251

268

8633

10959

2758

2103

7483

5999

10083

10744

9776

8802

2501

11090

4679

10687

2302

3771

4242

3954

10798

9801

2072

7458

7453

2207

2258

11699

265

8257

10561

5360

8291

7681

9577

6853

7567

11035

3556

6498

6881

9482

6635

7555

11684

10020

10458

1406

1412

5435

3599

4552

11170

3166

346

10258

7942

601

3967

4132

11143

4455

914

10229

6556

4927

10277

1097

4689

3621

1544

5691

4764

2128

10601

7671

3110

7042

2639

2412

2930

5249

7677

9481

905

5932

11398

6902

4567

4

7387

10579

5917

6133

9315

9677

5658

8347

7874

6144

10816

4069

5454

10910

10156

7011

3561

9731

1947

11266

11594

1954

11009

10517

4898

10544

11829

5397

5127

1150

9863

5527

1380

25

3792

2212

388

7928

9259

7834

3353

7345

3887

9340

3570

3624

3324

9789

10710

9083

497

3554

3418

11230

4194

7780

7079

10117

5366

2753

8573

2037

1752

11682

11677

9091

992

1914

5104

6331

8612

11499

11064

6144

2531

978

6736

4929

199

4769

5848

6963

10088

7009

5898

11292

10097

1536

7328

1671

1313

8132

8348

2715

2622

3313

3313

3112

6237

5373

9936

8014

4815

10585

6832

4769

4210

1460

8986

4228

5412

11199

3274

10992

7042

9815

1

8288

4010

4474

6085

6099

11516

4720

10788

8762

4376

8738

2835

8649

282

4908

7524

10021

11712

3488

5618

10261

9178

1118

3360

9397

5750

3204

4794

4695

9198

10488

7843

840

4768

6440

5364

5839

1402

6190

655

9813

6605

5857

10394

1252

8725

5085

7717

1521

9978

6923

2192

5775

10143

10703

1097

1035

456

8875

11672

9034

2038

8870

7012

572

5174

4430

10785

4617

3458

6005

141

6893

6618

2763

11478

5878

4364

6812

10048

7463

10790

848

10585

7036

6018

7352

9705

8279

2175

3981

9611

5117

5588

1467

2931

2768

1685

4694

5504

6515

2761

9764

10958

1902

1376

6578

5936

5296

11070

11961

3323

9084

634

5995

11163

8036

3182

8298

11492

10936

4352

4451

3373

8029

7371

5563

8540

1594

5355

4428

6254

2289

5997

7622

9531

3407

9382

6457

10519

8322

4990

642

6607

6219

9694

1289

7499

3011

5486

5490

3755

2903

10929

411

161

7169

2629

2102

4283

4393

1896

8541

650

11232

10881

10960

5875

3875

11561

2220

9169

4983

4433

6059

182

11171

11606

2411

5127

4595

1004

10056

9799

7680

8606

5110

595

9700

9147

9223

8929

9332

6464

6123

3691

2628

6524

6746

7944

4381

8544

5723

5569

7067

5145

9352

6481

5011

3985

6895

5277

10966

805

4610

4694

9658

1303

4304

1481

1939

11172

11912

1157

11581

10596

6689

7390

7001

3912

5271

5504

3093

9937

1669

2889

6152

3787

11457

1427

7445

2998

10298

11086

769

10313

297

3501

10964

10508

417

7991

7645

2068

2013

10827

1616

6580

3677

8667

4727

4876

5893

8592

2423

9271

4190

9666

2774

9864

3745

27

6223

9357

9898

3360

10287

144

1040

7165

2514

9843

6729

2157

8443

5744

1921

1352

2574

6153

211

5110

11013

1103

10646

1602

1983

2773

9572

10006

9782

268

3153

9275

9563

3250

1484

616

537

3582

6047

11462

46

6694

8064

609

7385

9424

2822

8061

5308

4026

2540

6962

7741

4681

158

10290

4114

316

9021

5187

10059

4197

7310

2936

2240

4131

1452

11651

2296

1137

5211

3886

8887

2977

4748

2688

3124

5380

571

1941

7135

2522

10510

1401

6624

5283

7718

10908

9382

5473

1975

5513

5783

10221

4159

9589

8400

4505

2202

203

5277

5941

2668

8476

1569

2891

11404

4124

7731

6874

1205

5498

4097

4649

6710

3515

3687

7416

7473

10095

9214

3521

10919

2512

3182

5541

7808

2664

5664

5444

1171

1701

5445

381

6526

9987

42

9204

8524

8820

10744

3342

142

8554

7472

6730

7187

8664

11150

5682

9945

8487

8463

11761

1278

5631

1056

5794

9874

9746

505

2401

2168

4526

9569

9407

11598

18

2524

6064

1149

1185

2400

6953

5186

40

3131

3103

11886

2821

7226

7978

532

9816

7627

46

9640

11961

4202

4438

11586

7771

6669

50

10834

11411

1103

10220

10814

1453

554

9177

2159

8890

10424

10037

355

10477

10557

2556

2389

6897

5306

9819

11245

11588

2146

2356

2035

975

4987

1288

2681

2366

3080

6399

739

10754

6828

8128

2945

7221

10761

6948

7897

16

4409

9853

1686

8903

10232

547

2451

10106

6923

4621

771

7959

3721

6496

10327

7164

2034

624

5282

5442

6882

10120

9910

11179

4934

10306

7625

4482

7027

1939

999

10338

1303

4406

7872

1677

8622

8577

9487

3380

5452

6476

11038

309

4807

7136

10863

8616

11504

7507

567

4640

6463

6060

2571

1725

10576

6986

991

6879

8713

10389

1558

6075

7417

10179

11274

3093

Phase 2 - Strings (15 points)

Below is a simple form. Place your email address in the box, and press the submit button. This will produce the name of an array, the name of an input file, the name of an output file, and a list of Strings. The first item in this list will be a number that represents an exact count of the remaining Strings in the list. So if the first item in the list is the number 200, there will be 200 additional Strings in the list. Copy and paste the String data, including the count into a plain text file with the name of the input file that is given. Your objective in this phase is to write a console program which does all of the following: Open and read the first line of the input file (refer to sections 12.10, 12.11 in the textbook)and create a String array with the name of the array given and a size to match the first line of the file. So if the first line of the file contains 200, the array will have 200 "slots". Read the remaining Strings into the array using the Scanner nextLine() method. After all of the remaining Strings have been read from the imput file into the array, pass the array to a method named sortStrings, which takes the array as a parameter and sorts it from low to high. You are permitted to use the java.util.Arrays.sort() method, just be sure to invoke java.util.Arrays.sort() from inside a method named sortStrings. When the sort is complete, open and write a file (refer to section 12.11 "File Input and Output" in the textbook) with the name of the output file, output the count to the output file first, followed by the sorted list of Strings (one per line). Finally, output the String in the middle of the array as the last line of the output file. So if there are 11 "slots" in the array, the middle item will be in "slot" 5 of the sorted array. If there are an even number of "slots" take the lower "slot" number. So if there are 10 "slots" in the array, the middle item will be in "slot" 4 of the sorted array.

Project 5 Phase II Your information for this project is:

The array name is strings

The input file name is strData.txt

The output file name is strDataOut.txt

This is just simple test data, get your program working with this data before trying the larger data set.

12 Kerry, Sandy Y Nicolas, Micky V Dominic, Cece P Donald, Ophela T Danella, Tammie F Darcy, Jack M Alecson, Alec N Clifford, Daniel B Jack, Jerry S Pauline, Joe Z Zilly, Nancy W Christian, Don X

300 Candy, Will L Jackson, Paula R Pauline, Dianne I Georgia, Austin H Zilly, Samuel D Cynthia, Sandy Y Franks, Jerry S Leroy, Otto T Clifford, Benjamin I Oscar, Vinny U Nancy, Alec N Sally, Georgia A Pauline, Paula H Evens, Colin F Vincent, Usher Y Urma, Marge W Sally, Ophela L Oscar, Elroy E Danella, Nan Y Robbie, Sam Z Oscar, George A Pete, Otto O Fredricks, Kane H Darcy, Benjamin E Nick, Kane V Margaret, Sam Z Barney, Sammy Q Fiona, Urma T Unger, Vin Q Sams, Samuel D Mickie, Sal G Kim, Theodore H Robby, Henry D Elaine, Ralene Q Robby, Liz E Zilly, Icabod U Zilly, Dom E Zilly, Charles M Crawford, Will L Nicolas, Ronny G Austin, Tammie G Charles, Sindy U Oscar, Ophela T Austin, Sammy D Irving, Pete E Zilly, Dom V Austin, Dom V Oscar, Joeseph A Icabod, Larry N Bracken, Will F Will, Cindy D Samual, Jack O Margaret, Dodo P Nicolas, Vinny I Oprah, Karry C Pauline, Dianne I Nicolas, Icabod U Franks, Dan W Robby, Joeseph A Icabod, Peter M Aliceman, Robby G Yancey, Nikko I Oscar, Linda I Darcy, Kane H Nancy, Ralene Q Colins, Tammie G Ice, Kane V Penny, Ophela T Habib, Sindy U Charles, Ralene N Wilson, Oprah R Harold, Icabod U Ulysiss, Lisa Y Toms , Don Y Unger, Allyssa F Edwards, Cece P Darcy, Nikko I Colins, Elroy K Jack, Peter M Alexstein, Usher Y Georgia, Ophela T Robby, Joeseph A Bebe, Nick J Darcy, Al Y Harold, Marge W Cynthia, Ottaman S Pauline, Otto O Nan, Theodore B Beatrice, Dom E Alexstein, Rory I Joey, Wilson Q Robbie, Wilson Y Darcy, Elroy W Barney, Joe Z Ulysiss, Dodo U Oscar, Vin Q Cane, Micky B Alexander, Paul I Alton, Sam Z Evens, Tammie G Fredricks, Joeseph A Zed, Kane C Elaine, Robby G Mick, Sam Z Geoff, Ed O Toms , Don Y Holly, Henrietta T Oprah, Joey O George, Colin Y Lawrence, Thomas G Jack, Vin N Margaret, Quincy K Brett, Will L Paul, Brett O Candy, Elroy K Brett, Wilson Y Joey, Kelly T Austin, Brett N Joey, Wilma B Elaine, Sam Z Bracken, Wilson Y Austin, Marge W Vincent, Joeseph A Bebe, Sal G Paul, Benjamin E Margaret, Cece T Joey, Clifford G Fredricks, Allen M Mickie, Ottaman G Kim, Nikko I Jack, Vinny Y Henrietta, Nick J Margaret, Hal L Pete, Sal H Candy, Cynthia X Edwards, Henry D Evens, Ralene Q Geoff, Vinny I Marge, Sal G Usher, Kane Z Samual, Linda I Darcy, Usher J Alton, Don Z Ophela, Marge W Zilly, Jo S Pete, Vin Q Peters, Betty C Barney, Charles D Victor, Beatrice Y Ottaman, Theodore B Aliceman, Minnie V Jack, Ottaman S Izzy, Franklin P Vinny, Yancey Q Donald, Ophela L Alexander, Mick Y Geoff, Paula H Pauline, Darcy W Ulysiss, Robby B Icabod, Theodore V Nancy, George W Ice, Colin F Robby, Vinny I Zilly, Elroy R Pete, Vinny B Urma, Leroy P Robby, Kim I Xavier, Wilma W Nan, Don Z Jack, Yancey D Barney, Victor V Yancey, Ophela L Cane, Henry E Jack, Ronny Y Bracken, Sal L Victor, Ophela T Fredricks, Holly E Habib, Daniel B Beatrice, Nikko Y Penny, Paul U Geoff, Cinthia G Holly, Danella K Beatrice, Charles D Beatrice, Theodore H Nan, Fred F Robby, Hal L Elaine, Holly D Xavier, Elroy R Nan, Icabod U Ice, Ophela L Nicolas, Micky W Peters, Wilma B Pauline, Geo G Xavier, Penny Y Leroy, Henry E Dedra, Henry E Alexander, Ronny P Xavier, Ted Y Pete, Robby G Toms , Micky W Mickie, Cece Q Charles, Pete E Will, Dom E Christian, Nikko I Ulysiss, Sal H Dedra, Micky V Leroy, Al Y Penny, Paul I Pauline, Lisa Y Jackson, Sandra A Ulysiss, Nikko Y Elroy, Zed Z Dominic, Elroy K Barney, Winifred K Harold, Don X Cynthia, Sal G Ulysiss, Geo G Donald, Sandy Y Kim, Sal H Mickie, Wilma B Jack, Theodore A George, Franklin P Kim, Harry G Will, Brett O Alecson, Lisa Y Toms , Sindy U Ulysiss, Theodore A Habib, Ophela T Victor, Sam Z Joey, Urma T Peters, Karry C Henrietta, Dodo U Elroy, Vinny B Dedra, Pete E Christian, Harry G Barney, Ronny Y Ice, Georgia N Brett, Ralene Q Kerry, Kane C Izzy, Sindy S Vincent, Dom V Ulysiss, Fred A Kim, Ann V Fiona, Mickie V Berta, Ann V Candy, Thomas G Joey, Edward D Robbie, Harry G Georgia, Victor V Cynthia, Tammie N Oscar, Cynthia R Nan, Jo S Margaret, Vinny I Irving, Danella I Zilly, Ann V Harold, Allyssa G Joey, Sammy Y Zilly, Wilma W Dedra, Abbot V Elaine, Jerry S Christian, Ralene R Elaine, Victor V Jack, Kane Z Samual, Brett O Elroy, Paula D Geoff, Vinny B Candy, Cliff J Ice, Kevin U Elaine, Harry G Donald, Franklin G Colins, Franklin G Bebe, Nicolas S Donald, Theodore B Ottaman, Danella I Sams, Chuck D Darcy, Sandra B Bebe, Didi F Mickie, Victor N Candy, Elaine C Clifford, Colin F Dedra, Sammy Q Henrietta, Paul U Joey, Theodore B Mickie, Dianne I Urma, Cece P Dedra, Theodore B Barney, Nancy K Holly, Wilma W Ice, Len R Nancy, Tammie N Zilly, Cynthia R Oscar, Darcy G Ice, Fredrick Y Xavier, Vinny U Robbie, Robby B Ophela, Ottaman S Nan, Izzy G Mickie, Peter M Penny, Victor E Franklin, Danella X

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!