Menu

Write Simple Java Program Following Naming Structure Open Eclipse Create Workspace Called Q43860653

Write a simple Java program with the following namingstructure:

  • Open Eclipse
  • Create a workspace called hw1
  • Create a project called hw1 (make sure you select the“Use project folder as root for sources and classfiles”)
  • Create a class called Hw1 in the hw1 package (make sure youcheck the box that auto creates the main method).
  • Add a comment to the main that includes your name

Write code that demonstrates the use of each of the followingbasic Java commands.

Before each line or block of code add a comment with the numberof the task. For example, 1. below might look like this:

//1
System.out.print(“this is the easiest homework assignmentever!”);

  • System.out.print
  • System.out.println
  • Outputting a string literal
  • Using “t” and “n”
  • Using + to concatenate two things inside a print
  • Creating an int, double, boolean and char primitivevariables
  • Storing values into the previous variables
  • Creating a String object
  • Storing a string into the String object
  • Print all of the previously created variables and the Stringobject and separated by tabs
  • Show how to make a variable a constant
  • Create a Scanner object
  • Use the Scanner object to read from the keyboard an int,double, char and String and store the values into the previouslydeclared variables. (char is difficult. Research / Google how to dothis…)
  • Print the variables again, and separated by tabs
  • Use three of the Math class methods
  • Create a use a Random object to print a random number between10 and 20 inclusively
  • Show an example of data type conversionwithout explicit casting
  • Show an example of data type conversion with casting
  • Show the use of an if statement comparing two primitives
  • Show the use of the .equals() method inside an if statement tocompare two Strings
  • Show the use of an if-else statement
  • Use a For loop to print the numbers from 1 to 20 inclusivelyand all on the same line
  • Use a While loop to print the even numbers from 1 to 61 and allon the same line
  • Use a Do-While loop to prompt the user to enter an odd positivenumber
  • Create an int array that can hold 100 values. Fill it willrandom numbers between 0 and 300.
  • Find and print the smallest number in the int array.
  • Find and print the average of the numbers in the intarray.

Expert Answer


Answer to Write a simple Java program with the following naming structure: Open Eclipse Create a workspace called hw1 Create a pro…

OR