Concept explainers
Show the output of the following code:
int[] list1 = {2 , 4 , 7 , 10};
java. util .Arrays. fill (1 ist1, 7);
System.out.println(java.util .Arrays.toString(list1));
int[] list2 = {2 , 4 , 7 , 10};
System.out.println{java.util .Arrays.toString{list2));
System.out.print(java.util.Arrays.equals (list 1 , list2));
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version Plus MyProgrammingLab with Pearson EText -- Access Card Package
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with C++: Early Objects
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Computer Science: An Overview (12th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Problem Solving with C++ (10th Edition)
- 6. Show the printout of the following code: public class ArraysBasic { public static void main(String[] args) { int A[] = {1, 2, 3}; } System.out.println("array A: " + A[0] +""+A[1]+""+ A[2]); System.out.println("array B: " + A[0] + " " + A[1] + " " + A[2]); zeroArray(A); A = new int[5]; System.out.println("array C: " + A[0] + " " + A[1] + " " + A[3] + " " + A[4]); } } public static void zeroArray(int[] list) { for (int j = 0; j < list.length; ++j) { list[j] = 99;arrow_forward#include using namespace std; int main() (double degree [6] [2] = {30,40,10,70, 20, 30, 60, 70, 30, 10, 10, 85); int buffer=degree[0][0]; for (int i=1;ibuffer) buffer=degree[i][0]; cout using namespace std; int main() { int j=1; while (j<=10) if ((j%3)==0) cout<arrow_forward#include using namespace std; int main() (double degree [6] [2]= (30,40,10,70, 20, 30, 60, 70, 30, 10, 10, 85); int buffer=degree[0][0]; for (int i=1;ibuffer) buffer=degree[i][0]; cout<arrow_forward#include for(int i = 0; i { int main() for(int j = 0; j< 2; j++) { { int matrix[2][2] = { printf(" %d", matrix[i][j]); } {2,3,}, //rowo printf("\n"); } {5,7}//row1 getch(); }; } printf("\n Resultant \n"); Try to execute, screenshot the resul and try to explain the sequence of the program. Post it in space-ners provided. FRAMEWORK HTPE ADACHE e OrcE outATION roR TECHO A LEarrow_forward#include <stdio.h>int counter=0;int size;void deleteNumber(int array[],int index);void insertNumber(int array[],int index,int value);void insertIntelligently(int array[],int number);void insertByvalue(int array[]);void deleteByrange(int array[]);void search(int array[]);void ascendingOrder(int array[]);void descendingOrder(int array[]);void replace(int array[]);void printArray(int array[]);int main() {int array[size], choice, i;printf("Enter size of the array");scanf("%d", &size);for (i = 0; i < size; i++) {printf("Enter the value for Index %d: ", i);scanf("%d", &array[i]);printf("\n");counter++;printf("%d", counter);}printArray(array);printf("\nCounter is: %d \n", counter);printf("\n");while (choice != 9) {printf("\n\nPress '1' to Insert by Index and Value \nPress '2' to Delete \nPress '3' to Insert by Value\nPress '4' to Delete By Range\nPress '5' to replace a value\nPress '6' to search a number\nPress '7' to print in ascending order\nPress '8' to print in descending…arrow_forwardRequired code in javaarrow_forwardIn C++ whats the answer from below ? int size = 10; for ( int i = -1; i < size ; i++) { arr[size - i] = i; } This array: has 12 positions is out of bounds has 10 positions has 11 positionsarrow_forwardpublic int[] bubbleSort(int[] array) {int n = array.length;int temp = 0;}arrow_forwardThis C++ program keeps giving me the wrong median. #include <iostream> using namespace std; double median_value(int* arrptr, int n); class Median { private: int* array; int n; public: void getSizeArray(); void getNumElements(); void displayMedian(); ~Median() { delete[] array; } }; void Median::getSizeArray() { cout << "How big is array?"; cin >> n; } void Median::getNumElements() { array = new int[20]; for (int i = 0; i < n; i++) { cout << "How much "; cin >> *(array + i); } } void Median::displayMedian() { int m = median_value(array, n); cout << m; } int main() { Median showMedian; showMedian.getSizeArray(); showMedian.getNumElements(); showMedian.displayMedian(); return 0; } double median_value(int* arrptr, int n) { double median; if (n % 2 == 0) { median = (*(arrptr + (n / 2)) + *(arrptr + (n / 2 +1))) / 2; } else { //(arrptr[i]+(n/2)) median = *(arrptr + (n / 2)); } return median; }arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_iosRecommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning