1
- The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
If you are undoing an edit that is …
You are not logged in.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
If you are undoing an edit that is not vandalism, explain the reason in the edit summary rather than using only the default message.
Line 24: |
Line 24: |
|
|
|
|
|
A program that uses two paragraphs, a [[mane paragraph]] and a utility paragraph, to add all the numbers from 1 to 100: |
|
A program that uses two paragraphs, a [[mane paragraph]] and a utility paragraph, to add all the numbers from 1 to 100: |
− |
{{codeblock|{{code|keyword|Dear}}{{code|whitespace| }}{{code|report|Princess Celestia}}{{code|punctuation|:}}{{code|whitespace| }}{{code|report|I can add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|<STRONG>Today</STRONG> I learned}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|the answer}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|literal|1}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|literal|100}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|variable|the answer}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|to get}}{{code|whitespace| }}{{code|type|a number}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|literal|0}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|As long as}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|operator|was no more than}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|,}}{{code|whitespace|<BR/>}}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|became}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|operator|plus}}{{code|whitespace| }}{{code|variable|first}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|variable|first}}{{code|whitespace| }}{{code|operator|got one more}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|That's what I did}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|Then you get}}{{code|whitespace| }}{{code|variable|sum}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|Your faithful student}}{{code|punctuation|,}}{{code|comment| Kyli Rouge}}{{code|punctuation|.}}}} |
+ |
{{codeblock|{{code|keyword|Dear}}{{code|whitespace| }}{{code|report|Princess Celestia}}{{code|punctuation|:}}{{code|whitespace| }}{{code|report|I can add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|<STRONG>Today</STRONG> I learned}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|the answer}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|literal|1}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|literal|100}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|variable|the answer}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|to get}}{{code|whitespace| }}{{code|type|a number}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|literal|0}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|As long as}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|operator|was no more than}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|,}}{{code|whitespace|<BR/>}}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|became}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|operator|plus}}{{code|whitespace| }}{{code|variable|first}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|variable|first}}{{code|whitespace| }}{{code|operator|got one more}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|That's what I did}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|Your faithful student}}{{code|punctuation|,}}{{code|comment| Kyli Rouge}}{{code|punctuation|.}}}} |
|
|
|
|
|
=== Mirror in Java === |
|
=== Mirror in Java === |
Line 51: |
Line 51: |
|
first++; |
|
first++; |
|
} |
|
} |
− |
return sum; |
|
|
} |
|
} |
|
} |
|
} |