ITP 120 Module 1 Laboratory ITP 120 Module 1 Laboratory Welcome to ITP 120 Your first step in the class is get the software unzipped. If you are on Windows, this is just an unzip directly to the c:...

1 answer below »
See file attached


ITP 120 Module 1 Laboratory ITP 120 Module 1 Laboratory Welcome to ITP 120 Your first step in the class is get the software unzipped. If you are on Windows, this is just an unzip directly to the c: drive of your computer. IT MUST BE DIRECTLY ON THE C: DRIVE. Go to the Modules tab in Canvas and go to the very bottom where you will see the following. Follow the instructions in the document on how to get the software and how to unzip it. Play with the software! Use this document as your guide throughout the semester. There will also be debugging movies that we will refer to during the semester. MAC FOLKS – you will need to download the Java SDK and Eclipse for Mac. Check this document for help. https://www.cs.dartmouth.edu/~scot/cs10/mac_install/mac_install.html We will also have a discussion thread so you can help each other. Eclipse is an open-source Java IDE originally created by IBM and now maintained by eclipse.org (great site to go to for information about this software). It is a great tool. We will concentrate on how to use it for client-side Java applications. We will cover a lot of Java programming in this course. The goal is not to make you a complete Java programmer as much as to let you see a lot of code so you can alter it for your needs. Expect to read a LOT of Java code and to alter a LOT of Java code. My programs will be heavily laden with comments on the how’s and why’s. Use your textbook as a reference only. Spend time really running and studying the examples I provide to understand why they do what they do. Although the textbook is important, you do not become a Java programmer by reading text! In the Modules tab of the portal, under Module 1, you will find the following: Open this and follow the instructions there. you will find an entry for Mod 1 Lab. It will have links to a number of files that you will need. Open up Eclipse. Write down the name of the folder where your workspace will be and click OK. After Eclipse comes up, create a project named mod1ch1_2. Import the jar file (itp120mod1_19_20.jar) that you downloaded above. Note that the import brought in two Java packages. Yours should look like: In future chapters I will probably have two separate jars to import – one for the book examples and one for my samples. In this module, I put them together in one jar file. You will see one package with the actual examples from the text and an additional package with my extra examples. This package will often also include some start files. This last package is the one you will send back to me. It must be renamed before you sent it so now is a great time to do so. Right-click on mod1wolffexamples and choose to Refactor( Rename. In the Rename Package dialog box change the name Use the first letter of your first name followed by your last name and the module number as I have above. Click OK. On the next dialog, just click Continue. The package named should have been changed. NOTE: You will also need to use this same name for the jar file when you export it. See the eclipseOxygen10instructions.doc document for details on how to do this. IF YOU ARE SEEING A BIN OR SRC FOLDER IN ADDITION TO THE SCREEN SHOT ABOVE, YOU DID NOT CREATE YOUR ORIGINAL PACKAGE CORRECTLY. GO BACK TO THE INSTRUCTIONS AND TRY AGAIN. YOU MUST DO THIS STEP CORRECTLY OR I CANNOT GRADE YOUR ASSIGNMENT! I will have minimal comments in the lab documents (like this one) about the book code since the authors do an outstanding job of that. I will just emphasize some things to concentrate on when looking at these. I will then discuss the additional package(s) and samples that I have added. In my examples, I will add a LOT of inline comments. Make certain to read and understand these. You should leave my comments in the file and just write your code underneath my comments. So for many programs there will be my comment, your line of code, my comment, your line of code, etc. This is great for documentation! You will use these as your start for the lab materials. In the lab assignment, make certain to write your comments about the module in the text box before you submit it (see the syllabus for information on what to include). THIS IS WORTH 5 POINTS!!! I am totally revamping this course this semester. I am combining book code, extra examples, old and new materials, etc. and you can help me make it more understandable. I really do appreciate it! When you have completed the steps below, attach your jar file with the package name changed and the correct jar file name back in the Assignment. Add your comments to the textbox (worth 5 of the points) and submit it back through the portal. And have fun! NOTE: the To do: marks the steps that have programs that you will be turning in. You can add extras (like money formatting, etc) if you like. Play with the code! 1. You should have installed Eclipse and become familiar with its use. Import the jar file for this module. 2. Scan through the two chapters in the book for an overview. 3. Watch the Power Point movie (located under the “Movies for Module 1” entry in Canvas) for the two book chapters. You can stop the movie, refer to the textbook sections being discussed, and play with the actual programs you have imported into Eclipse if you like. 4. Now we will look at some other examples and start working on the lab that you will submit for this module. Open up the arrow in front of our examples package (the one whose name you changed above) to see the individual programs. 5. Double-click on the program named Comments. Look at the code. Note the package name that must be the top line of the code. Double-click on the program name on the top tab to make the code full screen. Double-click on it again to make it normal sized. Run the Comments program in the .jar file. To run this program, single-click on this class name in the left Package Explorer. Then from the tool bar, choose Run ( Run as ( Java Application. The program will run and any Console output will show at the bottom of the screen in the Console view. Look at the output. 6. Now go to the file folder on your computer that you wrote down in the instructions at the top. Note that in the workspace, there is a package created named dwolffmod1 (although yours will have the new package name since you should have changed it already) that has the Comments.java program in it. In the file folder on the computer, there is a folder named dwolffmod1 and has both a Comments.java and a Comments.class in it. The .java file is the source code and the .class file is the compiled code. Note that if you had a package named a.b.c, it would be in the workspace in a folder named “a” that has a folder in it named “b” that has a folder in it named “c” that has the java code in it. Therefore, the Windows folder structure mimics the Java package structure. 7. To do: Double-click to open the program Comments2. Fix it both for syntax errors and correct indentation. Make certain to save it (CTRL-S) – if you do not, you will get a popup window asking you if you want to do so. In eclipse, execute it. Use the CodeConventions.pdf file from the portal under this assignment during the semester as your guide to correct indentation. I follow most of these rules and expect you to as well, although I will be somewhat flexible on indentation, as long as it is readable. Throughout the course, refer to CorrectingErrors.doc to help with removing problems!!!! (Under this assignment in the portal). 8. To do: Double-click to open the program Comments3. Run it (it runs!!). Now use “correct indentation” to make it more readable. NOTE: Many people use public static void main(String[] args) { // lines of the method } And others use public static void main(String[] args) { // lines of the method } Both are correct. 9. Export the package as a jar file. Save it somewhere on your computer (it does not matter where –but note where it is). NOTE: since there are two packages in the project, if you click at the project level before exporting, the jar file will contain both packages. If you click on a specific package, it will only contain that package and if you click on a specific class, it will only contain that class. We want to click on the package whose name you changed. Make certain when exporting, that you include the source files. 10. Now we need to practice creating new projects. Delete the project from both the workbench and the file system (see the eclipseOxygen10instructions.doc document for information on deleting projects). 11. Create a new project (it does not matter what you name it – project names are not a standard Java thing but an Eclipse thing and are not carried into the jar files). Now import your jar file that you saved. You might be asked if you want to overwrite the classpath. Just say yes. Your package should be back in Eclipse and you should be able to see your programs. 12. Practice importing and exporting jar files, editing Java files, and creating simple Java applications until you feel comfortable with this!! You do NOT want to lose applications later by doing this incorrectly!!!!! Remember –
Answered Same DayMay 29, 2021ITP120

