Homework 1: Written Questions
This assignment includes written questions, and you answer them with your partner. Work through them together, in the same way you pair on the code—do not split them up between you.
Either of you can type the answers in. Whoever saves last is what we see, the page says who saved it and when, and every earlier version is kept, so nobody can lose the other's words by editing over them.
You don't need to finish answering these questions before you start the next part.
Dive into the coding part with your partner in lab and come back to these questions later!
Question 1 – GitHub and the Command Line
Question 2 – Scenarios
Based on the syllabus and the in-class discussion, find the best classification for each of the following scenarios
Question 3 – Testing
Suppose you were asked to test a function called absFloor. The function takes a double as input and returns a double. It is supposed to return the absolute value of the given value, rounded down to the nearest whole number.
Here is a correct implementation of this function:
double absFloor(double x) {
double abs;
if (x < 0) {
abs = -x;
} else {
abs = x;
}
return floor(abs);
}
Give three different incorrect implementations, and, for each one, a test (input and expected output) that the incorrect implementation would fail.
(When logged in, completion status appears here.)