SlideShare a Scribd company logo
1 of 2
Download to read offline
Pixel[] pixelArray= this.getPixels();
intvalue = 0;
intindex = 0;
while (index < pixelArray.length/4)
{
value = pixelArray[index].getRed();
value = (int) (value * 0.5);
pixelArray[index].setRed(value);
index = index + 1;
}
the answer is B! could explain why B is answer? :)
and what is that meaning of "index < pixelArray.length" ?
Thanks! A D None RID B CD
Solution
Please follow the code and comments for description :
CODE :
// get the array of pixel for this picture object
Pixel[] pixelArray = this.getpixelArray();
int value = 0; // the amount of red
int index = 0; // start the intindex at 0
// loop while the index is less than the quarter length of the pixel Array
while (index < pixelArray.length/4) {
// get the current pixel at this index and get the red value at the pixel
value = pixelArray[index].getRed();
// set the red value to half what it was
value = (int) (value * 0.5);
// set the red for this pixel to the new value
pixelArray[index].setRed(value);
// increment the intindex
index = index + 1;
}
So the answer is OPTION B.
index < pixelArray.length : This is used to loop while the index is less than the length of the
pixels array.
Hope this is helpful.

More Related Content

More from arumugambags

What role does childrens play have in motor delopment What r.pdf
What role does childrens play have in motor delopment What r.pdfWhat role does childrens play have in motor delopment What r.pdf
What role does childrens play have in motor delopment What r.pdfarumugambags
 
What questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfWhat questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfarumugambags
 
What is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfWhat is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfarumugambags
 
What are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfWhat are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfarumugambags
 
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfWhat are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfarumugambags
 
We regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfWe regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfarumugambags
 
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfA father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfarumugambags
 
The purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfThe purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfarumugambags
 
The mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfThe mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfarumugambags
 
The firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfThe firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfarumugambags
 
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdfarumugambags
 
Researchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfResearchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfarumugambags
 
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
No observed sexual phase in its life cycle  Resistant sporangium prod.pdfNo observed sexual phase in its life cycle  Resistant sporangium prod.pdf
No observed sexual phase in its life cycle Resistant sporangium prod.pdfarumugambags
 
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfProblem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfarumugambags
 
On the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfOn the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfarumugambags
 
List the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfList the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfarumugambags
 
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdfarumugambags
 
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdfarumugambags
 
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfJanuary 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfarumugambags
 
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfIPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfarumugambags
 

More from arumugambags (20)

What role does childrens play have in motor delopment What r.pdf
What role does childrens play have in motor delopment What r.pdfWhat role does childrens play have in motor delopment What r.pdf
What role does childrens play have in motor delopment What r.pdf
 
What questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdfWhat questions are descriptive studies designed to answerSoluti.pdf
What questions are descriptive studies designed to answerSoluti.pdf
 
What is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdfWhat is a current liability Distinguish between a current liability.pdf
What is a current liability Distinguish between a current liability.pdf
 
What are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdfWhat are some of the evolutionary evidence that suggests we evolv.pdf
What are some of the evolutionary evidence that suggests we evolv.pdf
 
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdfWhat are the five signs of tissue injurySolutionAnsThe fiv.pdf
What are the five signs of tissue injurySolutionAnsThe fiv.pdf
 
We regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdfWe regularly allow beer companies to advertise across various mass m.pdf
We regularly allow beer companies to advertise across various mass m.pdf
 
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdfA father and his son were watching Jeopardy on TV. The son, a compute.pdf
A father and his son were watching Jeopardy on TV. The son, a compute.pdf
 
The purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdfThe purchase of inventory would be considered aA.cash outflow fr.pdf
The purchase of inventory would be considered aA.cash outflow fr.pdf
 
The mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdfThe mission of University is the transformation of the whole person .pdf
The mission of University is the transformation of the whole person .pdf
 
The firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdfThe firm is Tesla Motors1.Based on information in the annual repor.pdf
The firm is Tesla Motors1.Based on information in the annual repor.pdf
 
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
4 A piece of lead metal was added to an aqueous solution of copper(I.pdf
 
Researchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdfResearchers are interested in studying whether personality is relate.pdf
Researchers are interested in studying whether personality is relate.pdf
 
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
No observed sexual phase in its life cycle  Resistant sporangium prod.pdfNo observed sexual phase in its life cycle  Resistant sporangium prod.pdf
No observed sexual phase in its life cycle Resistant sporangium prod.pdf
 
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdfProblem 8 The trial balance of Hunter Inc. included the following acc.pdf
Problem 8 The trial balance of Hunter Inc. included the following acc.pdf
 
On the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdfOn the basis of the general solubility rules given in the table belo.pdf
On the basis of the general solubility rules given in the table belo.pdf
 
List the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdfList the TCP!IP protocol suite layer that performs each of the fol.pdf
List the TCP!IP protocol suite layer that performs each of the fol.pdf
 
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf2. Let J R R be Thomaes function and let gR R be the sign function.pdf
2. Let J R R be Thomaes function and let gR R be the sign function.pdf
 
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
50 100 o 50 100 O 50 100 2. For each histogram in exercise 1, is the .pdf
 
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdfJanuary 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
January 2014 issued $6,000,000, 8 5 year bonds.Prepare journal en.pdf
 
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdfIPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
IPV6 is the replacement for IPV4. This shows a lack of vision when t.pdf
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

Pixel[] pixelArray= this.getPixels();intvalue = 0;intindex = 0;.pdf

  • 1. Pixel[] pixelArray= this.getPixels(); intvalue = 0; intindex = 0; while (index < pixelArray.length/4) { value = pixelArray[index].getRed(); value = (int) (value * 0.5); pixelArray[index].setRed(value); index = index + 1; } the answer is B! could explain why B is answer? :) and what is that meaning of "index < pixelArray.length" ? Thanks! A D None RID B CD Solution Please follow the code and comments for description : CODE : // get the array of pixel for this picture object Pixel[] pixelArray = this.getpixelArray(); int value = 0; // the amount of red int index = 0; // start the intindex at 0 // loop while the index is less than the quarter length of the pixel Array while (index < pixelArray.length/4) { // get the current pixel at this index and get the red value at the pixel value = pixelArray[index].getRed(); // set the red value to half what it was value = (int) (value * 0.5); // set the red for this pixel to the new value pixelArray[index].setRed(value); // increment the intindex index = index + 1; } So the answer is OPTION B. index < pixelArray.length : This is used to loop while the index is less than the length of the