Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Module 1 - Code Workout - Arrays & Conditionals X44: sum67 X44: sum67 Given an int array, return the sum of the numbers in the

image text in transcribed
image text in transcribed
image text in transcribed
Module 1 - Code Workout - Arrays & Conditionals X44: sum67 X44: sum67 Given an int array, return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7). Return 0 for no numbers. Examples sum67({1, 2, 2)) -> 5 sum67{{1, 6, 2, 2, 73) -> 1 Your Answer: Feedback 1 public int num6 7(int nums) 2 Your feedback will appear here when you check your answer Check my answer! Reset Next exercise X47: without Ten : Given an intl array, write a function that returns an array where all the 10's have been removed. The remaining elements should shift left towards the start of the array as needed, and the empty spaces at the end of the array should be set to 0. So {1, 10, 10, 2} yields {1, 2, 0, 0). You may modify and return the given array or make a new array Examples: without Ten (C1, 10, 10, 2)) -> (1, 2, 0, 0) Your Answer: Feedback 1 public int without Ten(int[nums) 2 { 3 41) 5 0.07 1.0 Your answer could not be processed because it contains errors: Line 13: error: not a statement Module Code Workout - Arrays & Conditionals X45: isEverywhere X45: isEverywhere We'll say that a value is 'everywhere" in an array if for every pair of adjacent elements in the array, at least one of the pair is that value. Return true if the given value is everywhere in the array. Your Answer: Feedback public boolean is everywhere(intl) nums, int val) 2 ( 0.07 1.0 3 Your answer could not be processed becau it contains errors: line 2: error:) expected Check my answer Reset Next exercise

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

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

2. Employees and managers participate in development of the system.

Answered: 1 week ago