Part 1: Written Exercises (10 points) Note: The answers to the following questio
ID: 3628181 • Letter: P
Question
Part 1: Written Exercises (10 points)Note: The answers to the following questions should be typed in the block of comments in the Assignemnt1.java file. Please make sure they're commented out (green). Type them neatly and make them easy to read for the graders.
Exercise: Which of the following are not valid Java identifiers? Why? (2 pts each)
a. 5thLevel
b. level5
c. MIN_VALUE
d. highest$
e. you&me
Part 2: Programming (10 points)
Entering, compiling and running a Java program:
Please read through the Lab 0 (zero) posted in the blackboard to set up your Java compiler and IDE. The following is based on the assumption that you have already learn how to use your IDE (explained in the Lab 0), including how to save, compile, and execute a Java program.
Print the source file Assignment1.java by clicking on the file name. Stepwise instructions for this assignment are given below.
1. To develop Java programs, you need a text editor. Use a text editor of your choice to enter the source code as a text file named Assignment1.java.
2. There are numerous opportunities for errors in any program. Many times places that seem simple require close attention. Experiment a little with the Assignment1 program.
The following three questions are for you to experiment. (you don't need to submit your answers)
Edit the file by re-naming the class name from "Assignment1" to "Assignment" and then save and re-compile.
Question #1: What is the error message?
Fix the error by re-editing and saving the file. This is called syntax error.
3. Delete one of the closing braces in your source code. Save and re-compile the program.
Question #2: What is the error message?
Fix the error by re-editing and saving the file.
4. Delete the semicolon at the end of first System.out.println statement.
Question #3: What is the error message? Is this an example of syntax error or logical error?
Fix the error by re-editing and saving the file.
5. Now add more code to this Assignment1.java file to print, on separate lines, your name, your favorite hobbies, and your favorite movie. Label each piece of information in the output, for instance:
My Name is Jane Doe
For this and all subsequent assignments, provide a heading (in comments) which includes:
The assignment number.
Its author (your name).
Your Lab Letter.
A description of what this program is doing.
Grading Criteria for the part 2:
2 pts : it contains header information
3 pts : it compiles
1 pt : it runs/executes
1 pt : it prints the name
1 pt : it prints favorite hobbies
1 pt : it prints favorite movie
1 pt : it outputs as expected and nicely formatted (name, hobbies, and movie printed in different lines)
Deduction: if code has poor style (indentation, spacing, etc.) then -2 points will be deducted.
-------------------------------------------------------------------------
// Assignment 1
// Name: Your Name
// Lab: Your Lab Letter (A,B,C,D,or D - please check the syllabus)
// Description: a description of what this program is doing
//-------------------------------------------------------------------------
/*************************************************************************
Part 1:
Write your answers for the part 1 here.
*************************************************************************/
public class Assignment1
{
public static void main(String[] args)
{
System.out.println("**************************************");
System.out.println(" You can break a long string into " +
"parts and join them with a + symbol " +
"But it is not okey to go to the next line in a long String");
// plus is used to concatenate strings
System.out.println();
System.out.println("The first computer was invented about " + 55 +
" years ago ");
}
}
that gos with part 2
Explanation / Answer
you can't ask for a program to be made on cramster. here is a link that can help you program: http://math.hws.edu/javanotes/