Java程序辅导

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

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
lab 01B Lab 01B I frequently change the lab assignment just before class starts (and sometimes during class).   Try not to download the assignment until after class. Please read https://www.plagiarism.org/article/what-is-plagiarism. Code may be copied from the lecture notes or from web pages or from books     Copied code MUST include a citation (e.g. URL of the web page where the code is copied from)     Code that is copied and then modified MUST include a citation (e.g. URL of the web page where the original code was copied from)     Code copied from the lecture notes are not required to have a citation. You may NOT copy answers from another student. You may NOT allow another student to copy your answers. You may NOT turn in a team solution (e.g. 2 or more people work on the lab together and turn in multiple copies of the same lab). Help is available by:    READING THE LECTURE NOTES!    coming to a lab session (available only for in-person or zoom classes)    visiting the Magic Lab (https://www.mjc.edu/instruction/bbss/magic.php)    using Google or YouTube    sending me an e-mail    posting a note on the Canvas Q/A Discussion Board and hope that a student will write a response    sometimes a FREE tutor is available from the Library and Learning Center    join a study group OR gather up some folks and start your own study group To get 20 points for this lab, please read ALL of the instructions:     Java and/or NetBeans and/or a different IDE must be installed     Code must be written to print your name     The .java file (that contains the code) OR a zip file of the NetBeans project folder must be uploaded to Canvas     A screenshot showing your name in a terminal/console/output window must be uploaded to Canvas In this lab, you will install a Java development environment. Instructions: If you are NOT using a classroom computer nor using a Magic Lab computer, then please install the Java JDK or Java SE.      Pick ***ONE*** of these options:         Here is the quickest, easiest, and most fool-proof option:  How to install and use Java on the command line.         Here is another option that works for some, but not all, people:   How to install NetBeans and Java.          Here is the preferred option.  However, most students find the installation steps much too tedious:  HowToInstallJava         Here is another option.  However, most students find the myriad of choices extremely confusing:  HowToInstallAdoptJava         Use Google or YouTube or a legally-free Java book to find instructions on how to install the JDK or the SE.     CAUTION:  Most JDKs and most SEs are NOT free for commercial use. Create a Hello World Java application.  This application prints the words "hello world" to the console or terminal.     Pick ***ONE*** of these options:         Folks using the command line can read these step-by-step instructions:  How to install and use Java on the command line         Folks using Netbeans can read these step-by-step instructions:  How to install NetBeans and Java.         Use Google or YouTube or a legally-free Java book to find instructions.     Here is the Java code to print hello world.         public class HelloWorld {             public static void main(String[] args) {                 System.out.println("hello world");             }         } Get the Hello World application working.  Fix all bugs. Make a change to the code.  Instead of printing "hello world," print your name.     Example:  My application writes Edward Walsh Run the code. Take a screenshot of the console/terminal/output-window. Use these instructions to crop the screenshot:  http://walshe.faculty.mjc.edu/Virtual/HowToTakeScreenShot/001.html Here is my cropped screenshot. Your screenshot will print your name.  Your screenshot should NOT print the name Edward Walsh. Begin photo Screenshot of console/terminal/output-window.  The console is displaying Edward Walsh. End photo A Canvas bug started appearing in July 2021.  Canvas sometimes changes the name of an uploaded .java file.  This name change breaks the uploaded  Java application. If anyone uploads a .java file, please CAREFULLY read the confirmation message to make sure that the .java filename is not changed.  If Canvas changed the name of your .java file, then insert the .java file in a zip file and upload the zip file. Begin photo A Canvas bug sometimes changes the name of an uploaded file.  Immediately after uploading a .java file, Canvas displays the name of the uploaded file.  End photo CHECK YOUR CANVAS SUBMISSION!!!!   insert a blank USB drive into your computer    log on to Canvas    go to the lab assignment    download your submitted files    put your downloaded submitted files onto your USB flash drive    Folks, who are using Netbeans, should launch Netbeans, open the NetBeans project that is on the USB flash drive, and run the code.    Folks, who are using the command line, should launch command console, go to the USB flash drive, compile their .java file, and run their .java file See How To Avoid The Potholes When Submitting a Lab for additional information. Here is what to do if something goes wrong: * A very common mistake is editing a java file and running a totally different java file.  Please make sure to edit and run the same java file.  * If error messages appear on the screen, then read ONLY the first error message.  Please use Google to look up what the error message means.  Try to fix the error yourself.   If the error can't be fixed, then either send me an e-mail and/or post a question in the Canvas Discussion board. * NetBeans 8 is extremely old; it was NOT designed to run on Windows 10.  It is buggy on Windows 10.  You can either live with bugs or you can  switch to using the command line or you can install a new version of NetBeans or you can install a different IDE.  The command line is the easiest way to go. Help for the totally lost (These instructions work only for Windows10): Here is a video of me following these instructions:  https://youtu.be/aBAtrh1n8nw step 1:  Follow these instructions How to install and use Java on the command line. step 2:  Launch a cmd window step 3:  In the cmd window, type these 3 commands: set PATH=%USERPROFILE%/Downloads/jdk-11/bin;%PATH% cd %USERPROFILE%/Documents/myJavaProjects notepad HelloWorld.java step 4:  If the cmd window is frozen (i.e. no new commands can be typed), then hold down the CTRL or CONTROL key and press the C key.  This is known as a CONTROL-C. step 5:  In notedpad, edit the file so that your name is printed on the screen.  You will have use your brain to figure out what the code is doing.  The lecture notes will help.  For additional help, read http://myflex.org/books/java4kids/java4kids.htm.  Folks can also try Googling or YouTubing "java hello world.  HINT:  What line in HelloWorld.java prints "Hello World." step 6: In notepad, save your work (see How to install and use Java on the command line for instructions on how to do this) step 7: In the cmd window, type this command: javac HelloWorld.java step 8:  If  error messages appear, then scroll UP to the first error message.  Read the error message.  Folks who don't understand the error message, can copy and paste the error message into Google.  Fix the error and try again.  NOTE:  Fix ONLY the first error message. Anyone who can't get past this step should either visit the Magic Lab OR post their error message in the Canvas Q/A and Homework Help Board OR e-mail me  your .java file and your error message. step 9: In the cmd window, type this command: java HelloWorld step 10:  If  your name does NOT appear in the cmd window, then something went wrong.  Figure out what the problem is, fix the problem, and try again.  Anyone who can't get past this step should either visit the Magic Lab OR post their error message in the Canvas Q/A and Homework Help Board OR e-mail me  your .java file and your error message. step 11:  Take a screenshot.  Crop the screenshot.  Instructions to do this can be found here:  How to take a screenshot step 12:  If the cmd window is frozen (i.e. no new commands can be typed), then hold down the CTRL or CONTROL key and press the C key.  This is known as a CONTROL-C. step 13:  Launch Canvas.  Go to lab01B.  Upload BOTH your screenshot and your .java file. step 14:  Insert a blank USB drive into your computer.  Go to Canvas.  Download your submission onto your USB drive.  Do NOT change any files.  Do NOT rename any files.  Do NOT add any files.  Do NOT delete any files. step 15:  Launch a cmd window step 16:  Google "cmd cd to USB drive" to find out how to tell the cmd window to switch to your USB drive.  For most people, the command "d:" or the command "e:" will work. step 17:  Anyone who downloaded their .java file into a folder, will need to Google "cmd change folder" to find out how to tell the cmd window to change to the directory or folder that contains the .java file. step 18:  In the cmd window, type this command: dir If your .java file doesn't appear in the cmd window, then you are in the wrong folder.  Go to step 17. step 19: In the cmd window, type these 2 commands: javac HelloWorld.java java HelloWorld If any error messages appear then please return to step 1 and try again. step 20:  If the cmd window is frozen (i.e. no new commands can be typed), then hold down the CTRL or CONTROL key and press the C key.  This is known as a CONTROL-C. Deliverables Each .java files that you wrote. To avoid Canvas breaking your Java application by changing the names of your .java files, insert your .java files into a zip file. Cropped screenshot of the output of the application; your name should appear in the screenshot. If you used NetBeans or any other IDE, then please give me a zip file of the entire project folder.  Do NOT use 7z nor rar nor tar nor tar.gz. You may, if you want to, turn in one zip file that contains all the files.  Do NOT use 7z nor rar nor tar nor tar.gz. I STRONGLY recommend checking your Canvas submission:     insert a blank USB flash drive into your computer     launch Canvas     download your uploaded file(s) onto the USB flash drive     run your uploaded java files and verify the output looks ok     see How To Avoid The Potholes When Submitting a Lab for additional information