Skip to content

Comments

Shelan#29

Open
sheland wants to merge 3 commits intoAda-C10:masterfrom
sheland:master
Open

Shelan#29
sheland wants to merge 3 commits intoAda-C10:masterfrom
sheland:master

Conversation

@sheland
Copy link

@sheland sheland commented Sep 10, 2018

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? I created a module that represent the Hotel and 3 classes that represented the hotel rooms (all rooms), room (representation of a single room), and reservation (representation of single reservation).
Describe a concept that you gained more clarity on as you worked on this assignment. I gained greater understanding about the relationship between classes and how they communicate with one another.
Describe a nominal test that you wrote for this assignment. I wrote a test that expect the list of rooms (array length) to equal 20.
Describe an edge case test that you wrote for this assignment. I wrote a test that raised an error if there were less than 1 rooms (for the list_room method).
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I made more sense to me when I wrote pseudocode because it allowed me to see the "flow" of information and how objects communicated between various classes. This is the first time really realizing the power of writing test first and then code. It allowed to to create guideline/constraints (which I needed) that ensured that I was coding what I was supposed to.

@sheland
Copy link
Author

sheland commented Sep 10, 2018

I was only able to complete wave 1

@CheezItMan
Copy link

CheezItMan commented Sep 13, 2018

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Only three commits?
Answer comprehension questions Check, glad pseudocode helped
Design
Each class is responsible for a single piece of the program Your Reservation class seems to be trying to reserve rooms, which is outside it's scope, see my inline notes.
Classes are loosely coupled Not many classes yet, so yes.
Wave 1
List rooms Check
Reserve a room for a given date range Not there yet
List reservations for a given date Not there yet
Calculate reservation price Check
Invalid date range produces an error Not there yet
Test coverage 36%
Wave 2 INCOMPLETE
View available rooms for a given date range
Reserving a room that is not available produces an error
Test coverage
Wave 3 INCOMPLETE
Create a block of rooms
Check if a block has rooms
Reserve a room from a block
Test coverage
Fundamentals
Names variables, classes and modules appropriately Check
Understanding of variable scope - local vs instance Check
Can create complex logical structures utilizing variables Not demonstrated in this project
Appropriately uses methods to break down tasks into smaller simpler tasks Check
Understands the differences between class and instance methods Not demonstrated in this project
Appropriately uses iterators and enumerables Not demonstrated in this project
Appropriately writes and utilizes classes Somewhat demonstrated
Appropriately utilizes modules as a mechanism to encapsulate functionality Check
Wrap Up
There is a refactors.txt file MISSING
The file provides a roadmap to future changes MISSING
Additional Feedback You clearly didn't get far. When you are this stuck, it's critically important to reach out and get help. We're going to see if we can hook you up with tutoring and I'd like to talk about an alternative assignment over the break week to work on your Ruby skills before we get too deep into Rails.

@@ -0,0 +1,57 @@
require_relative 'spec_helper'

Choose a reason for hiding this comment

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

This filename is wrong. Check out the Rakefile the file name should end with _spec.rb not _specs.rb

Otherwise good initial set of tests

end
return @reservations
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 check your indentation!


def reserve_room(check_in, check_out, room_num)
#reserves a room for a given date range
in = Date.parse(check_in)

Choose a reason for hiding this comment

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

You are using a keyword here, in means something special in Ruby so you can't use it for a variable name.

out = Date.parse(check_out)
@range = (out - in)

if @reservations[@rooms.last] == room_num

Choose a reason for hiding this comment

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

I'm not sure what this if statement is trying to accomplish. I think what you want to do is loop through all your reservations and check to see if:

  1. The reservation has the same room number and
  2. The dates conflict with the dates given as arguments.

If none do, then you can create a new reservation instance and add that to the list of reservations. Otherwise indicate an error.

However this really isn't the job of an individual Reservation instance (the method here is in the wrong class). Instead making reservations is a job of some kind of booking manager. A Reservation class should describe all the things you could ask an individual reservation (does it conflict with a given date range, what's the room #, how much does it cost etc).

end


def total_cost_reservation(check_in, check_out)

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,5 @@
{

Choose a reason for hiding this comment

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

Don't add your coverage to github

end

it "reserve_room method returns a hash" do
expect(@reservation.reserve_room).must_be_kind_of Hash

Choose a reason for hiding this comment

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

Why would reserve_room return a hash? Also would you ask a reservation instance to reserve a room?


def set_up_reservations #sets reservation's key to room #s
@reservations = {}
@reservations.each do |key, value|

Choose a reason for hiding this comment

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

What is this method trying to do? Why have a hash of reservations and why have each element point to a list of all the rooms.

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