Answer:
Option (D) i.e., s1.getClassRank( ); is the correct option to the following question.
Explanation:
Here, in the following option, the object "S1" is the object of the class "rank" and "getClassRank( )" is the function of that class "rank". so, in the following code the function "getClassRank( )" is called through the class object which computes and returns the class rank of the students.
So, that's why the following option is the correct way to call the function.
Answer:
The algorithm:
Input days
sum = 0
for i = 1 to
input text
sum = sum + text
end for
average = sum/days
print average
The program in pascal:
var days, sum, text, i:integer;
var average : real;
Begin
write ('Days: '); readln(days);
sum:=0;
for i := 1 to do
write ('Text: '); readln(text);
sum:=sum+text;
end;
average := (sum/days);
writeln ('The average text is' , average);
End.
Explanation:
This declares all variables
var days, sum, text, i:integer;
var average : real;
This begins the program
Begin
This gets the number of days from the user
write ('Days: '); readln(days);
Initialize sum to 0
sum:=0;
This iterates through the days
for i := 1 to do begin
This gets the text for each day
write ('Text: '); readln(text);
This sums up the texts
sum:=sum+text;
End loop
end;
Calculate average
average := (sum/days);
Print average
writeln ('The average text is' , average);
End program
End.
Answer:
Number of fragments is 3
Explanation:
The maximum size of data field in each fragment = 4468 - 20(IP Header)
= 4448 bytes
Hence, the number of required fragment = (10000 - 20)/4448
= 3
Fragment 1
Id = 218
offset = 0
total length = 4468 bytes
flag = 1
Fragment 2
Id = 218
offset = 556
total length = 4468 bytes
flag = 1
Fragment 3
Id = 218
offset = 1112
total length = 1144 bytes
flag = 0
Answer:
Could you seperate them if they are different answers? I'm lost, sorry!
Explanation: