Windows Systems Programming: Spring 2004

[ Home | Syllabus | Course Notes | Assignments | Search]


Final Exam 
Revision 1: May 1st (in red)

Rules of taking this test

  • This will be a take home exam which you will have 1 week to complete. Answers must be submitted no later than midnight Tuesday May 4th.
  • You must work on your own, the only person you can ask for help is Dr. Wild.
  • This is open book, open note, open compiler (that is you can use a compiler to check your answers)
  • You can ask me questions or send e-mail.
  • You must return the test by e-mail.
  • You must sign the honor pledge and either fax or return original to me (even though you e-mail the answers).
    However, you will not get your grade until the honor pledge is turned in.

Honor Pledge: I pledge that I have neither given nor received unauthorized help in taking this exam.
You signature must be delivered to

Dr. Wild
Department of Computer Science
Old Dominion University
Norfolk, VA 23529-0162
FAX 757 6834900

Signature: __________________________________________________________

Printed Name:  __________________________________________________________

 

  1. Modify the web form found here change the form to add three buttons.

    A) Update: this will update the time displayed to the current time. This is needed because the current web form displays the current time when it is first loaded. In order to get a more recent current time, you will use this button.
    B) Start: this is to start an elapsed time timer
    C) Stop: this will stop the elapsed time timer and display the elapsed time
    Thus if the user selects the start button and 5 seconds later selects the stop button, the form will display 5 seconds.
    You must use the session object to solve this problem.
    Your answer should include the entire web application so I can install and run it.

     

  2. Given the following XML schema definition

    <?xml version="1.0"?>
    <xsd:schema id="Guitars" xmlns=""
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:element name="Guitars">
        <xsd:complexType>
          <xsd:choice maxOccurs="unbounded">
            <xsd:element name="Guitar">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="Make" type="xsd:string" />
                  <xsd:element name="Model" type="xsd:string" />
                  <xsd:element name="Year" type="xsd:gYear"
                    minOccurs="0" />
                  <xsd:element name="Color" type="xsd:string"
                    minOccurs="0" />
                  <xsd:element name="Neck" type="xsd:string"
                    minOccurs="0" />
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:choice>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>

    Write an XSL Transformation that will transform the information in an XML file conforming to this schema to a text file in this format

    Guitars.Guitar."elementName"::"textValue"

    where "elementName" is one of "Make, Model, Year, Color, Neck" and "textValue" is the text value of that element.

     

  3. There is a difference between a well formed XML document and a valid one. Using the schema in the above question, give an example of an XML file that is

    A) not well formed and not valid
    B) well formed but not valid
    C) well formed and valid
    D) not well formed but valid

  4. Change the Calc web service given here to add a new method that adds three numbers at once (because you find you often have to add three numbers and you only want to make one service call). Call this new method "add3". Show the changes (only) that will be made to the "asmx" file, the "wsdl" and the client proxy code.

  5. Web service proxies support asynchronous requests (see web client notes).  Change the following example to use a multi-thread solution which gives the same performance in the main thread but only uses the synchronous method of requesting the web service in the secondary thread (ie. no calls to calc.BeginAdd).

    
    CalculatorWebService calc = new CalculatorWebService ();
    IAsyncResult res = calc.BeginAdd (2, 2, null, null);
       .   .   . // do something else while you wait
    //// removed alternate coding
    if (res.IsCompleted) {
         int sum = calc.EndAdd (res); }
     else {     // Try again later }
    //// clarification - the above code is in the main thread and uses asynchronous web services to 

     

  6. Given the "NetDraw" remoting example, list, in order, the function/method/service calls, invoked for one client to draw a single stroke and send it to the other clients (you only need to describe the sequence on one of the other clients). Only list the calls that are given here. Assume none of the other clients are doing anything.

  7. Which of the student presentations did you find the most interesting and why?


Copyright chris wild 1999-2004.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: May 03, 2004.