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
Snowcat [4.5K]
2 years ago
13

Given a variable n refers to a positive int value, use two additional variables, k and total to write a for loop to compute the

sum of the cubes of the first n counting numbers, and store this value in total. thus your code should put 1*1*1 + 2*2*2 + 3*3*3 +... + n*n*n into total. use no variables other than n, k, and total.
Computers and Technology
1 answer:
maksim [4K]2 years ago
5 0
You could do it like this (example for n=5).

int n = 5;
int total = 0;
for (int k = 1; k <= n; k++) total += k*k*k;

You might be interested in
The most important assistance that a full-featured HTML editor provides is _____.
Talja [164]
I would say code completion. Dreamweaver does this for you. So say I wanted to make a paragraph of text, I would use <p>, and then Dreamweaver would create the closing </p> for you.
4 0
3 years ago
What is computer???<br>A. Electornic device<br>B. Storage<br>C. Accuarcy.<br>D. Communciation​
Gemiola [76]

Answer:

A

Explanation:

It's explanable the other ones dont make sense

8 0
2 years ago
What process does a system use to officially permit access to a file or a program CIS 502 ?
ipn [44]

Answer:

Authorization                                

Explanation:

Authorization is a security process to determine access levels related to system resources such as files, services, computer programs, data and application features. This is the method of allowing or denying access to a resource which enables the user to get access to various services and resources depending on the user's identity.

Authorization is the process that checks if a user has the permission to get access to a particular file or perform a particular action, ensuring that user has successfully authenticated himself. It refers to defining access policy.

For example a system administrator determines for the system device, in multi-user computer systems, which users are granted access to system and its resources and privileges are granted.

4 0
2 years ago
What is the output of the following code? var x = ["a", "b", "c"]; x.push("d", "e"); x.pop(); x.pop(); a. ​x = ["a", "b", "d", "
Fofino [41]

Answer:

The answer to this question is option "C".

Explanation:

The stack is part of the data structure. In this stack perform two operations that are "push and pop". The push function is used to push(insert) and pop function is used to pop(delete) elements on the stack. It follows the LIFO process that stands for last in first out.

  • In this code, firstly we insert three elements on the stack that is "a, b and c".
  • Then, we insert two elements on the stack that is "d and e", in this element store in the upper part of the stack and then we call pop function two times.
  • In first time, the call will remove elements e and the second time it will remove element d.

That's why the answer is option "C".

3 0
3 years ago
Describe an algorithm that, given n integers in range 0 to k, preprocesses its input and then answers any query about how many o
pogonyaev

Answer:

Explanation:

Assume that our integers are stored in array A[1 · · · n] and thus, length[A] = n. We need two additional  arrays B[1 · · · k] and C[1 · · · k].

Our algorithm will first initialize all elements of array B to 0. This step

requires O(k) time.

Next, for each element of array A (i.e., A[i] for i = 1, 2, · · · , n), we will increment

B[A[i]]. Observe that this step will require O(n) time and B[j] for j = 1, 2, · · · , k, now contains the number

of elements of A having value j. Finally, make C[1] = B[1] and for each element l of array C where

l = 2, 3, · · · , k, we will compute C[l] = B[l] + B[l − 1]. This step takes O(k) time.

Now, to answer any query about how many of n integers fall into a range [a · · · b], we simply compute

C[b] − C[a] + B[a].

Observe that this computation requires only O(1) time after the O(n + k) preprocessing

time.

8 0
2 years ago
Other questions:
  • Once jaden has decided upon the telecommunications technology his team will use, he will have completed the last step of the dec
    8·1 answer
  • Which method deletes a footer from a document?
    13·2 answers
  • When you are printing handouts, which of these can you do? A. Save paper by placing more than one slide per page. B. Check the f
    7·1 answer
  • Why aren’t I leveling up? I have enough points and even a brainliest. Could an expert please help me!! I am really confused.
    10·1 answer
  • A sentinel value ________ and signals that there are no more values to be entered:____
    14·1 answer
  • Four-pair UTP uses ________ connectors a)snap b)ST or SC c)None of these
    12·1 answer
  • How can you crop a photo in PowerPoint?
    15·2 answers
  • The theory of logic set the foundation for what aspect of computing today?
    11·1 answer
  • Which privacy protection uses four colors to indicate the expected sharing limitations that are to be applied by recipients of t
    12·1 answer
  • Digital Media Equipment: Best Practices Quiz
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!