Answer To: ITP 120 Module 1 Laboratory ITP 120 Module 1 Laboratory Welcome to ITP 120 Your first step in the...

Aditya answered on May 30 2021
137 Votes
Comments2/build.xml

Builds, tests, and runs the project solution.


Comments2/build/classes/.netbeans_automatic_build
Comments2/build/classes/.netbeans_update_resources
Comments2/build/classes/mod1wolffexamples/Comments2.class
package mod1wolffexamples;
public synchronized class Comments2 {
public void Comments2();
public static void main(String[]);
}
Comments2/build/classes/mod1wolffexamples/Comments3.class
package mod1wolffexamples;
public synchronized class Comments3 {
public void Comments3();
public static void main(String[]);
}
Comments2/build/classes/mod1wolffexamples/Ex6WinningPercentage.class
package mod1wolffexamples;
public synchronized class Ex6WinningPercentage {
public void Ex6WinningPercentage();
public static void main(String[]);
}
Comments2/build/classes/mod1wolffexamples/PrimitiveTypes.class
package mod1wolffexamples;
public synchronized class PrimitiveTypes {
public void PrimitiveTypes();
public static void main(S
tring[]);
}
Comments2/build/classes/mod1wolffexamples/Restaurant.class
package mod1wolffexamples;
public synchronized class Restaurant {
public void Restaurant();
public static void main(String[]);
}
Comments2/build/classes/mod1wolffexamples/StockSales.class
package mod1wolffexamples;
public synchronized class StockSales {
public void StockSales();
public static void main(String[]);
}
Comments2/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Comments2/nbproject/build-impl.xml








































































































































































































Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar




































































































Must set javac.includes
































































































































No tests executed.




























































































...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here