The last class gave the students a question, prepared a web service, realizing the following three features: query grades, query average score, query rankings. Given the following table:
Name
.NET technology
C #
Xml
J2EE
JSP
A
85
84
90
80
85
B
90
76
78
85
78
C
67
66
64
85
80
Di
90
78
65
78
80
E
64
60
67
78
80
This question is that I think of my head, so I need to come to realize it, how to explain if the teacher can't do it. So the following procedures are written: use system; use system.componentmodel; use system.data; use system.diagnostics; using system.web; using system.web.services;
Namespace WSEXERCISE {
Public class service1: system.web.services.Webservice {public service1 () {initializationComponent ();
#Region component designer generated code private icontainer components = null; private void initializecomponent () {}
Protected Override Void Dispose (Bool Disposing) {IF (Disposing && Components! = NULL) {Components.dispose ();} #ndregion (Disposing);} #ENDREGON
INT I, J, ORDER; / / Define Global Variable I, J as Indexes in Grade Arranges, Order Storage Name Double [] Everyone = New Double [5]; // Defines a copy of the EVERYONE array storage average grade
[WebMethod (Description = "Query student grades by entering name and account")] Public int getscore (string name, string length) {getibyName (name); // Get i's value getJByition (LESSION); // Get J Numerical Return Score [I, J]; // Return to Zeng from the Grade array} [WebMethod (Description = "by entering the name to query the average score")] Public Double Getaverage (String Name) {GetibyName (Name); // Get the value average (); // call the average method to get the average grade RETURN AVERAGE [I];} [WebMethod (Description = "by entering the name to query the student ranking")] public int getorder (String name) {average (); // Call the Average method to get the average grade EVERYONE [I] = AVERAGE [i]; // Generate a copy of the average score (INT i = 0; i <= 3; i ) // bubbling The method is sorted to obtain the average from the order of the large to small; Double Big;
For (int J = 0; j <= 3; j ) {if (Average [J]