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

 

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

Write a method that accepts an integer that represents the binary encoding of nitrogenous bases in RNA. These bases are encoded according to the following scheme: binary 00='U', binary 01='C', binary 10='A', and binary 11='G'. Return the correct character (U, C, A, or G) based on the value of the input parameter. If an invalid integer is passed in (not equivalent to binary 00, 01, 10, or 11) return an 'X' as an error code.


getRNA(2) → "A"
getRNA(1) → "C"
getRNA(5) → "X"

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

public char getRNA(int encoding) { }

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

Copyright Nick Parlante 2017 - privacy