Ask a question to Desklib · AI bot


CSC2023: Truck Loading Problem | Assignment

Added on -2019-09-16

| 4 pages
| 1655 words

Trusted by 2+ million users,
1000+ happy students everyday

CSC2023: Truck Loading Problem (Semester 1, 2016/17)----------------------------------------------------Questions and Answers----------------------------------------------------GENERAL COMMENT: If Assignment 2 specification is incomplete or vague w.r.t. some specific issue(s), feel free to introduce your own assumptions, take reasonable decisions etc, and then explain these in yourreport providing appropriate justification. Alternatively, contact the module leader.Carry out the usual correctness tests checking whether your algorithms work asdesired.Use small number of boxes and comment on the results in your submission.------------------------------Q: Pseudo code is difficult to write and read, as when it wasintroduced to us it seemed as though there are different standardsdepending on who taught it to you.A: The reason for having pseudo code is to make the understandingof algorithms easier, by avoiding Java-specific syntax, and abstractingaway tasks which are easier to express in few words than throughan actual program code. For example, people would normally findit easier to understand what's going on if at some point of thepresentation of the algorithm you write:...sort_using_Quicksort (A)...rather than having to read 10++ lines of Java code implementing Quicksort.Another common simplification is to use variables without declaringthem explicitly if it's clear from the context what they are,and to avoid writing the curly brackets { ... } and use indentationof the written text instead.Of course, pseudo code is not a formal notation, and so different authors would usedifferent variations. Part of your study for the CS degree is to learnhow to understand (and use) different styles of pseudo code. For example, thiscan be highly important in real-life situations when you have a team ofseasoned programmers who are experts in different programming languages. Ratherthen having to learn each other's favourite programming language(with all the intricacies and peculiarities of their syntaxes),they could instead communicate using informal pseudo code notations whicheverybody can understand.------------------------------Q: Do you have any examples of pseudo code that is written inthe style you prefer which I could use as a reference whenI write it for the project?A: My lecture notes follow the style used in one of the recommended
textbooks. But I wouldn't claim that's the bestpseudo code style invented by people, and insist that you must use thisstyle. Have a look at other styles available on the Web, like this one: you'll soon find that the different styles of pseudo codeare rather similar.------------------------------Q: Should the boxes be generated before or during the run?A: It's better to generate all the input data needed before running thealgorithms. In this way one can use the same inputs for both algorithms, and the timetaken to generate boxes isn't included.------------------------------Q: Should one include the time taken to generate test data in the comparisons?A: No.------------------------------Q: Are we allowed to use sophisticated Java features in our code?A: Your code should be executable using the common UniversityBlueJ environment. The extra neatness of the code is of a secondaryimportance in this project. Bear in mind that the markers would normallyuse BlueJ to reproduce your test results.Also, my advice would be to use as simple as possible data structures and aim at a clear short code. This project is not about developing a sophisticated object oriented designs.------------------------------Q: Is it better to use real or integer numbers for the sizes ofboxes and trucks?A: It's better to use integers as they allow for exact arithmetic(operations involving real numbers are only approximate !!!). For example, you may assume that the width of each truck is 2000 and the height is 1000.------------------------------Q: Can we turn boxes?A: No------------------------------Q: Are all trucks the same W & H?A: Yes------------------------------ Q: Can there be boxes with the H & W of the truck itself?

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this