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

 

srp4379@lausd.net > subjectNow
prev  |  next  |  chance

String subjectNow(int day, int period). Your schedule this semester is: P1 "English", P2 "Art", P3 "History", P4 "Math", P5 "Science", P6 "PE". On Mondays, you have all 6 periods. On Tuesdays and Thursdays, you have even-numbered periods. On Wednesdays and Fridays, you have odd-numbered periods. Given a day and a class period 1-6, return which subject you are taking that period. If your class doesn't meet that day, e.g. P5 Tuesday, return "Nope". The day of the week is encoded as 1=Mon, 2=Tue, 3=Wed, 4=Thurs, 5=Fri.


subjectNow(1, 1) → "English"
subjectNow(2, 1) → "Nope"
subjectNow(2, 2) → "Art"

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

String subjectNow(int day, int period) { }

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

Copyright Nick Parlante 2017 - privacy