The following table contains the applied forces and corresponding extension of a perfect spring. Determine the spring stiffness. Provide your answer in N/m to 4 decimal places. x (m) F (N) 0.43 59.34 0.52 71.76 0.57 78.66 0.74 102.12 0.81 111.78 0.88 121.44 0.96 132.48
One of your fellow students is taking extra assessments to complete their course quickly. You are concerned that this may lead them to breach academic integrity. Which of these is likely to be the main reason for your concern?
Which of these situations represents an example of contract cheating?
You are concerned that you are not going to be able to complete an assessment on time. Which of these would represent the best place for you to go to for help?
Which of the following statements is true regarding Hooke’s law?
Which of these reasons best describes why someone acting without academic integrity in education may also act without academic integrity in their future professional practice?
Which of these describes a situation when it is acceptable to breach academic integrity?
When we define an array, as in
int x[3];the name x refers to a set of unnamed int elements that are contiguously stored in memory. We make references to each of these three unnamed int elements using the subscript or index or array operator []
C/C++ arrays are always "-origin". That is, the definition int x[3] defines the elements x[0], x[1], and x[2].
Given the following declaration statement:
float x[] = {1.1f, 2.2f, 3.3f};write the exact value resulting from the evaluation of expression sizeof(x[1]).
An array definition consists of a declaration specifier, an identifier, a dimension, followed by an optional comma-separated list of values enclosed in braces:
type-specifier name [ dimension ] = {initialization-list}opt;can be any of the simple data types we've studied so far including signed and unsigned versions of char, int, long, and floating-point types such as float, double, and long double except void. Later in the course we'll study about storage specifiers and type qualifiers and expand on the declaration specifier.
Square brackets surround dimension which specifies the number of elements in the array. dimension must be a constant integral expression, that is, it must be possible to evaluate the value of dimension at compile-time and the type of the expression must be integral. Note that the constant integral expression dimension must evaluate to a value greater than or equal to . Note that C99 introduced variable-length arrays which allows the dimension to be specified at run-time. The committee changed its mind and C11 makes variable-length arrays optional. But the big thing is that variable-length arrays have always been illegal in C++. Therefore, assume throughout this course and all assessments related to this course that variable-length arrays are illegal; and this is enforced during compilation by using GCC option -Werror=vla.
initialization-list sets array elements to specific values and is optional. The number of values in the initialization list may be less than dimension, but not more. dimension is optional if you include initialization-list and explicitly initialize all values.
Arrays are not first-class citizens: an array cannot be initialized with another array, nor can one array be assigned to another. To copy one array into another, each element must be copied in turn.
The only operations that can be performed directly on an array name are the application of the sizeof and address-of & operators. For sizeof operator, the result is the number of bytes occupied by the array. That is, if each element of the array is of type T and the array dimension is n, the result of the sizeof operator is equal to n times sizeof(T).
Does the following array definition compile?
int x[100];