13.07.2015 Views

EXAMINATIONS – MOCK EXAM - 2012/2013 - DCU

EXAMINATIONS – MOCK EXAM - 2012/2013 - DCU

EXAMINATIONS – MOCK EXAM - 2012/2013 - DCU

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong><strong>EXAM</strong>INATIONS</strong> – <strong>MOCK</strong> <strong>EXAM</strong> - <strong>2012</strong>/<strong>2013</strong>MODULE:Software Development for Engineers (EM108)COURSE:YEAR:B.Eng. in Mechatronic Engineering (ME1)B.Eng. in Digital Media Engineering (DME1)B.Eng. in Electronic Engineering (EE1)B.Eng in Information & Communication Engineering (ICE1)B.Eng in Mechanical & Manufacturing Engineering (CAM1)B.Eng. in Bio-Medical Engineering (BMED1)B.Eng. Common Entry into Engineering (CE1)B.Sc in Manufacturing Eng. with Business Studies (MWB1)Open Opportunities Course (FE1, FEE1)1 (one)<strong>EXAM</strong>INER: Dr. Gabriel-Miro Muntean (ext. 7648)TIME ALLOWED: 3 hoursINSTRUCTIONS:Answer THE QUESTION.THE USE OF PROGRAMMABLE OR TEXT STORING CALCULATORSIS EXPRESSLY FORBIDDENPlease note that where a candidate answers more than the required number ofquestions, the examiner will mark all questions attempted and then select the highestscoring ones.This booklet contains 4 pages, including the cover sheet.PLEASE DO NOT TURN OVER THIS PAGE UNTIL YOU ARE INSTRUCTED TO DO SOEM108 – Software Development for Engineers – Mock - <strong>2012</strong>/<strong>2013</strong> PAGE 1 OF 4


Dublin City UniversitySchool of Electronic EngineeringSchool of Mechanical and Manufacturing EngineeringComputer-based Exam DirectionsThe examination consists of one problem. You need to design a solution, write thecode using the C programming language, test your program, write a report and submityour work. It is strongly recommended that you plan your allocation of time carefullyin advance, and stick to this allocation during the exam. No extra time will beawarded and no excuse (such as lost data) will be accepted.For submission, the final report and code files will be copied into a directory whichhas as name your examID created on your drive H:\ or on C:\temp directory. Youneed to copy this directory both on the Q:\ network drive and on the memory keywhich is seen as a Removable Disk in your file system explorer. Each of these twocopies is considered the original, so make sure they contain identical content. Thereare no paper or e-mail submissions.A report template is available for you at the end of this document as well as todownload from the EM108 website:http://www.eeng.dcu.ie/~em108/<strong>2012</strong>-<strong>2013</strong>/Exams/MockExam/report.docEM108 – Software Development for Engineers – Mock - <strong>2012</strong>/<strong>2013</strong> PAGE 2 OF 4


Problem [TOTAL MARKS: 100]The file indata.txt contains 5 lines, each containing five pieces of information about avehicle separated by a space. In each case, the first text denotes the brand of vehicle,the second text the model, the third piece of information is the engine size expressedin cubic centimetres, the fourth is the price (expressed in euro) and the last anindication whether this is a new model or not (0 – old model; 1- new model).File Listing: indata.txtFord Edge 3500 28000 1Ford Shelby 5400 55000 1Ford Fiesta 1400 15000 0Nissan Tiida 1500 18000 0Nissan Juke 1600 25000 0Peugeut 3008 1600 30000 1Peugeut 208 1400 18000 0Toyota Prius 1600 30000 0Toyota Auris 1400 20000 0You are required to develop a program which will perform the following:1. Read the data from this file into an array of structures (10 marks). Assume amaximum of 20 characters for each product.2. For each vehicle calculate a new special offer price and update thecorresponding pieces of data from the array (10 marks). The algorithm for thecomputation of the new special offer price is as follows:• only old model vehicles can be subject to any discount;• vehicles with engines greater than or equal to 1600 cc will be subject to adiscount of 5%; and• vehicles more expensive than (or equal to) euro 20000 will cost 10% less.Note that more than one discount may apply and discounts are additive.3. Write all the information about the vehicles in a second file, such that on eachline data is stored in the following format (10 marks):brand model capacity “cc” old_price “euro” new price “euro”e.g. Toyota Auris 1400 cc 20000 euro 18000 euroThe program will offer a menu (10 marks) in which the user will have a choice tohave the output listed on the screen (5 marks) or in a file (5 marks). The user will beasked to introduce the output file name from the keyboard (5 marks). For printing ina file and on the screen good formatting is appreciated.The program must conform to the following guidelines:1. The program should include at least THREE functions (10 marks).2. The program should use an ARRAY of STRUCTURES to store theinformation.3. The program should make good use of string functions (5 marks)4. The program should use FILE POINTERS for INPUT and OUTPUT files.5. The program should demonstrate good coding practices with regard tospacing, indentation, commenting, etc. (10 marks)6. The program should compile and execute (10 marks)7. Briefly test the program. Record and report all test results (10 marks).EM108 – Software Development for Engineers – Mock - <strong>2012</strong>/<strong>2013</strong> PAGE 3 OF 4


EM108 Examination ReportRe-sit – Computer-based Exam<strong>EXAM</strong> ID:Programme:I hereby declare that the attached submission is all my own work, that it has not previouslybeen submitted for assessment, and that I have not knowingly allowed it to be used byanother student. I understand that deceiving or attempting to deceive examiners bypassing off the work of another as one's own is not permitted. I also understand that usinganother's student’s work or knowingly allowing another student to use my work is againstthe University regulations and that doing so will result in loss of marks and possibledisciplinary proceedings.Signed: (<strong>EXAM</strong> ID)Date:PlanDevelopmentTestingCode[End of the exam]EM108 – Software Development for Engineers – Mock - <strong>2012</strong>/<strong>2013</strong> PAGE 4 OF 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!