mirror of
https://github.com/RustyRaptor/Programs.git
synced 2026-12-03 15:45:21 -07:00
refactored comments
This commit is contained in:
1 parent
a9f4d97256
commit
b6b9e4ca20
1 file changed
+4
-4
@@ -37,7 +37,7 @@ public class RacingScore2
|
||||
public int overallScore()
|
||||
{
|
||||
int s, s1, s2;
|
||||
// error make all enequalites or equal to
|
||||
// error make all the branches OR EQUAL TO
|
||||
if (score1 < score2 && score1 < score3)
|
||||
{
|
||||
s1 = score2;
|
||||
@@ -57,7 +57,7 @@ public class RacingScore2
|
||||
{
|
||||
s1 = 99;
|
||||
s2 = 99;
|
||||
} // error
|
||||
} // error no need for this else branch
|
||||
s = s1 + s2;
|
||||
return s;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class RacingScore2
|
||||
public static void main(String args[])
|
||||
{
|
||||
int s1, s2, s3;
|
||||
if (args == null || args.length != 3) // null can't be passed
|
||||
if (args == null || args.length != 3) // null can't be passed so no need
|
||||
{
|
||||
System.err.println("Error: must supply three arguments!");
|
||||
return;
|
||||
@@ -82,7 +82,7 @@ public class RacingScore2
|
||||
return;
|
||||
}
|
||||
if (s1 < 0 || s1 > 50 || s2 < 0 || s2 > 50 || s3 < 0 || s3 > 50)
|
||||
// break into conditional for each variable
|
||||
// break into a separate branch for each score check rather than one giant OR check
|
||||
{
|
||||
System.err.println("Error: scores must be between 0 and 50!");
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user