Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab 1 - Hello jGRASP! Name(s): Date:     Lab 1 - Hello, jGRASP! Algorithms & Data Structures I CSC 1051   Dr. Tom Way Introduction This lab is designed to introduce you to the fundamentals of writing computer code while working with the classic first program know as Hello, World! You'll learn to write a Java program, and troubleshoot common problems, using a professional caliber software tool. You should do this lab independently, though it's ok to discuss it with classmates as long as you aren't copying each other's work. When completed, submit your results to Blackboard for this specific assignment. Be sure to upload your materials with the correct file names as described below. Have questions or feel stuck? Ask for help from the instructor, TA, or peer tutor! Objectives Learn about jGrasp, an �integrated development environment� (IDE). Compile and run a Java program. Understand the relationship between Java class names and file names. Practice using basic Java output statements and adding "comments" to a program. Gain experience with typical errors that can occur in Java programs. Worth 100 points Due Monday, June 7, 2021 by 11:59 pm Lab Steps Part A - Up and Running Follow the instructions in the Using jGRASP topic in Rephactor to install the Java JDK and jGRASP software on your computer.   Create a folder on your computer to use for all the materials you will create for this course. A suggested approach is to create a folder called CSC 1051 and then a separate subfolder inside that for each assignment, in this case Lab 1.   Download and save HelloWorld.java into your Lab 1 folder. Run jGRASP, navigate to your Lab 1 folder, and open the HelloWorld.java file you just downloaded.   In jGRASP, compile HelloWorld.java by clicking the green plus button:   Note that you will now have a new file called HelloWorld.class in the same Lab 1 folder. This is a binary file that contains the Java executable code called "bytecode", so it isn't human readable. But if you're curious, you can open it and see what it looks like.   Next, in jGRASP, run your program by clicking the red runner button:   Observe the output of your program in the Run I/O tab.   Make sure you have the files HelloWorld.java and HelloWorld.class ready to submit later. Part B - Making Changes In jGRASP, select the View > Line Numbers menu choice to show line numbers for your code, which can make working with code a little easier.   Open HelloWorld.java if it isn't already open, edit the program so the the class is MyHelloWorld and try to compile it. What happens?   Next, select File > Save As. Accept the suggested file name of MyHelloWorld.java and click Save. Try to compile and run it now. What happens this time?   Modify or add comments (see the Rephactor Comments topic for ideas) at the top of the program to include your name (you are now the Author) and today's date. Compile and run it one more time to make sure it still works.   Make sure you have the files MyHelloWorld.java and MyHelloWorld.class ready to submit later. Part C - Attracting Bugs In this part of the lab, you will experiment with introducing Programming Errors or "bugs" in your program. Programmers spend a lot of time "debugging" code, so this will give you some experience with the very bugs you later will be fixing.   Download and open the file MyHelloWorldBugs.txt in jGRASP. Follow each of the steps in the file, recording the Error Type you observe.   For each of the listed items in MyHelloWorldBugs.txt, make the specified modification to your MyHelloWorld.java program, try to compile and run it, and indicate the Error Type you observe: syntax, runtime, logic or no error. After you report the Error Type you observed, fix the bug (undo the change you made) before moving on to the next item.   Make sure you jave the file MyHelloWorldBugs.txt ready to submit. Part E - Lab Submission When you have completed this lab, find the Lab 1 assignment on Blackboard and submit the following files: HelloWorld.java HelloWorld.class MyHelloWorld.java MyHelloWorld.class MyHelloWorldBugs.txt   Lab 1 Evaluation Name(s): Date: For reference, this is how points are awarded for all the parts of this assignment. Criteria Worth Score Part A (20 points) Correct name of .java file 5   Correct name of .class file 5   Correct output when run 10   Part B (45 points) Correct name of .java file 10   Correct name of .class file 10   Comment includes Name 10   Comment includes Date 10   Correct output when run 5   Part C (35 points) Item 1 - change println to print 5   Item 2 - change 2nd println to printing 5   Item 3 - remove a semicolon 5   Item 4 - remove last brace 5   Item 5 - change "main" to "man" 5   Item 6 - programmer's choice 10   Total 100