Question 1

This question relates to the administrative part of an online (i.e. web based) assignment marking tool that might be suitable for marking university level assignments at USQ such as those in CSC2407. The question provides a narrative, which you must turn into specifications.

Narrative: The examiner of the course offering must set up the assignment before markers can begin marking using the software. He or she needs to create an assignment to be marked, and input each assignment submission. The examiner will select markers for the assignment, and specify how many assignment submissions each marker will mark. The examiner will then use the software to allocate assignment submissions to each marker.

Human roles, computing systems, or concepts referred to in the narrative are not explained. For example, the software developers who are one of the target audiences of these specification may not have studied at USQ, and may not understand terms like "course", "subject", "semester" or "examiner".

You must provide a glossary that explains any such term that will be mentioned in your specifications that might not be clear. Again, you may have to be creative whenever something is unclear, but the terms mentioned above should already be known to you. In your definition, as well as explaining the concept, you should list what properties or attributes define or uniquely identify such an entity as well as other important attributes. This will help you to know how the system will work and what needs to be entered. For example, given an assignment, what else is needed to define an assignment submission.

Your specifications should be more physical than the narrative. For example, just how does the examiner input the assignment submissions? Clearly the examiner is not entering the student's work, but is telling the system about each assignment to be marked. What exactly must be entered? How does he enter it? Does he create a text file, and upload it? Does the software present the examiner with a form with tick boxes associated with each student, and the examiner ticks the appropriate one? There are plenty of other possibilities. You may find that you need to add things to the glossary that were not mentioned in the narrative.

Your answer must take the form of a numbered (numbered using a letter) goals, which you must identify from the narrative, followed by a glossary, followed by numbered requirement specifications. The requirement specifications should reference the goals.

Question 2

Class Diagram

Draw a UML class diagram that models the aspects of job agencies that are described below:

  • Some of the employees of the agency, are agents.
  • Each agent has domain knowledge in only some classes of positions. For example, an agent may specialise in software developers for the banking industry. Some classes of position have more than one agent that has domain knowledge in that field. Not all agencies have expertise in all fields. For example, an agency that specialises in secretarial positions may not deal with builder's laborers, and it may not have any agents that have domain knowledge in that area.
  • Agencies typically keep the details of the employers they have dealt with, even when they have no current business with them.
  • Agencies are approached by employers seeking employees.
  • One of the agents will be nominated as the first port of call for a given employer.
  • Employers will provide the details of positions to an agency or possibly to several agencies.
  • The details of each position, including contract details are recorded, and one of the agents with domain knowledge in corresponding class of positions will be made responsible for that position.
  • Your model must show:
    • Named classes
    • Named associations and association multiplicity
    • Example attributes of classes (at least 3 attributes, but as many as possible)

Hints

  • Do it first using pencil and paper, then use a UML tool to create this diagram. Try googling "Roses are rational. Violets are GNU.".

Question 3

Statechart Diagram

In this question you are asked to design a floating point calculator. see image.

As a starting point, you have been provided with a calculator that is only capable of entering integers. The design consists of a statechart, a description of the data and some pseudocode that describes the methods invoked or referred to by the statechart. You should verify that the design works as expected.

Design of a calculator that only handles integers

Data

input: The character pressed that caused the event.

A: This is used to hold the number while the user is entering it. The contents of A is displayed on the screen.

B: This is used to hold the number that was previously entered or accumulated.

pendop: This is used to hold the pending binary operation that will be applied to A and B.

Statechart see image.

Methods

doInitialise()

  • B = 0
  • A = 0
  • pendop = '='

doFirstDigit()

  • B = A
  • A = input

doPendOp()

  • if (pendop == "+")
    • A = B + A
  • else if (pendop == "-")
    • A = B - A
  • else if (pendop == "*")
    • A = B * A
  • else if (pendop == "/")
    • A = B / A
  • pendop = input

doAddDigit()

  • append input to A

Note that this design does not respect order of precedence. For the sake of this assignment it is acceptable if your diagram does not respect order of precedence also.

Your Task

Your task is to enhance the statechart diagram so that you can potentially enter floating point numbers. Your diagram must not allow the entry of an invalid floating point number. An attempt to enter a second decimal point, for example, should be ignored, as should an attempt to add a second "E" or a decimal point after the "E". Pressing "+-" changes the sign of the number, but after the "E", pressing "+-" changes the sign of the exponent. The following are examples of valid floating point numbers:

  • 23
  • 23.5
  • -2e4
  • 2e-4
  • 2.76e12

Hints

  • Do it first using pencil and paper, then use a drawing program to create this diagram. (I used UMLet, but found that Open Office Draw is just as good at making statechart diagrams.)
  • A nested state diagram would reduce the complexity.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.