It's UWAweek 17 (1st semester, week 8)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 93 articles.
Currently 1 other person reading this forum.


 UWA week 10 (1st semester, week 2) ↓
SVG not supported

Login to reply

👍?
helpful
4:06pm Fri 8th Mar, ANONYMOUS

Hello, I have a question regarding how/if I would use Scanner to input different options each time I call the class? Or if there is another way? This is what I wrote for one of the coding bat questions: public class CaughtSpeeding { public static int caugSpee(int speed, boolean isBirthday) { if (isBirthday) speed = speed - 5; if (speed <= 60) return 0; if (speed >= 81) return (2); return (1); } public static void main(String[] args) { int bday = caugSpee(95, true); System.out.println(bday); } } Would I change main and add scanner (or whatever other option) or even just make the whole thing into main (incl 1st method) as a simpler option? Hope this makes sense lol TIA!

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy