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

 

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

Write a method that accepts two strings of ANY length. These strings represent non-negative integers. Return a string that represents the sum of these two integers. You may NOT use ANY string methods except: .length, .charAt, .substring, .equals. You may NOT use any Math class methods. You may NOT use List or ArrayList. As a precondition you may assume that 'num1' and 'num2' will only contain the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Look at the test data!


quiz2022_03_23_HL_add("8147201240023523593589353529000124901241240350235023523502350359897090", "92420000346000346000897128497802400") → "8147201240023523593589353529000124993661240696235369524399478857699490"
quiz2022_03_23_HL_add("9000", "124000000000000000") → "124000000000009000"
quiz2022_03_23_HL_add("412", "380") → "792"

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

public String quiz2022_03_23_HL_add(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: 250

Copyright Nick Parlante 2017 - privacy