Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sammy Samkough
- // Description: To show how not getting caught cheating is synonmous (technically) to not even cheating at all
- public class Cheating
- {
- public Cheating()
- {
- /* no parameters */
- }
- public boolean didYouCheat(boolean ifCheating)
- {
- // if you do cheat
- if(ifCheating == true)
- {
- ifCheating = true;
- }
- // if you don't cheat
- else
- {
- ifCheating = false;
- }
- return ifCheating;
- }
- }
- ----------------------------------------------------------------------------------------------------------------------------------
- // Sammy Samkough
- // Description: To show how not getting caught cheating is synonmous (technically) to not even cheating at all
- public class CheatingRunner
- {
- public static void main(String args[])
- {
- Cheating c = new Cheating();
- String story = "";
- boolean cheat;
- story = "A student is taking a test. A student cheats on the test by looking at someone else's paper, " +
- "but no one saw him. No teacher, no other student, nothing. He got the good grade a week later, it was " +
- "an A. Now, since no one saw him, did he still cheat?";
- System.out.println(story);
- cheat = false;
- System.out.println("Did the person cheat?" + cheat);
- System.out.println(c.didYouCheat(cheat));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement