A simple java program to calculate numbers 1 to 200 and display the result
1. The program should operate in such a way that two classes and two custom methods are used withsame package.
2. One of the methods should have return type while the other should not.
1
Expert's answer
2012-04-13T11:52:53-0400
package calculatenumbers;
public class Main { private static int sum=0; public static void main(String[] args) { System.out.println("Calculate numbers = "+calculatenumbers()); }
private static int calculatenumbers(){ for(int i=1;i<=200;i++){ sum+=i; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment