General Summary: This simple exercise is meant to verify that you’ve properly installed Java SE and an IDE on your computer so that you are ready for the later programming assignments in this course. Assignment Description: Type the following program source code into your jGRASP (or other) IDE. The source code is patterned after a similar example that was taken from Joyce Farrell’s textbook, Java Programming. Modify the comments for your name and the current date, and change the class file name to reflect your first name.
Then compile your code. Remember: If you get compile errors when you do the compile, fix the errors one at a time and then recompile the program. Because the compiler may get confused by the first error, very often, by fixing the first error, many of the remaining errors will go away since they may not really be errors at all. /** * Program #1 * * Function: Simple Java application to demonstrate the behavior of different data types, * arithmetic, concatenation, and output of results. * * Programmed By: Reggie Haseltine, instructor (November 13, 2015) * * Based upon code Taken From: "Java Programming" by Joyce Farrell * */ public class Program1_Reggie { public static void main(String[] args) { int xx = 315; short xx = 23; long xx = 1234567876543L; int value1 = 43, value2 = 10, sum, difference, product, quotient, modulus; boolean isProgrammingFun = true; double doubNum1 = 2.3, doubNum2 = 14.8, doubResult; char myGrade = 'A', myFriendsGrade = 'C'; System.out.println("Our grades are " + myGrade + " and " + myFriendsGrade); doubResult = doubNum1 + doubNum2; System.out.println("The sum of the doubles is " + doubResult); doubResult = doubNum1 * doubNum2; System.out.println("The product of the doubles is " + doubResult); System.out.println("The value of isProgrammingFun is " + isProgrammingFun); System.out.println("The value of isProgrammingHard is " + isProgrammingFun); System.out.println("The int is " + oneInt); System.out.println("The short is " + oneShort); System.out.println("The long is " + oneLong); sum = value1 + value2; difference = value1 - value2; product = value1 * value2; quotient = value1 / value2; modulus = value1 % value2; System.out.println("Sum is " + sum); System.out.println("Difference is " + difference); System.out.println("Product is " + product); System.out.println("Quotient is " + quotient); System.out.println("Modulus is " + modulus); System.out.println("nThis is on one linenThis on another"); System.out.println("This showsthowttabstwork"); } // end method main } // end class Program1_Reggie Deliverables: Put everything in a single Word or PDF file, number your steps, and keep the steps in order. At the top of your Word or PDF file include the course, the program number, your name, and the date completed.
Also, include this information in the source code program header of your modified source code file. Include additional comments as necessary in your source code, and maintain consistent indentation for good programming style, as shown and discussed in our text. Submit only your modified source code and final output. Do not submit the original supplied source code. Include the following three items in your file, number them, and put them in this order: A screen snapshot of a portion of your Java source code in your IDE for each class of your program The complete source code listings for all of your Java classes Screen snapshots of your complete program output
Get Free Quote!
443 Experts Online