1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
larisa86 [58]
2 years ago
10

Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the arra

y. 14 36 31 -2 11 -6 Sample Run [14, 36, 31, -2, 11, -6] (In edhesive please)

Computers and Technology
2 answers:
dem82 [27]2 years ago
5 0

Answer:

nums=[14, 36, 31, -2, 11, -6]

print(nums)

Explanation:

I got a 100%

rodikova [14]2 years ago
4 0

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

    int nums[6] = {14, 36, 31, -2, 11, -6};

    cout<<"[";

    for(int i = 0;i<6;i++){

    cout<<nums[i];

    if(i != 5){cout<<", ";}

    }

    cout<<"]";

   return 0;

}

Explanation:

This initializes the array

    int nums[6] = {14, 36, 31, -2, 11, -6};

This prints the opening square bracket

    cout<<"[";

This iterates through the array

    for(int i = 0;i<6;i++){

This prints individual elements of the array

    cout<<nums[i];

Until the last index, this line prints comma after individual array elements

<em>     if(i != 5){cout<<", ";}</em>

    }

This prints the closing square bracket

    cout<<"]";

You might be interested in
Blending two or more colours is called​
krek1111 [17]

Answer:

shading?

Explanation:

Ombré /ˈɒmbreɪ/ (literally "shaded" in French) is the blending of one color hue to another, usually moving tints and shades from light to dark. It has become a popular feature for hair coloring, nail art, and even baking, in addition to its uses in home decorating and graphic design.

3 0
3 years ago
Consider the following general code for allowing access to a resource:
Margaret [11]

Answer:

a) The code allows access even when  IsAccessAllowed(...) method fails.

b) Either use If

(dwRet = ACCESS_ALLOWED)

or use

if (dwRet == NO_ERROR)

to avoid flaw

Explanation:

Lets first see what the code chunk does:

DWORD dwRet = IsAccessAllowed(...);

if (dwRet == ERROR_ACCESS_DENIED) {

// Security check failed.

// Inform user that access is denied.

} else {

// Security check OK.

}

In the given code, DWORD is basically a data type for double word type integers and this is defined in windows.h

So there is DWORD type variable dwRet that is assigned a method calls.

The method is IsAccessAllowed() which checks if the access is allowed to user.

if (dwRet == ERROR_ACCESS_DENIED) condition basically checks if the value of DWORD type variable dwRet is equal to ERROR_ACCESS_DENIED

If this condition evaluates to true then the security checks fails and user is informed via some message or action that the access is denied.  But when the if condition evaluates to false then the else part executes which allows access.

So basically this chunk of code checks if the error ERROR_ACCESS_DENIED is returned.

Now the flaw in this program is what if the method IsAccessAllowed() by any reason. The reasons can be system failure or the memory failure. In memory failure case for example, the system returns out of memory error. So this means that the error is not  ERROR_ACCESS_DENIED. Instead it is out of memory error. So in such a case the user is allowed access as the if condition evaluates to false and else part executes. So if any other error is produced due to some reason like mentioned above, then user has unrestricted access.

This shows that the doe should not check for the failure or rely on checking ERROR_ACCESS_DENIED to allow access but instead it should check for success. Code should only give access privilege if access is allowed successfully or no error is produced.

So to avoid this flaw the code is altered as:

DWORD dwRet = IsAccessAllowed(...);

If (dwRet = ACCESS_ALLOWED) {

//Security check OK.

} else {

//Security check failed.

//Inform user that access is denied.

}

This will only allow access if ACCESS_ALLOWED evaluates to true and success is checked instead of failure here

You can also alter the if condition as:

If (dwRet = No_Error)

or

If (dwRet = 0)

The above if conditions checks if the access is allowed or if no error is produced. Only then it will allowed access otherwise not. So the access check is a success is checked first and failure (for any reason). The user is allowed access only if there is no error otherwise user is not allowed access.

6 0
3 years ago
Uses of the following button in a keyboard: Prt SC, Home, Shift, Tab, Pg Up.​
creativ13 [48]

Answer:

This Print Screen key is used to take the screenshots of all that is appearing on the screen, and this can then be pasted in paint and saved in some location of the computer.

The Home key takes the cursor from the current position to the top left, or the start of the file.

Shift: There are two shift keys. And they are used to print the character in the capital. And when the caps lock is busy it can be used to print in lower case. It is also used together with arrow keys to select a part of the text.

Tab: This key moves the cursor from the current location to the location which we know as tab stops ( and the very next one).

Pg Up:​ The page up is being used for scrolling up, and the distance to which limit the scrolling will take place depends upon the application you are working on.

Explanation:

Please check the answer.

4 0
3 years ago
Will technology be the destruction or salvation of human-kind
Delicious77 [7]

MARK ME As BRAINLIEST

Answer is salvation
5 0
3 years ago
Read 2 more answers
Sam's take-home pay is $743. His deductions are $25 for OASDI, $5 for Medicare, and $27 for income tax. What is his gross pay? A
Katarina [22]

<u>Answer:</u>

A. $686.00

<u>Reasoning:</u>

25+5+27=57 So the total amount of the deductions is $57

Subtract 57 from 743

743 - 57 = 686

So he is left with 686

5 0
3 years ago
Other questions:
  • When a browser makes a request for a static web page, the web server a. finds the HTML for the page and renders it b. renders th
    11·1 answer
  • Home communication involves controlling systems such as heating, cooling, and security.
    11·1 answer
  • Please answer this I know that no one else does but I can't think right now
    10·1 answer
  • What short (two letters!) but powerful boolean operator can check whether or not one string can be found in another string?
    12·1 answer
  • Desmond must enter a long string of numbers (1 4 9 2 1 6 2 0 1 7 7 6) into an old computer every two hours or the computer will
    12·1 answer
  • A motorist is using the AHP to choose a new car from three possible models Arrow, a Bestmobile and a Commuter. The choice will a
    15·2 answers
  • Anyone know how to fix black screen of death on computer​
    6·1 answer
  • Do you have any sprites for Friday Night Funkin?
    14·1 answer
  • A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
    14·1 answer
  • The _____ describes how data actually moves from an application on one computer to an application on another networked computer.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!