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

 

gaurav.gupta@mq.edu.au arrays > tayTayRevenue
prev  |  next  |  chance

Taylor Swift is coming to Australia (Eeeeeeeee!!!) and has concerts in Sydney and Melbourne. The ticket prices are stored in an array named tayTay1 and the corresponding number of tickets sold are stored in an array named tayTay2. Define a function that when passed these two arrays, returns the total $$$ Tay Tay generated. You can assume the two arrays are of the same length.


tayTayRevenue([10, 20], [3000, 2000]) → 70000
tayTayRevenue([79, 99, 139, 159, 199, 239, 309, 399], [1000000, 500000, 200000, 100000, 50000, 20000, 10000, 5000]) → 192015000
tayTayRevenue([1], [100000]) → 100000

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

int tayTayRevenue(int[] tayTay1, int[] tayTay2) { }

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: 3 Post-solution available

Copyright Nick Parlante 2017 - privacy