Implement a console application that supports simple map

Assignment Help Programming Languages
Reference no: EM132305220

1. Introduction

In this assignment, you are to implement a console application that supports simple MAP (Mean Arterial Pressure)analysis functionality. A phased implementation approach is recommended and an outline for such an approach is provided in Appendix 1. The application is to be conformant with the class diagram provided in Figure 1.

2. The Application

The raw data to be analysed is to be stored in 3 arrays. Use array initialisers to specify initial values of your choosing. The 3 arrays are to contain person identifiers (string values), systolic blood pressure (SBP) and diastolic blood pressure (DSP). Both SBP and DSP are to be specified as int values.MAP is determined from an individual's blood pressure using the following formula:

MAP = 1.0/3.0 * SBP + 2.0/3.0 * DBP

The raw data is to be used to create objects of type Record, which are to be stored in an array of type Record. The Record class is to conform to the class shown in the UML Diagram below:

811_figure.jpg

Figure 1. Class Diagram

Note that in Figure 1, the visibility of class methods and attributes are designated as + (public) and - (private). Associations are annotated with a label (for readability) and multiplicity. The multiplicity captures the number of object instances that can be involved in the association. In this case, only two values apply - 1 and *, which means many.

Whilemap is calculated as a floating point value, it is to be stored as an int value. In addition to the map attribute, Record also has a category attribute, which has values of "high", "medium" and "low". A normal mean arterial pressure is a value in the range 70 and 100 mmHg inclusive.

Category determination is to be provided as a separate (private) method called classify(). Creation of the Record array is to occur when the MAPAnalyser object is created, using a private method called loadFromTables(). This method will iterate through three separate arrays containing ids, systolic blood pressures and diastolic blood pressures, construct Record objects and add them to the data array.Populate these arrays using array initializers. In order to facilitate search, records areto be maintained in ascending order of person id. Sorting is to be done after record creation, using a private method called sortById(). This method must implement the selection sort algorithm. BothloadFromTables() and sortById() are to be invoked from the constructor for the MAPAnalyser class.

The application's View classis to execute (using a switch statement) the following command options:
1. Display the record for a specifiedperson
2. Display records for all personswith MAP values within a specified range.
3. Display the minimum, maximum and median MAP values
4. Exit the application
As it is a console application, the user will need to be prompted to enter a command and its arguments (if any). My personal preference is for a minimal interaction scheme, as shown below:
run:
The following commands are recognised
Display this message > 0
Display a specific subject record: > 1 id
Display records for all subject records within a range > 2 map1 map2
Display statistics (minimum, maximum and median) > 3
Exit the application > 9
> 1 S01
<S01,120,81,94.0,normal>
>
Feel free to adopt the above scheme or if you prefer, implement a more verbose interaction scheme.

Note that

1. Each command is designated a number

2. Command 1 requires a single argument - the subject id

3. Command 2 requires 2 arguments - the lower and upper bounds of a range of MAP values.

4. I have added a "help" command (command 0)

5. The command options are displayed at the start of the application and whenever a "help" command is entered, rather than after each command.

6. Records are displayed (with no explanation of the fields) using Record.toString()

7. For a sorted list of values, if the number of values is odd, the median is the middle value. If the number of values is even, the median is the average of the two middle values.

For the commands that require arguments note that
a. For commands 1 and 2, basic error checking is expected. For command 1, an error message is to be displayed if an id does not exist. For command 2, an error message is to be displayed if a member of the range is < 0 or >200 or if the second member of a range is less than the first member.
b. For command 2, the range is inclusive of the values specified. Consequently, having both members of a range equal is valid.
c. For command 1, binary search is to be used.
d. For command 2, the results are to be stored in an array for display.The length of the array will correspond to the number of records found.

The application must conform to the class diagram in Appendix 1, although additional private members and methods are permitted.

Attachment:- Assignment.rar

Reference no: EM132305220

Questions Cloud

How advances of medicine have not consistently been followed : Describe in your own words how advances of medicine over centuries have not consistently been followed and continue to serve as a remainders of the need.
Publish the article on your own social media account : Publish the article on your own social media account (e.g., Linkedln, Facebook, Pinterest, etc.), or post it on a health care message board of your choice.
Business weaknesses have been made stronger : The end result should be on the positive side of things, where the business weaknesses have been made stronger and the business has expanded.
Identify the specific disagreement between the parties : Identify the specific disagreement between the parties. Evaluate key judicial concepts that influence the decisions related to business.
Implement a console application that supports simple map : COIT20245 - Introduction to Programming - Central Queensland University - implement a console application that supports simple MAP (Mean Arterial Pressure
In what ways are elements of reasoning sometimes confused : In what ways are the elements of reasoning sometimes confused with other domains of thinking? Provide at least three detailed examples.
Definition of business ethics : If only subordinates receive ethics training, how could this become a challenge to employee commitment?
Explain how you would respond to the situation or evidence : Review the following situations and evidence. In a 2-page paper, explain how you would respond to the situation or evidence. In your paper, li st the hearsay.
Culture be internal strengths or weakness : In what ways can corporation's structure and culture be internal strengths or weakness?

Reviews

len2305220

5/14/2019 2:32:21 AM

For Language Use and Functionality, a checklist is given, but not a detailed marks breakdown. For checklist item non-compliance, you will be penalised 0.5 – 2.5 marks, depending on the degree of non-compliance. Note that it is your responsibility to ensure that source code files are included in your submission as well as report.docx. If either are missing, the assignment will not be marked.

len2305220

5/14/2019 2:32:14 AM

3 Layout and documentation Conventions (Spacing, indentation, naming) /1 Comments /3 4 Report Limitations /2 Test Plan and Test Results /6 Sub-Total /30 Penalties Does not compile: up to 30 marks Partial implementation: up to 30 marks Late submission : 5% (1.5 mark) / day or part of a day Total /30

len2305220

5/14/2019 2:32:04 AM

4. Marking Criteria Criteria Marks Allocated 1 Functionality /10 Command loop Sorting Searching Statistics (maximum, minimum, median) Conformance to class diagram 2 Language use /8 Variable declarations Class definition/object creation Loop control Selection statement use Method definition and use Reading input Display of results Unnecessary/very inefficient code

len2305220

5/14/2019 2:31:56 AM

You are to submit two separate files: 1. Your zipped NetBeans project folder. Details of how to do this are available in the NetBeans FAQ on the unit website. 2. Report.docx. This file is to contain the following Sections: a. Limitations b. Test plan c. Test results Student name, student ID number, unit name andunit code are to be included on the title page. The limitations section is to specify any limitations that your program has in terms of calculations and data validation. The test plan is to contain a comprehensive list of program functionality to be tested, the input values to be used to test each item of functionality, the expected output from the test and the actual output from the test. The test results section is to contain screenshots to demonstrate that the program generates the actual outputs shown in the test plan.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd