Stephen Carter wrote:I put it at 7. I am still learning. I am taking a College Java course.
Have you covered arrays yet? Because, if so, you could put your 'days of the week' (the names) in a
string array (
String[]); and since Java indexes are 0-based, it will work nicely with your '%' operator.
Another thing: think about writing a few methods to help you out; right now all your logic is crammed into
main(), which isn't generally a good way to work.
Third: You are using
switch statements in some places and '
if' stacks (which should probably be (
if...else if...) in others. The first (lines 20-33) could certainly be changed to use a
switch statement, which might be clearer - but the main point is:
be consistent.
Fourth: Please
DontWriteLongLines; it makes your post very difficult to read. I've broken them up (which unfortunately invalidates your line numbers; the new range is 82-102).
Winston