COMPSCI 121 Midterm: COMPSCI121 Term Test 2 2017 Spring Practice Solutions

168 views5 pages
26 Oct 2018
Professor

Document Summary

Write the method body (the method signature is provided) for the printsumeven method below. The method prints the sum of all of the even numbers in an array of integers. For example, if this was the data in the array inputarr: 1, 6, 7, 2, 7, 3, 9, 3, 8, 5, 4 your code would print: Remember, your code must work for any values that might be in inputarr, not just the example given above. Enter your method body code below. ( 10 pts. ) public void printsumeven (int[] inputarr){ int sum=0; int index=0; while(index

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions