Question: Write a Java program called InsertPluses.java that determines if +'s can be inserted into a string of digits so that the resulting arithmetic expression
Write a Java program called InsertPluses.java that determines if +'s can be inserted into a string of digits so that the resulting arithmetic expression sums to a given number. The input is a line containing two strings of digits, each of length at most 18. The output is a single line containing either a character string giving an arithmetic expression that evaluates to the second number, or false if there is no such expression. Your output expressions, with the plus signs removed, must match the input string. For example, if the input is 1234 37 then a valid output is 1+2+34 Note that 34+2+1 would be incorrect. If the input is 1234 500 then the correct output is false If the input is 123456789 4248 then a correct output is 1+2+3456+789 Submit your program on Vocareum.
Step by Step Solution
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Java Program import javautilScanner public class InsertPluses ... View full answer
Get step-by-step solutions from verified subject matter experts
