subject

Lab 6.1.1 creating and printing arrays let's work on some basic skills by creating a program that contains a few experiments with arrays. if you are asked to print out a value, be sure to print a label that indicates what the value represents, unless otherwise indicated. for example, if you are asked to print a variable z, the output might look like this: z : 8.0 perform each of the following tasks: a) create an array x of doubles with an initializer list that contains the following values: 8, 4, 5, 21, 7, 9, 18, 2, and 100. b) print the number of items in the array by printing the expression x. length. c) print the first array item, x[0]. d) print the last array item. be careful to choose the right index. e) print the expression x[x. length - 1]. why is this value the same as in part d? f) use a standard for loop to print all the values in the array without labels. g) use a standard ( loop to print all the values in the array with labels to indicate what each element is. h) use a standard for loop to print all the values in the array in reverse order with labels to indicate what each element is. i) use an enhanced for loop to print all the values in the array without labels.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
You need to write some code that responds to a text change in a jtextfield. how can you do that? create a class that implements the interface actionlistener and override the method textfieldchanged create a class that extends the superclass actionlistener and override the method actionperformed create a class that implements the interface actionlistener and override the method actionperformed create a class that extends the superclass actionlistener and override the method textfieldchanged
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 18:50
Write a program that reads in a series of lines of input character by character (using the library function the first line of the input contains an integer which specifies the number of remaining lines of input, each of which contains a floating point number. the integer value on the first line can be read with (the library function) but all of the following lines can only be read with each line, after the first, contains a single floating point value, with up to four digits before the decimal point, and up to four digits following the decimal point, but there is not necessarily a decimal point in each number; i.e., it may appear to be an integer, but the digits should be read by your program, and the number should be converted to a corresponding floating point number. for instance, suppose the following input: 5 3.1255 20.25 0.875 1921.50 31 the required output is: − each of the input floating point values, printed on a separate line with four digits of precision, using printf(); − on the last line of the output, the string “total: ” followed by the sum of the input values, printed with printf() to 4 digits of precision. for example, the total of the sample input given above is 1976.7505, so the required output for this input would be: 3.1255 20.2500 0.8750 1921.5000 31.0000 total: 1976.7505 do not concern yourself with small differences in the total due to rounding, as the grader will not deduct points for this. constraints: − you are not allowed to use arrays on this portion of the lab assignment. − there is no maximum number of lines allowable. it all depends upon the first value of input. since you aren’t saving anything, it doesn’t matter. − you can assume that input will not contain more than 4 digits before or after the decimal point. you do not need to error check for this condition. -you must use getchar() to read in the floating point values one character at a time (i.e. do not use -you must declare and use your floating point values as a double to minimize rounding errors. -only use printf() to output the floating point numbers and the total (do not use − be sure your directions to the user are clear so they are sure to enter the input data correctly.
Answers: 1
You know the right answer?
Lab 6.1.1 creating and printing arrays let's work on some basic skills by creating a program that co...
Questions
question
Social Studies, 27.10.2020 20:00
question
Chemistry, 27.10.2020 20:00
question
English, 27.10.2020 20:00
question
Chemistry, 27.10.2020 20:00
Questions on the website: 13722362