-
Notifications
You must be signed in to change notification settings - Fork 11
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
Assignment submission #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assigned to your pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address all of the comments.
@@ -9,7 +9,7 @@ int main() { | |||
int average_pig_weight = 150; | |||
int average_cow_weight = 300; | |||
|
|||
int total_weight = num_pigs * average_cow_weight + num_cows * average_cow_weight; | |||
int total_weight = num_pigs * average_pig_weight + num_cows * average_cow_weight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While not required, I do think that if you put ( ) around "num_pigs * average_pig_weight" and again around "num_cows * average_cow_weight" it would make it easier for humans to read.
int price_avocado = 3; | ||
int price_tomato = 1; | ||
int num_avocados = 3; | ||
int num_tomatoes = 2; | ||
// Step 1: Prompt the user to input the number of tomatoes and avocados required. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cout << "How many tomatoes?" << endl;
cin >> num_tomatoes;
This is how I would write a prompt for a user's input to assign a value to the variables. Currently your variable values are static, so you would have to edit the code to change them, rather than run the program again.
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static values instead of prompts throughout utilizing cout and cin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assigned to your pull request
No description provided.