Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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
1h 4:46 PM Wed 10 Feb high 5- (0.15 point) Create an area variable that stores the area of a rectangle and calculate the area of (vct the rectangle you create in 4 and output the area. Hint to get the length and width use the getter from the Rectangle class. len th x Width 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=arri; 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 Please enter an length tor the rectangle 5 Please enter an width for the rectangle 2 The are of the rectangle is: 10.0 The expression value is: 1 The maxium xcoordinate is: 6.0 arr2 first element is: Ola arri last element is: Tannous

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago