[01] Write a code fragment that accomplishes the following:
1) Asks the user to enter student emails one name at a time.
2) If an email does NOT contain ‘@’ it prints the student sequence number and the word “invalid”.
3) It stops if the user enters “end”.
4) Prints total number of students with invalid emails.
[02] Implement question [01] as a method that does all stated steps, accepts no parameters and returns number of invalid emails.
[03] Convert the following for-loop into a while-loop and write its output:
double sum = 0;
for(int k=16; k 0; k /= 2){
sum += k;
sop(k);
}
sop(sum);
double sum = 0;
int k=16;
while( k 0){
sum+=k;
Sop(k)
k/=2
}
[04] Find and fix all errors in the following code fragment:
The code is supposed to read number of student first names and print the first and last letters of each name. The code quits when the user enters “done”.
String name = “”;
Scanner in = new Scanner(System.in); while( name != “quit” ){