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

 

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

Write a method that accepts two strings that represent complex numbers. Return a string that represents the sum of those two complex numbers. Note that the complex numbers will be written in the form "a+bi" or "a-bi" where a and b are integers.


addComplex("5+6i", "7-3i") → "12+3i"
addComplex("-5-3i", "-2-7i") → "-7-10i"
addComplex("8+4i", "-8-4i") → "0+0i"

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

public String addComplex(String num1, String num2) { }

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

Copyright Nick Parlante 2017 - privacy