Ask coding questions

← Back to all posts
Need help with a part on a JAVA assignment
mnp (1)

I have the sheet with my assignment attached. I need some help with question 2. I'm not quite sure how to make it go back to 0 once it hits 360. I will try to attach the code I have as well (The second image)

Answered by JoshDaBosh (82) [earned 5 cycles]
View Answer
JoshDaBosh (82)

I'm not sure what you're program is since it just says "Uploading java.docx", etc. but if it's an integer counter then i would suggest using modular operations.

mnp (1)

@JoshDaBosh I just updated it to pictures instead

JoshDaBosh (82)

@mnp this is c/c++ right? just making sure i give correct help for the right language

mnp (1)

@JoshDaBosh I'm sorry this is Java actually

JoshDaBosh (82)

@mnp oof ok, i'll readapt it then

mnp (1)

@JoshDaBosh Thank you! Sorry about that

JoshDaBosh (82)

There's no need to set it back to 0, as you can see in the program.
I've added some extra touches to it to make it look better but the core code is lines 22-25 if you already have preset variables times, amt, and inc.

JoshDaBosh (82)

@mnp if you want it to still use a for loop, just nest the for loop in another for loop which counts the amount of times you want to count to 360. It's essentially the same logic that i used but way longer and complicated.

lindatyler (0)

In such cases, I advise you to turn only to proven professionals who can solve any pressing issue. Personally, I actively collaborate with the best writers

Conyjohn (0)

Very valuable information on a Wikipedia writing agency that can help us in saving time

AlexJuvion (1)

Are you looking for the best assignment experts in UK who help you to complete your academic task -, then feel free and hire experts of Quality Assignment which is leading assignment assistance provider company in UK.