Assignment title: Information


SIT172 Programming for Engineers - Assignments (2016-2) Introduction The following problem description will form the basis for all four assignments to be completed this trimester. Each assignment will require a different method to solve the same problem. You will solve the problem using: • Spreadsheets • Pseudocode • C programming • Matlab programming Problem Description You are working as an Engineer for a mining research lab and have been asked to provide an automated solution to analyse data. The data relates to a new method being developed to measure mineral types every 1m of a mining survey site and is stored in a file. Each line in the file represents a row of measurements on the survey site. Data is separated by a comma ','. EG: Contents of data.csv 0.703578874,0.533945371,0.833117826,0.219037251,0.730840727,1.650034384,0.378218483,1 .520950262,1.696477108,1.979847676,1.124318922,1.657195876,1.348386927,0.179888413,1. 769052439,1.049453038,0.585134136,1.214801506,0.871846469,0.45239229 0.632727092,1.549419549,1.042159018,0.041380694,0.036309815,0.937661043,1.198971105,0 .770819842,0.908575937,1.670202457,1.722965198,1.538690878,0.368847283,1.496180812,0. 225361156,1.607666317,1.365574541,0.516478269,0.733094338,0.484583198 0.328121654,0.370393867,1.930956508,1.265866585,0.521273346,0.586862621,1.135494678,0 .599855214,1.913113078,1.257850906,0.629030614,1.73142919,0.525701891,0.421779956,0. The analysis is designed to determine if the method can detect particular types of minerals. The long term goal is to run extensive surveys of possible mining sites to measure, detect and determine the most suitable sites to mine. This unit introduces four methods that can be used to automate the analysis process. Each method has strengths and weaknesses. Regardless, by the end of the unit you will have a better understanding of these methods and which method suits particular types of tasks that you may be required to complete in industry. The analysis that you are required to undertake consists of the following: 1. Preparation: perform the following changes to the data prior to classification and the search. • Round the data up to 2 decimal places • Check and identify any data that is less than 0 or greater than 2 2. Classification: The data is a measure between 0 and 2. Each value requires classifying according to the following rules: Range Display Value 0 - 0.4 1 0.4 - 0.8 2 0.8 - 1.2 3 1.2 - 1.6 4 1.6 - 2 5 The resulting information will look something like the following: 1 4 4 4 3 4 3 1 5 1 4 1 1 5 1 5 2 2 4 5 2 2 3 2 4 1 4 3 5 2 5 2 5 4 4 2 3 2 4 3 5 3 5 5 1 5 2 3 3 2 2 5 3 3 1 2 1 4 1 2 1 5 3 5 1 1 1 2 3 5 3 3 4 1 4 5 5 5 4 2 3 4 3 3 2 3 5 5 1 1 2 3 1 4 3 1 4 4 2 5 1 1 4 3 5 5 4 3 4 2 5 3 3 1 1 5 1 2 3 5 4 1 2 5 5 1 2 1 5 2 5 5 5 3 3 4 2 4 1 2 4 4 3 5 Note: The above image is for demonstration purposes only, and is not a 100% reflection on how your map should look. Do not use it as a reference for your own solution, as yours will look different to this one. Provide a count of each of the Classification values. Range Display Value Count 0 - 0.4 1 30 0.4 - 0.8 2 65 0.8 - 1.2 3 24 1.2 - 1.6 4 67 1.7 - 2 5 34 Note : This is an example only and does not represent the final search map you will produce. 3. Pattern Search : The engineers are interested in identifying any areas that represent a cluster of a particular type. The next phase is to search the Classification Map and identify the following clusters: # represents the value found at that location that matches the search. Pattern A : # # # # Pattern B: # # # Pattern C: # # # The search should result in a Search map indicating where the search identified a pattern. For this exercise the pattern search need only record the first pattern found. • #A identifies Pattern a was found of value # • #B identifies Pattern a was found of value # • #C identifies Pattern a was found of value # #A #C #C #A #B #A Note : This is an example only and does not represent the final search map you will produce. Report the number of times the patterns are detected. Range Display Value Count Pattern Count Pattern A Count Pattern B Count Pattern C Count 0 - 0.4 1 30 3 1 0 2 0.4 - 0.8 2 65 6 6 0 0 0.8 - 1.2 3 24 2 1 1 0 1.2 - 1.6 4 67 8 2 4 2 1.8 - 2 5 34 2 2 0 0 Note : This is an example only and does not represent the final counts you will produce. Assignment 1: Spreadsheets : Description Using a spreadsheet program such as Microsoft Excel, complete the following analysis: • Download data-1.csv from the unit website • Read the data file into a spreadsheet program • Name the worksheet Data o Convert and check the data in the Data worksheet. o Create a Classification Map, then determine and display the value for each cell as per the problem description (use Conditional Formatting in Excel to highlight the unique values in the map) • Create and display the results of Pattern Search. • Calculate and display the counts as per the specifications Additional notes: • Ensure you provide a table that reflects the Range and Value used to create the Classification Map. The user should be able to change the range and associated value and have the change propagate through the map accordingly. • Ensure that your information/results have been communicated clearly. This includes displaying the counts, having a legend, using Conditional Formatting to highlight values in colour, and so on. • Ensure that classification and Pattern Maps are easy to understand. A map and a legend is a must here. Clearly showing the results of your counts, the location of patterns, and the result of the rule, are all essential for communicating to the reader effectively. • Ensure you use appropriate and efficient relative and absolute addressing in your design. I may wish to change the symbols used to reflect the outcomes to '#,*, $' instead of '1,2,3,4,5' and as a consequence I should only change this in one cell to reflect the change throughout the spreadsheet. Marking guide (10 points) Raw data processing: • Final values rounded up and checked correctly for each row and column: 1.0 Classification Map: • Map correctly created with accurate values and formatting: 3.0 Appropriate use of Absolute & Relative addressing: 0. 5 • Clear legends and conditional highlighting used: 0.5 Pattern Map: • Results of rule are correctly calculated and accurate for each row/column: 3.0 • Appropriate use of Absolute & Relative addressing: 0.5 • Clear legends and conditional highlighting used: 0.5 Value and Pattern counts • Counts provided and accurate : 1.0 Submission instructions: Please submit a single Excel file, with an extension of either .xls or .xlsx, to the assignment dropbox by the due date. Your name and student ID must also appear within the Excel file. Assignment 2: Pseudocode Using appropriate pseudocode syntax, write the algorithm required to describe the steps involved to analyse and display the data as per the problem description. The order of the algorithm should be as follows: Variables • Describe the data requirements, variables etc Algorithms • Describe the process to store the value for each row and column for an unknown number of rows and columns • Describe the process to determine and store the values for the Classification Map • Describe the process for calculating and displaying the results of the Pattern Map. • Describe the process to calculate and display the counts as per the specifications Additional notes: • Ensure you use appropriate and efficient use of variables and constants in your design. I may wish to change the symbols used to reflect the outcome to '#,*, $' instead of '1,2,3,4,5' and as a consequence I should only change this in one cell to reflect the change throughout the code. • Clarity and readability are absolute key for this assignment! If your submission is hard to follow the marker will ultimately miss important information and you will lose marks. Make it readable. Marking guide (10 points) Raw data processing: • Variables and constants defined and initialized: 0.5 • Code defined to roundup and check the data: 1.0 Classification Map: • Code defined that uses IF statements correctly to compare the cell with Range: 2.0 • Code defined that correctly stores the Classification Map: 1.0 • Code defined to correctly display the Classification Map: 0.5 • Pattern Map: Code defined to search and identify patterns as per the specifications : 2.0 • Code defined that correctly stores the Pattern Map: 1.0 • Code defined to correctly display the Pattern Map: 0.5 Counts: • Code defined to display the counts : 1.0 Code formatting and comments are appropriate and well laid out: 0.5 Submission instructions: Please submit a single text file, with an extension of .txt, to the assignment dropbox by the due date. Do not worry about losing your ''colouring" as NotePad++ will automatically re-apply them when it comes time to mark your submission. Your name and student ID must appear in comments at the top of your file. Assignment 3: C Programming For help getting started with this Assignment 3 (eg. creating a Visual Studio or XCode project), please see the Appendix A at the end of this document. Using appropriate C syntax, write the code required to analyse and display the data as per the problem description. The order of the C Program should be as follows: Variables and constants: • Use #define statements to define the constants • Use arrays to store the data, maps and counts Read data: • Download data-1.csv from the unit website • Read each individual data item from the file using an appropriate method into a two dimensional array • Close the file when finished Algorithms • Describe the process to transform and store the value for each row and column for an unknown number of rows and columns • Describe the process to determine and store the values for the Classification Map • Describe the process for calculating and displaying the results of the Pattern Map • Describe the process to calculate and display the counts as per the specifications Additional notes: • Code commenting and formatting is extremely important, and makes a big difference in the readability and understandability of your code. This will be taken into account when marking. • Ensure you use appropriate and efficient use of variables and constants in your design. I may wish to change the symbols used to reflect the outcome of '#, *, $' instead of '1,2,3,4,5' and as a consequence I should only change this to reflect the change throughout the code. Marking guide (15 points) Raw data processing: • Variables and constants defined and initialized: 1.0 Code defined to roundup and check the data: 1.0 Classification Map: • Code defined that uses IF statements correctly to compare the cell with Range: 2.0 • Code defined that correctly stores the Classification Map: 1.0 • Code defined to correctly display the Classification Map: 1.0 Pattern Map: • Code defined to search and identify patterns as per the specifications : 4.0 • Code defined to correctly stores the Pattern Map: 1.0 • Code defined to correctly display the Pattern Map: 1.0 Counts: • Code defined to store and display the counts : 2.0 Code formatting and comments are appropriate and well laid out: 1.0 Submission instructions: Please submit just your code file (and not the entire project) to the assignment dropbox by the due date.. Your code file is the file that you have written all of your code in, and it will have an extension of .cpp or .c. It can be found in the folder where you have saved your Visual Studio or XCode project. Your name and student ID must appear within comments at the top of the file. Assignment 4: MatLab Programming If you do not own a copy of Matlab but wish to work from home, you must Remote Desktop in to use the Matlab copies supplied on the Deakin network. Instructions on how to connect to the Remote Desktop can be found under Appendix B at the end of this document. Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and constants: • Use #define statements to define the constants • Use arrays to store the data, maps and counts Read data: • Download data-1.csv from the unit website • Read each individual data item from the file using an appropriate method into a two dimensional array Algorithms • Describe the process to transform and store the value for each row and column for an unknown number of rows and columns • Describe the process to determine and store the values for the Classification Map • Describe the process for calculating and displaying the results of the Pattern Map • Describe the process to calculate and display the counts as per the specifications Additional notes: • Code commenting and formatting is extremely important, and makes a big difference in the readability and understandability of your code. This will be taken into account when marking. • Ensure you use appropriate and efficient use of variables and constants in your design. I may wish to change the symbols used to reflect the outcome of '#, *, $' instead of '1,2,3,4,5' and as a consequence I should only change this to reflect the change throughout the code. Marking guide (15 points) Raw data processing: Variables and constants defined and initialized: 1.0 • Code defined to roundup and check the data: 1.0 Classification Map: • Code defined that uses IF statements correctly to compare the cell with Range: 2.0 • Code defined that correctly stores the Classification Map: 1.0 • Code defined to correctly display the Classification Map: 1.0 Pattern Map: • Code defined to search and identify patterns as per the specifications : 4.0 • Code defined to correctly stores the Pattern Map: 1.0 • Code defined to correctly display the Pattern Map: 1.0 Counts: • Code defined to store and display the counts : 2.0 Code formatting and comments are appropriate and well laid out: 1.0 ------------------------------------------------------------------------------------------------------------- Appendix A - Getting Started with Assignment 3 To begin Assignment 3 you will either need to use Visual Studio (PC), or XCode (Mac). Below you will find some help information on how to start a project in either, and how to use the starting code that is provided for you. Don't forget to start with the code provided to you, found in 'ass3.c' under Assessments. Using Visual Studio for PC: Here are some basic guidelines to help you get started when using Visual Studio. Note that any version of Visual Studio will suffice, and you can download a free version of Visual Studio Express from the Microsoft website (do a quick Google search). Be sure to download the Visual Studio Express for Windows Desktop version! 1. Open up Visual Studio, select File, New, and Project. A window will appear with a multitude of different templates you can begin with to help you get ready to code faster. 2. With C programming our focus for this unit, we would like to begin with a Visual C++ template. Please note that C++ is a different language to C, however they can both use the same compiler so it will suffice for our purposes to help us get started. 3. Inside the Visual C++ option, we want to select a Win32 Console Application. This option allows us to omit any files that deal with graphical user interfaces (GUI) as we are not concerned with them for this unit. Give your project a name, and specify where to save it. 4. In the wizard that appears next, we want to ensure that 'Empty project' and 'Precompiled header' are both unchecked. This allows us to get up and running a lot quicker by only providing us with the template files and code that we are concerned with. 5. Highlight the code found in ass3.c (found under Assessments) and Copy it, now Paste this code over the code that was provided in the template. 6. Browse to where on your PC you have saved your project to, and find where your main .cpp file is. (eg. My project was called 'assignment3' so I need to browse into my project folder until I found 'assignment3.cpp'). Copy our raw data file 'data-1.csv' into the same folder that has your .cpp file. Using XCode for Mac: If you must use a Mac then I would recommend using XCode. This is free, and can be obtainable from the Apple's development website (a quick Google will point you to the right website). 1. Open up XCode and choose to create a new project. In the next window select Application (under OS X), and Command Line Tool. 2. Give your project a name under Product Name, and ensure Type is set to C. Press Next, and select where you would like to save your project. 3. Highlight the code from the Assignment 3 getting started code provided and Copy it, now Paste this code over the code that was provided in the template. 4. On the left-side panel you will see some folders and files. Open up the folder titled 'Products', and right-click on the file inside (which will be the same name as the name you gave your project, like ass3). Select 'Show In Folder' and a window will open. Copy our raw data file 'data1.csv' into this folder. Appendix B - Getting Started with Assignment 4 - Connecting to Remote Desktop to access Matlab If you do not have a copy of MatLab and do not have access to the Deakin University computer labs, you may use a Remote Desktop connection to access a version we have setup for you to use. Instructions for PC users: To access the Remote Desktop version you will have to complete the following: • Setup and connect to Deakin via a Virtual Private Network (VPN) connection. If you do not have a VPN setup, follow the following instructions provided by the University. o VPN Help Start your Remote Desktop application via the Start - All Programs - Accessories - Remote Desktop Connection menu item. If you do not have the application, you can install it from your installation disk provided with the computer. • Enter the following into the dialog - computer field : sebe-farm.its.deakin.edu.au • Enter your Deakin login and password. (Note: You must have DU\ before your username) • You should then have access to the Virtual Computer and be able to run MatLab. Instructions for Mac users: To connect via Remote Desktop on a Mac, please follow the instructions in this VPN Help. NOTE: This system may run slowly due to the number of users accessing the system and the quality of your internet connection. IMPORTANT : Ensure you log off the remote connection when you have finished. Go to the Start - Log Off item in the bottom of the window to log off the system. Do NOT simply close the window.