[Solved] SOLVED:Lab Assignment #1 Activities Solution

30 $

File Name: SOLVED:Lab_Assignment_#1_Activities_Solution.zip
File Size: 414.48 KB

SKU: [Solved] SOLVED:Lab Assignment #1 Activities Solution Category: Tag:

Or Upload Your Assignment Here:


1. Answer the following questions from Chapter 1 of your textbook. (10 points)QuestionYour AnswerWhat is the importance of the JVM? (2 points)What is the Java source filename extension?What is the Java bytecode filename extension?What is the statement to display the message “Hello World” on the console? (2 points)What is the Java statement to display the message “Hello World” in a GUI message dialog box? (2 points)What is the command to compile a Java program?CIS 2571: Introduction to JavaLab AssignmentCollege of DuPage 2 CREnglandWhat is the command to run a Java program?2. Answer the following questions from Chapter 2 of your textbook. Identify any needed import statements. (6 points)QuestionYour AnswerWhat is (are) the Java statement(s) to prompt the user to enter an input using a GUI dialog box? (4 points)What is the Java statement to convert a string to an integer?What is the Java statement to convert a string to a double?3. Answer the questions in the spaces provided. Identify any needed import statements. (7 points)QuestionYour AnswerIdentify the Java statements to properly create an input object connected to the console and read input data for a(n): (5 points)• integer of the int type• number of the float type• string of text ending with whitespaceWhat is the Java statement used to cast a value of type float to an int?What is the Java keyword used to identify a named constant?CIS 2571: Introduction to JavaLab AssignmentCollege of DuPage 3 CREngland4. On your own, create a Java program to solve the Chapter 2 Programming Exercise 2.3 (Converting feet into meters) on page 75 of your textbook. Use an approach that gets input from the console and displays output to the console.a. Create the source code file, Feet2Meters.java. Add a block comment at the top of the file to identify your name, file, date, class, assignment, and short description of the program. (8 points)public class Feet2Meters {public static void main(String[] args) {// Enter footjava.util.Scanner input = new java.util.Scanner(System.in);System.out.print(“Enter a value for feet: “);double feet = input.nextDouble();double meter = feet * 0.305;System.out.println(feet + ” feet is ” + meter + ” meters”);}}b. Compile the source code until no errors are found. The Java bytecode file Feet2Meters.class should be created.javac Feet2Meters.java• Common Errors: http://www.cs.armstrong.edu/liang/intro9e/debug.html• Setting the Environment Variable (See Section 1.3.1; our path is C:Program FilesJavajdk1.7.0_XXbin): http://www.cs.armstrong.edu/liang/intro9e/supplement/Supplement1bInstallingJDK7.pdfc. Run the Java bytecode and observe the results.java Feet2Metersd. Attach a printout of your source code.e. Attach a printout of your sample output. (2 points)Copying a Window to the Clipboard for Pasting and Printing• Point and click the mouse to an active window (window you want to capture)• Press “ALT + Prt SC”• Open “WordPad” (Start, All Program, Accessories, WordPad) or “MS-Word” (Start, All Program, Microsoft Office, Microsoft Word)• Choose Edit, and click on Paste. (Now the window should appear on your document)• Hit • Save it into a file and print it out.CIS 2571: Introduction to JavaLab AssignmentCollege of DuPage 4 CREngland5. On your own, create a Java program to solve the Chapter 2 Programming Exercise 2.3 (Converting feet into meters) on page 75 of your textbook. Use an approach that gets input from a dialog box and displays output in a dialog box.a. Create the source code file, GUIFeet2Meters.java. Add a block comment at the top of the file to identify your name, file, date, class, assignment, and short description of the program. (12 points)b. Compile the source code until no errors are found. The Java bytecode file GUIFeet2Meters.class should be created.javac GUIFeet2Meters.java• Common Errors: http://www.cs.armstrong.edu/liang/intro9e/debug.html• Setting the Environment Variable (See Section 1.3.1; our path is C:Program FilesJavajdk1.7.0_XXbin): http://www.cs.armstrong.edu/liang/intro9e/supplement/Supplement1bInstallingJDK7.pdfc. Run the Java bytecode and observe the results.java GUIFeet2Metersd. Attach a printout of your source code.e. Attach a printout of your sample output. (5 points)Copying a Window to the Clipboard for Pasting and Printing• Point and click the mouse to an active window (window you want to capture)• Press “ALT + Prt SC”• Open “WordPad” (Start, All Program, Accessories, WordPad) or “MS-Word” (Start, All Program, Microsoft Office, Microsoft Word)• Choose Edit, and click on Paste. (Now the window should appear on your document)• Hit • Save it into a file and print it out.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Lab Assignment #1 Activities Solution
30 $