\begin{homeworkProblem}
	\section{Program Structure and Scope}
	
	Program structure and scope define what variables are accessible and where. When inside a class, there are many different cases of scope, however those are better defined in chapter 7. 
	
	\subsection{Program Structure}
	
	A Dice program may exist either within one source file or spread among multiple files which can be linked at compile-time. An example of such a linked file is the standard library, or $stdlib.dice$. When an include statement is executed at compile time, it will compile all classes in the included file along with the classes in the file on which the compilation was run. Therefore at compilation, one only needs to compile with $dicec master.dice$. If an included module defines a class that has the same name as one of the classes defined in the including module, then the compiler throws an error. The compiler does not resolve recursive includes; if $foo.dice$ includes $bar.dice$ and $bar.dice$ includes $foo.dice$, the compiler throws an error.\\
	
	A program consists of zero or more include statements, followed by one or more class definitions. Each class defined in a module must have a distinct name. Classes cannot have two methods with the same name regardless of the method's signature. Only one class out of all classes may have a main method, defined with \textit{public void main(char[][] args)} which designates the entry point for a program to begin executing code. All Dice files are expected to end with the file extension $.dice$ and follow the following syntactic layout. \\
	
	Scope refers to which variables, methods, and classes are available at any given time in the program. All classes are available to all other classes regardless of their relative position in a program or library. Variable scope falls into two categories: fields (instance variables), which are defined at the top of a class, and local variables, which are defined within a method. Fields and methods can be public or private. If a field or method is public then it is accessible whenever an instance of that class is instantiated. Private fields and methods are only accessible within the same class.\\
	
	Local variables are variables that are declared inside of a method. Local variables are only accessible within the same method in which they are declared, and they may have the same name as fields within the same class since fields in a class are only accessible by calling the $this$ keyword.\\
	
\end{homeworkProblem}
