{% highlight java %} /** * --------------------------------------------------------------------------- * File name: DataPrimitiveExercises.java * Project name: Winter Study Guide * --------------------------------------------------------------------------- * Author’s name and email: Michael Schneider, schneidm@etsu.edu * Course-Section: All * Creation Date: 12/12/15 * Last modified: Schneider 12/13/15 schneidm@etsu.edu * --------------------------------------------------------------------------- */ /** * Class Name: DataPrimitiveExercises
* Class Purpose: To give examples on declaring and initializing * variables using the primitive data types
* *
* Date created: 12/12/15
* Last modified: Schneider 12/13/15 schneidm@etsu.edu * @author Michael Schneider */ public class DataPrimitiveExercises{ public static void main(String[] args){ //Declare a char and initialize it with a value of m char letter = 'm'; //Declare a boolean and initialize it with a value of false boolean valid = false; //Declare a float and initialize it with a value of 72.3 float small = 72.3f; //Declare an int and initialize it with a value of -32 int wholeNumber = -32; //Interpret what data type is needed for each question. //1. Create a variable that can keep track of sales tax of 9.5% //2. Create a variable that can keep track of the current day of the month //3. Create a variable that can keep track of a person's middle initial } } {% endhighlight %}