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)

https://storage.googleapis.com/replit/images/1535408572037_404788597228c5d6ac099237e9cd53a9.pn
https://storage.googleapis.com/replit/images/1535408599325_58344f4c26485eabfa4114e191e0840b.pn

Answered by JoshDaBosh (82) [earned 5 cycles]
View Answer
Comments
hotnewtop
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)

@mnp https://repl.it/@JoshDaBosh/some-example
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 https://essaysservice.com/methodology-chapter-for-a-dissertation.html

Conyjohn (0)

Very valuable information on a Wikipedia writing agency that can help us in saving time https://www.expertwriters.co.uk/writing/assignment

AlexJuvion (1)

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