Midterm is coming up! What could be on the test? Here are some questions that ask what we have learned so far.
You want to let the viewer to be able to understand and trace every part of the source code.
By using a wildcard, this makes the viewer unable to help resolve issues, if there are in
your code, because the viewer does not know what you imported.
2. Why is a FizzBuzz program being used as an entry question to any programming job?
There are people who know a whole lot about programming, but not a lot about writing
source code. FizzBuzz weeds out those type of people at a programming job interview.
3. What is it called when someone watches tv, checks their phone, checks their email, checks their myspace, and trying to do their programming all at the same time? As a programmer, why is this bad?
Multi-tasking. For a programmer this is bad because their focus is not 100% on their work.
If a programmer does not have full focus on their work then the code will not have high
quality also.
4. Write a FizzBuzz program, but instead of using for loops and while loops, do it recursively.
public class RecursiveFizzBuz {
private static int x = 1;
public static void main(String[]args){
recursive();
}
public static void recursive(){
if (x != 101){
if((x % 15) == 0){
System.out.println("FizzBuzz");
} else if ((x % 3 )== 0){
System.out.println("Fizz");
} else if ((x % 5)==0){
System.out.println("Buzz");
} else {
System.out.println(x);
}
x++;
recursive();
}
}
}
5. What is open source software? What is so good about it?
Open source software is source code that is viewable to the public and is open for the public
use. The public can use, change, and improve the software, and redistribute it. What is
so good about it is that any one can help improve the code because the code is viewable.
6. In a forum, does a subject "HELP!!!!!" give you any insight of what that person needs? Is this a proper subject line? What should be a proper subject line?
No. No. A proper subject line should describe something fully and precisely on what you
need help on.
7. Why would you test your own code? What are three types of testing?
You should test your code to see that your code is doing what you want it to do. Acceptance,
behavioral, and unit.
8. What is so good about ANT? What are some things that ANT does?
ANT is a java-based build tool that checks your project and says if your project is ready to
be distributed. Some things is that it checks your source code, byte code, and runs
tests.
9. Why should you comment your code? Is updating your comments important? Why?
You should comment your code to state what is going on in certain areas of the code, what
the program is about, and why it is doing what it is doing. Yes, it is important because
if you do not update your code then whoever is looking at your code is trying to figure
what is going on, they will read that comment, and that comment and the code will not
match each other.
10. What is subversion and why is it helpful.
Subversion is a free open source version control system. It is helpful because it manages
files and directories and the changes made to them. The owner can keep track of what
has changed, and backup to older versions of the code if they want to.