
2.Design and write a program and calculate your final average in this course. The details of the calculating can be found in the course syllabus. Test your program with the following test cases
Test case A: homework/labs 10 10 9 8 10 9 8 10 8.5 6 test scores 88 77
Test case B homework/labs 10 9 0 0 10 9 9 test score 90 70
Test case c

1)
import java.util.*;
class FindArmstrong
{
public static void main(String[] args)
{
for(int i=100;i<1000;i++){
int k=i;
int n=k;
int d=0,s=0;
while(n>0)
{
d=n%10;
s=s+(d*d*d);
n=n/10;
}
if(k==s){
System.out.println(k);
}
else{
}
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.