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
What is the standard equation of the circle in the graph?
seraphim [82]
X^2 + y^2 = radius^2
Is that what your adking for? This is for a circle around the origin.
8 0
3 years ago
Read 2 more answers
Adaline is designing a garden in the shape of a 45º-45º-90º triangle, with an area of 32 ft2. To the nearest foot, how much fenc
wel

Answer:

27 ft

Step-by-step explanation:

Given: A garden in the shape of a 45º-45º-90º triangle.

Area of triangle= 32 ft²

As given dimension of triangle, we understand that it is a right angle and triangle and since two angles are equal, therefore two sides of triangle are also equal.  

∴ Base and height will be equal.

Assuming base is also as "h"

Now, finding the length of base and height by using area of triangle formula.

Area of triangle=  \frac{1}{2} \times base\times height

⇒32= \frac{1}{2} \times h\times h  

Multiplying both side by 2

⇒64= h^{2}  

Square rooting both side, remember; √a²= a

⇒  \sqrt{64} = h

∴ h= 8 feet

Hence, both base and height of right angle triangle is 8 feet.

Next, finding total fencing required to enclose the garden.

Perimeter of garden is equal to the amount of fencing required by Adaline.

Therefore, finding the length of hypotenous of triangle too.

Using pythogorean theoram.

h^{2} = a^{2} +b^{2}, where a is the height and b is the base of triangle.

⇒ h^{2}= 8^{2}  +8^{2}

⇒ h^{2} = 128

Square rooting both side

⇒h= \sqrt{128}

∴ h= 11.3 feet

Perimeter of garden= base+height+hypotenous

⇒ Perimeter of garden= 8+8+11.3= 27.3\ feet \approx 27\ feet

Hence, 27 feet fencing is required to enclose the garden.

3 0
4 years ago
Read 2 more answers
A recipe uses 5 cups of flour for every 2 cups of sugar. How much sugar is needed for 6 cups of flour
sp2606 [1]

Answer:

2.4 cups

Step-by-step explanation:

Divide 2 by 5

= 0.4

We have 2 cups of sugar

2 + 0.4 = 2.4 cups.

8 0
4 years ago
Can someone help me with this please <br> I would really appreciate it
mart [117]
21-3x=2x+1
Get the variable on one side
-5x=20
20/5
The answer is 4
5 0
4 years ago
What is the equation of a line with a slope of -2 and passes through the point 3,5¿
dalvyx [7]
Y - y₁ = m(x - x₁)
y - 5 = -2(x - 3)
y - 5 = -2(x) + 2(3)
y - 5 = -2x + 6
  + 5          + 5
     y = -2x + 11
3 0
4 years ago
Other questions:
  • Jess is painting a giant arrow on a playground find the area of the giant arrow
    12·1 answer
  • Find the geometric mean of -1/10 and -1/40
    8·2 answers
  • Jerry has a string of lights. Give a fraction that represents each point on the string compared to the whole
    12·1 answer
  • The circumference of a bike tire is 84 inches what is the diameter
    13·1 answer
  • It takes 2 hours for a boat to travel 28 miles downstream.The same boat can travel 18 miles upstream in 3 hours .Find the rate o
    6·1 answer
  • Andy, who loves to cook, makes apple cobbler for his family. The recipe (serves 6) calls for 434 pounds of apples, 514 cups of f
    5·1 answer
  • H=K+log(A/C)<br> isolate a... make a the subject
    15·1 answer
  • Will give brainliest!!! The MTC Theater holds 250 people, and last night’s performance sold out! Students under the age of 16 pa
    12·1 answer
  • Which theorem is used here <br>SAS<br>ASA<br>AAS<br>SAS<br>HL​
    9·1 answer
  • The circumference of a circle of diameter 3,5 cm is 11 cm. What is the circumference of a circle of diameter 42 cm? Answer ... c
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!