Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I want it to do written in Java. 6- (0.12 point) Output the result of the following expression using the System.out.println and refer to figure
I want it to do written in Java.
6- (0.12 point) Output the result of the following expression using the System.out.println and refer
to figure below for run
7- (0.1 point) Output the max xcoodinate of the rectangle, see below.
8- (0.07 point) Create an ArrayList object arr1 ;
9- (0.1 points) Add your first name to the arr1, it will be added to the index 0 of the ArrayList
10- (0.2 point) Declare an ArrayList arr2; and then make arr2=arr1; then add your last name to arr2 11- (0.23 point) use get method to get the first element of arr2 and then System.out.println this
element, briefly explain the result.
12- (0.22 point) Use size method to get the number of String that has been added to arr1 and use
that get the last element of arr1
Hi ,
I am sorry I did not submit all the question I want just from 7 to 12 thank you so much
1- (0.07 point) Prompt the use to enter a number to represent the length of a rectangle by using
the system.out.println command. See figure below for the execution of the code
2- (0.23 point) Use the Scanner class and create a scan object that allows you to scan user input,
hint to scan user inputs the Scanner Constructor parameter should be System.in.
Read the user input as integer using the scan object and stored it in a variable length.
3- (0.2 point) Prompt the user to enter the width (you can refer to the code below) and read user
input using the same scan object and store the value in a created width.
4- (0.3 point) Create a Point object locate at (1,2) and create a Dimension object using the length
and width entered by the user. Than create a Rectangle object that uses point1 and dimension
5- (0.15 point) Create an area variable that stores the area of a rectangle and calculate the area of
the rectangle you create in 4 and output the area. Hint to get the length and width use the
getter from the Rectangle class.
6- (0.12 point) Output the result of the following expression! $%&'(
)*+,'(-. using the System.out.println
and refer to figure below for run
7- (0.1 point) Output the max xcoodinate of the rectangle, see below.
8- (0.07 point) Create an ArrayList object arr1 ;
9- (0.1 points) Add your first name to the arr1, it will be added to the index 0 of the ArrayList
10- (0.2 point) Declare an ArrayList arr2; and then make arr2=arr1; then add your last name to arr2
11- (0.23 point) use get method to get the first element of arr2 and then System.out.println this
element, briefly explain the result.
12- (0.22 point) Use size method to get the number of String that has been added to arr1 and use
that get the last element of arr1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started