Professional Documents
Culture Documents
In this task you need to use any IDE to run the below code:
1) You need to create a new application to enter scores for students whereas (Jo= 50, Ehab=90, smith=80) and the result will
display as the below:
package set1;
import java.util.Scanner;
if(Jo>=90){
Grade="A";
Message="Excellent Job";
} else if (Jo>=75) {
Grade="B";
Message="Great Job";
} else if (Jo>50) {
Grade="C";
Message="Hard luck";
} else if (Jo<=50) {
Grade="F";
Message="Oh!!!!";
}
System.out.println("Jo "+Jo+" "+Grade+" "+Message);
1
if(Ehab>=90){
Grade="A";
Message="Excellent Job";
} else if (Ehab>=75) {
Grade="B";
Message="Great Job";
} else if (Ehab>50) {
Grade="C";
Message="Hard luck";
} else if (Ehab<=50) {
Grade="F";
Message="Oh!!!!";
}
System.out.println("Ehab "+Ehab+" "+Grade+" "+Message);
if(Smith>=90){
Grade="A";
Message="Excellent Job";
} else if (Smith>=75) {
Grade="B";
Message="Great Job";
} else if (Smith>50) {
Grade="C";
Message="Hard luck";
} else if (Smith<=50) {
Grade="F";
Message="Oh!!!!";
}
System.out.println("Smith "+Smith+" "+Grade+" "+Message);
}
}
2) Create a new application using while loop to print odd number for the range from 1-100
package set2;
import java.util.Scanner;
2
3) Create a new application using do while loop to print odd number for the range from 1-100
package set2;
import java.util.Scanner;
} while (again);
scanner.close();
}
}
4) Create a new application using for loop to print even number for the range from 1-100
package set2;
import java.util.Scanner;
3
5) Create a new application using Nested loop to enter any number and print the stars based on the entered number example
( enter number 5 and the below is printed)
*
**
***
****
*****
package set2;