Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

&& Brittany Jones Ampers #33

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

brittanyrjones
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? One design decision was creating the room class. After creating a Room class during Wave 1, I realized the room class does not serve a good purpose. In the early stages of the project i thought I needed a room class to store the rooms and cost per night. The room would have no behaviors so when I went to code there was no need for it and the behaviors would primarily be on the hotel class. I wrote most of my code using a room class, and when I tried to get rid of it it caused a lot of issues in my code, and I ran out of time to write better code. Once I got stuck, I decided to simplify my design and get rid of the room class.
Describe a concept that you gained more clarity on as you worked on this assignment. Overall design. Designing the code from scratch was insightful, I learned the hard way that it is not worth the time to design a code completely(room class issues), and then change the design. I had a hard time when there was the room class and deleted admin class because I realized that my tests and codes started to depend upon each other a lot. It caused a lot of confusion for me because I could not make any simple changes or additions without breaking everything. I also gained more insight on using gist, I learned that the file changes colors when everything has been properly saved and you make changes. I explored git log and status, and I googled some information on git reverting changes and commits(which totally ruined my file). It helped to cement the concept of frequent commits with good messages.
Describe a nominal test that you wrote for this assignment. a nominal test i wrote was create multiple reservation which tested to see if when multiple reservations were made that the reservations array contained them all
Describe an edge case test that you wrote for this assignment. An adge case would be returning 0$ if there was no nights spent.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I could have done more pseudocode. I feel that i did, but I still ended up making a lot of changes at the last minute, which could have been avoided if I spent more time designing.

@CheezItMan
Copy link

CheezItMan commented Mar 19, 2018

Hotel

What We're Looking For

Feature Feedback
Design
Demonstrated classes having a single responsibility The Hotel class is doing too much, more can go to Reservation.
Demonstrated loose coupling Moderately loose coupling.
Methods demonstrate a good use of encapsulation, inputs and outputs Check
Wave 1 requirements Check
Wave 2 requirements You have some issues here, see my in-code notes.
Wave 3 requirements Unfinished
Summary There are a lot of issues here, your reservation code doesn't seem to be working properly. See my notes. Checkout our reference implementation

@@ -0,0 +1,51 @@
require_relative 'reservation'

Choose a reason for hiding this comment

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

You should have a module as well.

else

@rooms.each do |room|
room_number = rooms.sample

Choose a reason for hiding this comment

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

Why pick a random room each time?

@rooms.each do |room|
room_number = rooms.sample
reservations.each do |reservation|
if reservation_overlap?(reservation) == true

Choose a reason for hiding this comment

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

huh?

def reservation_overlap?(reservation)
check_in = reservation.check_in
check_out = reservation.check_out
return false if check_in >= check_out || check_out <= check_in

Choose a reason for hiding this comment

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

This doesn't seem to make sense. You're checking to see if the reservation's check in date is after the check-out date. Shouldn't that be in the Reservation class? Also why is find_available_room calling this method?

end

def one_night
if days_reserved - 1 == 0

Choose a reason for hiding this comment

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

Why is this method here?

@reservations = []
end

def find_available_room

Choose a reason for hiding this comment

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

Find an available room on what date? How can you know if a room is available if you don't know when.

describe 'can get list of reservations' do

it "will list all reservations during the time given" do
hotel = Hotel.new

Choose a reason for hiding this comment

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

You also need to test when it can't get a reservation, if all the rooms are reserved on a given date.

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