Skip to content

Hotel Katherine Fitzpatrick#49

Open
KatherineJF wants to merge 13 commits intoAda-C10:masterfrom
KatherineJF:master
Open

Hotel Katherine Fitzpatrick#49
KatherineJF wants to merge 13 commits intoAda-C10:masterfrom
KatherineJF:master

Conversation

@KatherineJF
Copy link

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? How to build the classes. Decided that room and reservation should describe only methods and variables specific to them and that the room_tracker class would act as the hotel "reception desk" by calculating and finding availability.

Describe a concept that you gained more clarity on as you worked on this assignment. | The importance of testing and how it should inform design.

Describe a nominal test that you wrote for this assignment. | One of the nominal tests that I wrote would be checking to see if I can create a new instance of a class like Room.

Describe an edge case test that you wrote for this assignment. | An edge case I would write would involve how to calculate cost if somebody checks-in and checks-out on the same day.

How do you feel you did in writing pseudocode first, then writing the tests and then the code? | I thought this was a very helpful process. Thinking about the logic first helped me separate figuring out syntax and working on the logic.

@CheezItMan
Copy link

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Reaonable number of commits, but don't use waves in your commit messages. Instead describe the functionality you added.
Answer comprehension questions Check, glad you found it a helpful process.
Design
Each class is responsible for a single piece of the program Check
Classes are loosely coupled Check
Wave 1
List rooms Check
Reserve a room for a given date range Check, but it doesn't check to see if that room is available.
List reservations for a given date Check
Calculate reservation price Check
Invalid date range produces an error Check
Test coverage SimpleCov not added
Wave 2
View available rooms for a given date range MISSING
Reserving a room that is not available produces an error MISSING
Wave 3 MISSING
Create a block of rooms
Check if a block has rooms
Reserve a room from a block
Fundamentals
Names variables, classes and modules appropriately
Understanding of variable scope - local vs instance
Can create complex logical structures utilizing variables
Appropriately uses methods to break down tasks into smaller simpler tasks
Understands the differences between class and instance methods
Appropriately uses iterators and enumerables
Appropriately writes and utilizes classes
Appropriately utilizes modules as a mechanism to encapsulate functionality
Wrap Up
There is a refactors.txt file MISSING
The file provides a roadmap to future changes MISSING
Additional Feedback You got through wave 1, but weren't able to figure out how to handle reservations and select rooms that are available in that time period. The basic design (classes, and their relationships) is pretty good however. I also left some notes in your code and let me know if you have questions.

One more minor note. Please don't brake the markdown table in the comprehension questions.



end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing an end here. Also indentation issues.

require 'minitest/autorun'
require 'minitest/reporters'
require 'minitest/autorun'
# Add simplecov

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't added simplecov

@@ -0,0 +1,78 @@
#Room Class

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class isn't doing much other than providing an id. So... maybe just use an array of numbers for the rooms.

end
total_cost = number_of_days * 200
return total_cost
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@room = room
@total_cost = calculate_total_cost
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest you add a method to tell if two reservations overlap, and another to tell if a reservation occurs on a specific date.

end

def make_reservation(start_date, end_date)
room = @rooms[rand(@rooms.length)] #getavilable room method

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should limit this to rooms that are available in the given date range.

def find_reservations_by_date(date)
bookings = []
@bookings.each do |booking|
range = booking.start_date..booking.end_date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole check to see if a Reservation occurs on that date would be wonderful as a helper method in Reservation.

let (:end_date) { Date.parse('2012-02-03') }
let (:room) { [14] }
let (:bookings) {[]}
it "assigns available room" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

hotel.make_reservation(start_date,end_date)
new_reservation = hotel.bookings.last
#new_booking = make_reservation(start_date,end_date, room)# new_bookings = Reservation.new(start_date,end_date, 12)
expect (new_reservation.room).must_equal 14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know it's 14. The reservation picks a random room #.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants