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
Diano4ka-milaya [45]
3 years ago
8

Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre

ady been declared, use a for loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and total.
Computers and Technology
2 answers:
slamgirl [31]3 years ago
8 0

Answer:

total=0;

for(k=1;k<=n;k++){

total+=k*k*k;

}

Just to clarify, the curly brackets are optional when only one operation is done by the loop.

Hope this helps!

LiRa [457]3 years ago
5 0

Explanation & answer:

We do not know which language you are using, so a pseudocode will be given, it will be similar to java or C/C++.  For other languages, you can adapt to the syntax of the target language.

int n=5;

//

total = 0  // initialize  variable to store total value, already declaired.

// k will be used as a dummy variable, already declared

for (k=1; k<=n; k++){

   total+=k*k*k;  // k*k*k works for almost all languages.  adapt as needed

   }

print(n, total)

You might be interested in
Determine which program you would recommend each of the customers should use. There are multiple correct answers so please inclu
Lana71 [14]
  1. Since Adult A has been asked to create a website for their church, the most appropriate software to use is Sublime Text because it can be used to type all of the instructions to be executed.
  2. Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace.

<h3>What is a text editor? </h3>

In Computer technology, a text editor can be defined as a tool which is typically designed and developed to enable a software or web developer in typing and create the instructions to be used in a software or website such as a blog.

Sublime Text is a very good example of a text editor and should be used by Adult A to create a website for his or her church because it can be used to type all of the instructions that need to be executed and provides indentation by default.

On the other hand (conversely), Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace because it is arguably the best graphics design software.

Read more on text editor here: brainly.com/question/4004088

#SPJ1

5 0
2 years ago
PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
AveGali [126]

Answer:

I think it the answer will be 0,1,2,3,4

Explanation:

7 0
3 years ago
Read 2 more answers
What shortcut bring up the print page
Kobotan [32]
The keyboard shortcut to bring up print on windows is ctrl+P, for Mac it's cmd+P.

Unless, you mean print screen - for that, there is a button that should say prt sc on your keyboard for windows, and for Mac, it's cmd <span>+ ctrl + shift + 3 to save to clipboard (or don't hold down the ctrl to save to your desktop).</span>
7 0
3 years ago
Read 2 more answers
What is the most widely used operating system for mobile devices?
Alekssandra [29.7K]
Android, many phone brands use the Android OS. Unlike Apple, which is the only technology company with IOS.
8 0
3 years ago
Matt goes to an Internet café and tries to access his emails. The email client asks Matt to enter his email address along with t
Radda [10]

Answer:

acknowledging

Explanation:

it has to be d

6 0
3 years ago
Other questions:
  • The ______ identifies the path for the currently open folder
    8·2 answers
  • Of the two basic methods of data entry, keyboards use keystrokes to enter data and instructions; what is the nonkeyboard method
    7·1 answer
  • Which type of operating system is usually used in personal computers?
    11·1 answer
  • What process combines data from a list with the content of a document to provide personalized documents?
    9·2 answers
  • Which one of the following characteristics or skills of a ScrumMaster are closelyaligned with coaching?Select one:
    5·1 answer
  • A(n ____ is information that a web server stores on a client computer, such as the client’s preferences when accessing a particu
    15·1 answer
  • Can you help me with my homework what should i do
    9·1 answer
  • ________ is the art of manipulating people into breaking normal security procedures or divulging confidential information.
    12·1 answer
  • What does it mean "Be Proactive"?
    10·2 answers
  • Using computers can lead to a number of physical safety issues. State and explain TWO(2) of these types of issues.​​​​​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!