This is a "regular" assignment so we are going to read your code. Your score will be based partly (about a third) on the specchecker's functional tests and partly on the grader's assessment of the quality of your code. See the "More ab

computer science

Description

Please start the assignment soon and get your questions answered right away. It is physically impossible for the staff to provide individual help to everyone the night that the assignment is due! 


This is a "regular" assignment so we are going to read your code. Your score will be based partly (about a third) on the specchecker's functional tests and partly on the grader's assessment of the quality of your code. See the "More about grading" section. 


Tips from the experts: How to waste a lot of time on this assignment 


1. Start the assignment the night it's due. That way, if you have questions, the TAs will be too busy to help you and you can spend the time tearing your hair out over some trivial detail. 


2. Don't bother reading the rest of this document, or even the specification, especially not the "Sample Usage" or "Getting started" sections. Documentation is for losers. Try to write lots of code before you figure out what it's supposed to do. 


3. Don't test your code. It's such fun to remain in suspense until it's graded!


Overview 

The purpose of this assignment is to give you some practice with the process of implementing a class from a specification and testing whether your implementation is correct. None of the code should be very complicated; most methods are just one line, and the longest one, the visit() method, can be done in 6 to 8 lines. In particular, you do not need any conditional statements (i.e. if or switch statements) or anything else we haven't covered.


For this assignment you will implement two classes, called City and Backpacker. The specification for this assignment includes this pdf along with any "official" clarifications posted on Piazza. Details are in the next two sections. Here is a brief overview: 


A City object just represents a city name along with a cost per night for hostels. There is a constructor for initializing the city name and hostel cost and there are several accessor methods. There are no mutator methods. The hostel cost is represented as an integer, which represents the number of Euros.


Related Questions in computer science category