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
Dafna1 [17]
4 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 do...while 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.
Mathematics
1 answer:
Tatiana [17]4 years ago
6 0
<span>// There are several ways of doing this piece of code. // This is one of the smaller versions. If computes the values from the largest // to the smallest, but does destroy the value of n at the end of the loop. total = 0; do { total += n*n*n; --n; } while(n != 0); // Here is a more conventional version that retains the value of n and computes in // an upward fashion. k=1; total=0; do { total += k*k*k; ++k; } while(k <= n);</span>
You might be interested in
The pyramid shown has a square base that is 18 inches on each side. It has a surface area of 864 square inches. What is the slan
disa [49]
The first step is to find the relationship between the square base and the surface area.

Surface area (SA) = area of the square (SS) + area of triangles.4(AT) 

Thus we can conclude area of triangles 4(AT) = SA - SS = 864 - (18*18)

4(AT) = 864 - 324 = 540

Each triangle = 540/4 = 135 square in.

An area of one triangle (AT)= (base* slant height)/2

The base = 18 in.

<span>slant height = 2(AT)/base = 2(135)/18 = 15</span>
3 0
4 years ago
A person in a car traveled 5 miles south and then 5 miles west. The person realized she was lost, so she
Hunter-Best [27]
Son 21 millas en total espero te allude no se inglés soy de México no se cómo cambiar el idioma me alludas
6 0
3 years ago
What is 5/12 of a full rotation
wlad13 [49]

Answer:

150 degrees

Step-by-step explanation:

4 0
3 years ago
Fifteen tickets cost $193.75. What is the average cost of each ticket?
julsineya [31]

Answer:

about $12.92

Step-by-step explanation:

could be wrong though

8 0
3 years ago
Read 2 more answers
HELP ASAP PLEASEEE!!
motikmotik
I am going on the road and you are a little late for me and my son Jesus Jesus amen amen hallelujah
3 0
3 years ago
Other questions:
  • Part A: Abe rented a bike at $36 for 5 days. If he rents the same bike for 8 days, he has to pay a total rent of $48.
    8·2 answers
  • Please help I don't understand this question
    6·1 answer
  • HELP!!!!!!!!!!!!!!!!!!!!
    5·2 answers
  • A truck stopped at a weigh station along the highway. The sign read "Maximum weight 40.3" the truck weighed in at 40.09 tons. Is
    7·1 answer
  • What is the solution set for --4w – 7 &gt; w +3?
    12·2 answers
  • Given triangle ABC, which equation could be used to find the measure of C?
    12·2 answers
  • Find the value of x.​
    13·1 answer
  • 55 divided by 5, divided by 5 divided by 5
    11·2 answers
  • Ahhh helppp i’m almost done with this
    14·2 answers
  • What is the graph of the system?<br> y&gt; -x + 3<br> -2x+y&lt;-1
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!