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

 

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

Write a method that accepts an array containing an even number of integers. Each pair of integers indicates the dimensions (in feet) of a room in an office. The area of each of these rooms can be found by finding the product of the dimensions since each room is rectangular. Return the total area of the office indicated by the array of room dimensions. For example: {8, 10, 12, 20} indicates an office with an 8 by 10 room (80 square feet) and a 12 by 20 room (240 square feet). The total area of this office is 320 square feet, so you would return 320.


sizeOffice([18, 14, 22, 36]) → 1044
sizeOffice([12, 15, 55, 30, 31, 20, 40, 16, 30, 18, 22, 19, 12, 15]) → 4228
sizeOffice([40, 10]) → 400

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

public int sizeOffice(int[] sizes) { }

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: 290

Copyright Nick Parlante 2017 - privacy