580 likes | 625 Views
E-Genting Programming Competition 2006. Public Lecture by Jonathan Searcy 3 February 2007. Competition Questions. Loan Evaluator. Language Selection. Dataflow Diagram. Constructing the Data Entry Screen. Decoding and Validating the Fields. Calculating the Effective Interest Rate.
E N D
E-Genting Programming Competition 2006 Public Lecture by Jonathan Searcy 3 February 2007
Summary • Defining a data entry screen. • Extracting data entered into the fields of a data entry screen. • Decoding and validating data extracted from the fields of a data entry screen. • Searching for the solution to an equation.
Summary • Identifying processes by dataflow analysis. • Displaying graphical objects. • Receiving and processing button event messages • Loading the contents of a file into a byte array. • Initiating and terminating a thread. • Communicating between threads. • Understanding a microprocessor instruction set.
The Underlying Problems • choose the projects to be included in each programmer rating; • choose the programmers to be included in the team; • resolve the project contention.
Brute Force • The database contains 75 programmers, 324 projects and 339 assignments. • At most 339 – 324 or 15 projects had more than one programmer. • Roughly 215 or 32,768 different contention alternatives might need to be tested. • 1 hour / 32,768 or around 100ms to test each alternative.
Summary • Database accessing using SQL. • Using entity relationship diagrams to analyse and define data structures. • Identifying core issues in a compound problem. • Determining the feasibility of using brute force to solve investigative problems. • Proving a solution is correct using mathematical theory. • Using library sort functions. • Using a linear search to find a peak value. • Dataflow analysis and design. • Expanding combinations using recursion. • Report layout interpretation and report formatting.
Angina Marketing • Angina Marketing operates several chains of fast food outlets. Their products include fried chicken, hamburgers, French fries and pizzas. • According to Wikipedia: • Angina pectoris is chest pain due to ischemia (a lack of blood and hence oxygen supply) of the heart muscle, generally due to obstruction or spasm of the coronary arteries (the heart's blood vessels). Coronary artery disease, the main cause of angina, is due to atherosclerosis of the cardiac arteries.http://en.wikipedia.org/wiki/Angina • Caused at least in part by the consumption of foods high in saturated fat and salt (e.g. hamburgers, French fries, fried chicken and pizzas).
Background • Angina has a huge database table (over 200 million rows) that contains one row for each transaction processed at the fast food outlets. • Angina needs a report to summarise the information in the transactions table. • The transactions table has limited indexing. • The reporting program should generate the report for a single day in less than 10s. • The program must do date validation and conversion. • The opening and closing balance totals are not a simple total of the opening and closing balances of the individual shifts.
Data Dictionary • date and time the report was printed; • reporting period (from-date and to-date); • for each cashier shift in the reporting period: • cashier location code, • trading day date, • shift number, • opening balance, • total fills in the shift, • total credits in the shift, • total sales in the shift, • closing balance; • totals for all shifts.