Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

S My library > IFT 2 1 0 : Introduction to Java Technologies home > 6 . 1 0 : Array parameters zyBooks catalog Jump

S My library > IFT 210: Introduction to Java Technologies home >6.10: Array parameters
zyBooks catalog
Jump to level 1
Six integers are read from input and stored into the array arrayToModify. Then, numCompare is read from input. Write a static method modifyArray() that takes an integer array parameter and an integer parameter. For each element in the array, if the element is greater than or equal to the integer parameter, then replace the element with 1. Otherwise, replace the element with -1. Ex: If the input is:
\table[[50,95,60,30,70,35],[56,,,,,]]
then the output is:
]):}
[ New array: -1,1,1,-1,1,-1
import java.util.Scanner;
public class ArrayMethods {
Y* Your code goes here */
public static void printarr(int[] arr){
int i;
for (i=0; i arr. length; ++i){
System.out.print(arr[i]+"");
}
System.out.println();
}
public static votd main(String[] args){
1
2
image text in transcribed

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

Step: 3

blur-text-image

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago