id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > quiz2023_12_13_APP1SLHL_combineProduct
prev  |  next  |  chance

Write a method that accepts two identical length arrays of integers 'nums1' and 'nums2' and returns a new array that contains the PRODUCT of the corresponding elements of those arrays. What this means is that the i-th element of the resulting array is the product of the i-th element in 'nums1' and the i-th element in 'nums2'. Preconditions: You may assume that 'nums1' and 'nums2' are the same length (which could be zero). Look at the test data for examples.


quiz2023_12_13_APP1SLHL_combineProduct([4], [5]) → [20]
quiz2023_12_13_APP1SLHL_combineProduct([-3], [2]) → [-6]
quiz2023_12_13_APP1SLHL_combineProduct([40, 0, 18], [0, 17, 0]) → [0, 0, 0]

...Save, Compile, Run (ctrl-enter)

public int[] quiz2023_12_13_APP1SLHL_combineProduct(int[] nums1, int[] nums2) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 250

Copyright Nick Parlante 2017 - privacy