Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the answer in Java format 7. (20 points) Write a few lines of code that print all of the numbers in an array

image text in transcribed

I need the answer in Java format

7. (20 points) Write a few lines of code that print all of the numbers in an array named numbers, all on one line. There should be a space, a hyphen, and another space between each pair of numbers, but not before the first number or after the last. If the array contained elements 1, 2, and 3 you would print 1 - 2 - 3. If it contained 4, 5, 6, and 7 you would print 4 - 5 -6 7. Hint: Look back at the textbook section on Fencepost Algorithms. 8. (50 points) Write a main method that makes a copy of a file, except that all numbers in the original file are replaced by the word "REDACTED" in the copy of the file. This only applies to numbers that are their own tokens, not numbers that are part of a larger token. The copy should have line breaks at the same places where the original did, but if the original had extra spaces or tabs anywhere, they may be removed. You may also add an extra space at the end of each line if doing so makes the problem easier for you. The example below will hopefully make this clear

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions