Cash-back offer from April 14th to 21st, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 20.00

PROG 110 Chapter 6 Review | Complete Solution

Question posted by
Online Tutor Profile
request

PROG 110  Chapter 6 Review
Points Possible: 20
No late submissions will be accepted
Print this document, and work through the questions prior to starting the assessment. You will be submitting your answers using the Quizzes Tool, with the link labeled Chapter 6 Review. There will be a 1 hour time limit when submitting your answers, so be sure to answer all questions prior to your submission. Each question is worth 1 point unless otherwise noted
NOTE: In the assessment, the answers will be presented in a random order, so make sure you select the correct response and not the letter you circle here.
1. In an array, every element has the same ___________.
a. subscript b. data type c. memory location d. all of the above
2. The operator used to create an object is __________.
a. = b. += c. new d. create
3. The value placed within square brackets after an array name is ___________.
a. a subscript b. an index c. always an integer d. all of these
4. When an integer array ages is correctly declared and initialized using the values {20, 30, 40, 50}, then the value of ages[4] is ____.
a. 0 b. 40 c. 50 d. undefined
5. When you declare and initialize an array as
int[] temperature = new[] {0, 32, 50, 90, 212, 451};
the value of temperature.Length is _____.
a. 5 b. 6 c. 7 d. unknown
6. Two arrays that store related information in corresponding element positions are _______.
a. analogous arrays b. polymorphic arrays
c. relative arrays d. parallel arrays
7. What does the following code fragment display on the console?
int[] amount = new int[] { 2, 3, 4, 5 };
for (int index = 0; index <= 3; ++index)
{
amount[index] *= 3; Console.Write( "{0} ", amount[index]);
}
8. Write a single, valid C# statement, to declare and initialize a single-dimension integer array named pips with the data 8, 9, 10, 11, 12.
9. A two-dimension integer array with the name table has been declared that has four rows and three columns. How many elements does the array contain?
PROG 110 Page 2
10. Using a ‘for’ loop, write a valid code fragment that adds 5 to every value in a 12-element integer array named pips. Use the Array property Length. Points will be deducted if you display to the console. (2 points)
11. Using a ‘foreach’ loop, write a valid code fragment that displays to the console, on a single line, every value in a 12-element integer array named pips. (2 points)
12. Assume a single-dimension integer array named numbers has been properly declared with the values 2, 3, 4, 5.
Using a ‘for’ loop, write the valid code fragment that displays the values in the array in
reverse order on a single line. Don’t forget the space between the numbers. Use the Array property Length but do not use the Array method Reverse. Make the loop generic for any size array. (3 points)
Hint: remember that the Length property starts at 1, while the array subscript starts at 0.
13. Find and correct the error in the following code segment: (2 points)
Assume int[ ] count = new int[ 10 ];
for (int i=0; i<=count.Length; ++i)
count[i] = 1;
a. Explain what the error is.
b. Explain how to correct the error. Type the correct statement or expression only, not the entire code segment.
14. Using valid C# syntax, perform the following tasks for an array of datatype double called fractions. (2 points)
a. Assign the value 1.667 to the array element with index 4.
b. Assign the value 3.333 to the second element in the array.
Remember that this is a self-assessment; therefore, please do your own work, and I hope that you take your time in answering each of the questions. Use Visual Studio, when appropriate, to assist in determining your responses.
If you have generic, general, questions, please post in the Module 5 discussion topic. In answering another student’s question, do not post “answers”, but you may provide guidelines/hints on how to obtain the desired result.

Available Answer
$ 20.00

[Solved] PROG 110 Chapter 6 Review | Complete Solution

  • This Solution has been Purchased 1 time
  • Submitted On 05 Mar, 2015 12:01:38
Answer posted by
Online Tutor Profile
solution

This Tutorial is rated A+ p...

Buy now to view the complete solution
Other Similar Questions
User Profile
AceTu...

PROG 110 Homework 8 The Roll of the Dice and More Array Manipulations | Complete Solution

This Tutorial is rated A+ previously,if you have any questions regarding this tutorial then you can contact me.

http://www.coursemerit.com/user/AceTutor

...
User Profile
AceTu...

PROG 110 Homework 7 Using Arrays and The Random Number Generator | Complete Solution

This Tutorial is rated A+ previously,if you have any questions regarding this tutorial than you can contact me.

...
User Profile
AceTu...

PROG 110 Chapter 6 Review | Complete Solution

This Tutorial is rated A+ previously,if you have any questions regarding this tutorial than you can contact me.

...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35