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

 

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

Write a method that accepts a string in the form "a+bi" or "a-bi" where a and b are integers. This string represents a complex number. Return an array with the first number representing the real part and the second number representing the imaginary part.


parseComplex("58+1i") → [58, 1]
parseComplex("-4872-32i") → [-4872, -32]
parseComplex("0+0i") → [0, 0]

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

public int[] parseComplex(String num) { }

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

Copyright Nick Parlante 2017 - privacy