Skip to content

Conversation

amanzan1
Copy link

@amanzan1 amanzan1 commented Feb 8, 2018

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? I used variables, for example when someone entered a number it was stored as first_num and the second number, sec_num.
How did you determine what operation to perform? The operation that was performed was determined by what the user entered as input. If the user input matched a certain requirement in the conditional statement, then it would perform that one specific operation based upon user input.
Do you feel like you used consistent indentation throughout your code? I feel like I started off with inconsistent code and then looked at good examples and corrected indentation.
If you had more time, what would you have added to or changed about the program? I I think it would have been fun to add the square root or power function.

@amanzan1
Copy link
Author

amanzan1 commented Feb 8, 2018

There does not seem to be a header.

@amanzan1 amanzan1 closed this Feb 8, 2018
@amanzan1 amanzan1 reopened this Feb 8, 2018
@CheezItMan
Copy link

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Check
Baseline
Readable code with consistent indentation. Good consistent indentation!
Summary You hit all the requirements, nice work!

choice == "divide" || choice == "/"
puts "You chose division"
else
puts " Calculator does not accept that input."

Choose a reason for hiding this comment

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

Instead of just an if could you wrap this in a loop, until they entered a choice on the list? We did something similar in the textbook notes complex conditionals.

end

puts "Please give me your first number"
first_num = gets.to_f

Choose a reason for hiding this comment

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

Similarly, is there anything you could do to ensure that the user enters a number?

num = ""
until num.to_i.to_s == num
  puts "Please enter a number"
  num = gets.chomp
end

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