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

 

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

Write a method that accepts a string "AND" or "OR" to indicate which logic operation to use, and a string of "T" or "F" characters in any order. Return a string of "T" and "F" characters indicating the result of repeated "AND" or "OR"-ing of the truth values. For example, if the operation is "AND" and the other input parameter is "TTTFTFTTF", the result will be "TTTFFFFFF". Look at the test data for further examples.


bbb2truthSoFar("AND", "TFTFT") → "TFFFF"
bbb2truthSoFar("OR", "TFTFT") → "TTTTT"
bbb2truthSoFar("AND", "TTTFTTFFTF") → "TTTFFFFFFF"

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

public String bbb2truthSoFar(String andOr, String tf) { }

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

Copyright Nick Parlante 2017 - privacy