Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already 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.

Answers

Answer 1
// 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);

Related Questions

True or false: the regression sum of squares (ssr) can never be greater than the total sum of squares (sst).

Answers

. . . . . . .. . . . . . . . . . . . . . . . . . . . ./ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 

The equation of line m is 5x−3y=2. What is the slope of a line that is perpendicular to line m? Enter your answer in the box.

Answers

-3y=-5x+2
y=-5/-3x+2/-3
y=5/3x-2/3
compare y=mx+c || m =5/3
for perpendicularity
m=-1/M
m=-1/5/3
m= -3/5

Step 1

Find the slope of the line M

we have

[tex]5x-3y=2[/tex]

isolate the variable y

[tex]3y=5x-2 \\ \\y=\frac{5}{3}x-\frac{2}{3}[/tex]  

the slope of the line is [tex]\frac{5}{3}[/tex]

Step 2

Find the slope of the line perpendicular to line M

we know that

if two lines are perpendicular , then the product of their slopes are equal to minus one

so

[tex]m1*m2=-1[/tex]

we have

[tex]m1=\frac{5}{3}[/tex]

Find m2

[tex]m2=-1/m1[/tex]

[tex]m2=-1/(5/3)[/tex]

[tex]m2=-\frac{3}{5}[/tex]

therefore

the answer is

[tex]-\frac{3}{5}[/tex]

Solve for x.
x2(^) + 9x = 0

Answers

x^2+9x=0
x(x+9)=0
x=0, -9
The Correct Answer is 0,-9

A bag contains purple and orange marbles. Sam randomly takes out one marble and then returns it to the bag. He does this 18 times, and 12 of those times an orange marble is pulled out. What is P(green)?

Answers

Since there are no green marbles it is impossible to select one so P(green)=0.

Which expression is equivalent to 5(8 + 9)?

Answers

5*(8+9)=5*8+5*9=40+45
=85
...i think it is 85 unless there is a different way to do this

holly and melanie were playing a video game. the ratio of holly's score to melanie's score was 8:3. after melanie scored 34 points, the ratio of their scores became 2:5. what were their scores at the end?

Answers

They started with a ratio of 8:3.
Since we don't know the actual numbers, let's say their scores were originally 8x for Holly and 3x for Melanie.
Then Melanie scored 34 points, so her score became 3x + 34.
Holly's score remained the same at 8x.
The new ratio is 2:5, so

8x/(3x + 34) = 2/5

Now we solve the equation for x.

40x = 6x + 68

34x = 68

x = 2

With x, we can find the scores.

Holly ended up with 8x = 8 * 2 = 16
Melanie ended up with 3x + 34 = 3(2) + 34 = 40

What is the answer?

Answers

The divisor is '-5'

This come from x = -5

Move over -5 into the other side to make the equation equal to zero

x + 5 = 0

Answer: x + 5

Jill has 8.75. Jack has three times as much as Jill, but he spent 5.00 to buy a book. How much money does jack have ?

Answers

Simple! jack has x3 as much as jill so 8.75 x 3 = 26.25 then he spent 5.00 so 26.25-5.00=21.25 

Answer = 21.25

At the market 8 batteries cost $10. How much will 6 batteries cost.

Answers

Ok so
10÷8=1.25
6*1.25=7.50
So for 6 batteries it should be $7.50
hope this helps!

What's green and fluffy and comes from outer space?

Answers

a martian mellow the cat
 A Martian mellow Thats all Got to put this here 20 chars and all

There are 18 players on the baseball team. Of these players 1/3 are girls. How many girls play on the baseball team?

Answers

6 girls on the basketball team

divide 18 by 3

18 / 3 = 6

 there are 6 girls on the team

The sum of two numbers is 39 . the larger number is 17 more than the smaller number. what are the numbers?

Answers

Larger Number + Smaller Number = 39
Larger Number = S + 17
Smaller Number = S

S + 17 + S = 39
2S + 17 = 39
2S = 39 - 17
2S = 22
S = 22/2
S = 11

Larger Number is S + 17
Larger Number is 11 + 17

Larger Number is 28
Smaller Number is 11
Final answer:

The smaller number is 11 and the larger number is 28.

Explanation:

Let's assume the smaller number is 'x'.
The larger number is 17 more than the smaller number, so the larger number can be represented as 'x + 17'.
The sum of the two numbers is 39, so we can set up the equation: x + (x + 17) = 39.
By simplifying the equation, we get 2x + 17 = 39.
Subtracting 17 from both sides gives us 2x = 22.
Dividing both sides by 2 gives us x = 11.
So, the smaller number is 11 and the larger number is 11 + 17 = 28.

Learn more about Algebra here:

https://brainly.com/question/24875240

#SPJ2

If AB = 18 and AC = 3x +6 then x=

Answers

x would equal 4
set AB=AC
18=3x+6
minus 6 on both sides 
12=3x
divide both sides by 3
x=4

M(8, 5) is the midpoint of JK. The coordinates of point J are (5, −6) . What are the coordinates of point K?

Answers

11,16 I believe cause 8-5 is 3 it's increase by 3 8+3 is 11 -6+11 is 5 5+11 is 16

The midpoint is the exact middle of a line segment which divides the line into two equal lengths. Hence, the coordinate of K is (11, 16)

We can obtain the distance between the coordinates of JM thus :

Distance = y2 - y1 ; x2 - x1

Distance = (8 - 5) ; (5 - (-6) = (3, 11)

Hence, the change in the coordinates is (3, 11)

Therefore, the coordinates of K can be obtained thus :

(8 + 3) ;(5 + 11) = (11, 16)

Hence, the coordinate of K is (11, 16)

Learn more :https://brainly.com/question/16144029

Which unit fraction should be used to convert 15 inches to centimeters?

Answers

Answer:  ([tex] \frac{2.54 cm}{1 in} [/tex])  .
Final answer:

To convert from inches to centimeters, the unit fraction used is 2.54 cm/1 in. Therefore, 15 inches is equal to 38.1 centimeters.

Explanation:

To convert a measurement from inches to centimeters, we utilize a unit conversion factor. In this instance, the unit conversion factor we're interested in relates inches to centimeters. One inch is equivalent to 2.54 centimeters. Hence, the unit fraction used for such conversion is 2.54 cm/1 in.

To determine the equivalent value in centimeters for 15 inches, we multiply the number of inches (15) by our unit conversion factor (2.54 cm/1 in). This gives us the following

15 inches * 2.54 cm/1 in = 38.1 cm.

So, 15 inches is equivalent to 38.1 centimeters when converted.

Learn more about Unit Conversion here:

https://brainly.com/question/19420601

#SPJ2

Divide.

(5 1/4)÷(−2 1/2)

Enter your answer as a mixed number, in simplified form, in the box. Please Explain your answer.

Answers

Before you can divide anything mixed numbers, you must first put it as an improper fraction so 5 1/4 will change into 21/4 because 5*4+1 is 21 and don’t forget the fraction so it would be 21/4, and -2 1/2 would change into -5/4 because -2*2+1 is -5 and if u add the fraction it would become -5/4. Now, the method I use is leave, change, flip, so I first leave the 21/4 in 21/4/-5/4 and I change the division sign into a multiplication sign, and I flip the -5/4 to -4/5, so your new equation now looks like, 21/4•-4/5. Now we have to multiply. Since we can cross simplify, you can cancel out both fours leaving you with 21/1•-1/5 and when u multiply across you get -21/5. When u simplify it to a mixed number, it should look like -4 1/5 because you see how many times 5 goes into 21 which is 4 times and it leaves u with a remainder of 1 because 21-20 is 1 and when ever u have a remainder, u have to keep a denominator of 5 so your final answer is: -4 1/5
Final answer:

To divide (5 1/4)÷(−2 1/2), convert the mixed numbers into improper fractions and then multiply by the reciprocal of the divisor. Simplify the result to get the quotient as -2 1/10.

Explanation:

To divide the given mixed numbers, (5 1/4)÷(−2 1/2), we first convert them into improper fractions.

5 1/4 can be written as (4*5 + 1)/4 = 21/4.

(−2 1/2) can be written as (-2*2 + 1)/2 = -5/2.

Now, we can divide the fractions by multiplying the reciprocal of the divisor: (21/4) * (-2/5) = (-21/4) * (2/5) = -21/10.

Finally, we simplify the result by dividing both the numerator and the denominator by their greatest common factor, which is 1. The simplified result is -21/10, which can be written as -2 1/10 as a mixed number.

Which operation flips the graph of a function over the x-axis?


A. Multiplying the function by –1
B. Multiplying the function by 1
C. Subtracting 1 from the function

Answers

A. multiplying the function by -1

Multiplying the function by –1 is the  operation flips the graph of a function over the x-axis

What is Graph?

Graph is a mathematical representation of a network and it describes the relationship between lines and points.

The operation that flips the graph of a function over the x-axis is multiplying the function by -1.

When a function is multiplied by -1, the y-values are negated, which causes the graph to reflect over the x-axis.

if we have a function f(x) = x², the graph will be a parabola that opens upwards.

However, if we multiply this function by -1 to get -f(x) = -x², the graph will be the same parabola reflected over the x-axis and opening downwards.

Hence, Multiplying the function by –1 is the  operation flips the graph of a function over the x-axis

To learn more on Graph click:

https://brainly.com/question/17267403

#SPJ5

Find the midpoint of the segment with the given endpoints. m(–2, 1) and n(–3, 2)

Answers

Use the midpoint formula

What is the remainder of the following division problem? in the pic?





A. x

B.1

C. 0

D.–1

Answers

1 is your remainder

hope this helps

0 + 1 = 1

so your answer is 1 1/x

Answer :  Option B is correct.

Explanation :

Since we have given that

f(x) = x+1

and

g(x) =x

and when we divide f(x) with g(x) i.e.

[tex]\frac{f(x)}{g(x)}[/tex]

And we know the division algorithm , i.e.

[tex]f(x)=g(x).q(x) +r(x)[/tex],

Where q(x) represents quotient and r(s) denotes remainder

So, we write it in this manner ,

[tex]x+1=x.1+1\\\\\text{Remainder becomes 1}[/tex]

Hence, Remainder = 1

So, Option B is correct.

Can someone pleasee match these for me ASAP?? I need them rn and u get 27 pts! The first second and fourth on the ones with operations are multiplication. The fifth is subtraction. If u could do the questions as a thru f and g and the answers as 1 thru 6 and 7 and tell me the order that'd be great, thanks!

Answers

Here are the answers:
______________________________________
 
Question a):    ANSWER:   1 ;   √(28a⁴b³c)  =    2a²b √(7bc) ;
_______________________________________________________

Question b):    ANSWER:   6 ;   √(98a⁴b³c)  =    7a²b √(2bc) ;
_______________________________________________________

Question  c):   ANSWER:   3 ;   √(56a³b⁴c²)   =  2ab²c √(14a) ;
_______________________________________________________

Question   d):  ANSWER:   5 ;   √(48a⁵b⁶c³) =   4a²b³c √(3ac) ;
_____________________________________________________

Question   e):   ANSWER:  2 ;     √(24a⁵b⁴c²) =  2a²b²c √(6a)  ;_____________________________________________________

Question    f):  ANSWER:   4 ;    √(54a⁶b⁵c²) =  3a³b²c √(6b) .
_____________________________________________________

On the first day of summer a rainstorm brought 2.29 inches of rain to the area. During the rest of the summer there was 3 times as much rain as on the first day. What was the total number of inches of rainfall for the summer?

Answers

To solve this problem, we simply have to multiply the original inches of rain to that of how many times it was for the rest of summer. So in this case, simply multiply 2.29 by 3, that is:

 

2.29 inches * 3 = 6.87 inches

 

Answer:

6.87 inches

What is the answer to: jason has 4 tiles. each tile has a number printed oon it. the numbers are 2,3,6, and 8, a decimal number is formed using the titles and the clues. be a math detective and find the number.?

Answers

I believe this problem has the following clue:

digit in the tens place is the largest number. digit in tenths place is less than the digit located in the hundredths place. the digit in the ones place is greater than the digit in the hundredths place

 

From this clue, we can say that the number is:

86.23

Please help with these questions thank you very much!

Answers

1. 30 and 60
2. 60 and 80
3. 60
4.37

ASAP PLEASE!!! Start with the following conditional statement: If it is October 31, then it is Halloween.
a. State the converse of the statement.
b. State the inverse of the statement.
c. State the contrapositive of the statement.

Answers

Let p, and q be 2 statements. Consider the conditional p⇒q (that is, if p then q).

i)   The converse of the statement is q⇒p.

ii).  The inverse of the statement is ¬p⇒¬q.

iii).  The contrapositive of the statement is ¬q⇒¬p.


Let p: it is October 31, and let q: it is Halloween

The converse of the conditional p⇒q  is q⇒p:

                 
  If it is Halloween, then it is October 31. 

The inverse is ¬p⇒¬q:

                   
If it is not October 31, then it is not Halloween.

The contrapositive ¬q⇒¬p is:

                   
If it is not Halloween, then it is not October 31.

What’s the rule for the translation (x,y) (x+3,y+7)

Answers

The rule would be right 3, since the algebraic composition is changing the x values, and up 7, since the y values are being changed. Whenever a number is being added to the x in the coordinate, the function is being moved to the right. When a number is subtracted from the x, then the function is moving left. 
For the y value, if you are adding a number to the y coordinate, you are moving it up, whereas when you subtract a number, you are moving it down that amount. 

Claire has received scores of 85,82, and 75 on her algebra tests. what score must she receive on the fourth test to have an overall test score average of at least 82

Answers

Fourth test mark should be 86

85 + 82 + 75 + 86 = 328
328 divide by 4 (as there are four tests) = 82

The temperature rose 4 f every 90 minutes before noon and rose 2 f for every 45 minutes after noon are these rates equivalent

Answers

Yes, because the afternoon rate is just the morning rate split in half. Instead of checking the temperature every hour and a half, the temperature was checked every 45 minutes. And, the temperature rate was also split in half when the time was split in half. So basically, if the 2 degrees every 45 minutes was multiplied by 2,(both the time and the temperature) or if the 4 degrees every 90 minutes was divided by 2, (once again, both the time and the temperature) then, they would both be either 2 degrees every 45 minutes, or they would both be 4 degrees every 90 minutes.

In the figure, line m || line n. Find the measure of <7

Answers

Angles 2, 4, 6 measure 63 deg.
Angles 1, 3, 5, 7 measure 117 deg.

a jewelry store is having a 10% off regular price sale. find the discount and the sale price of a ring normally priced at $1170

the discount is $[]
the sale price is $[]

Answers

10% of $1170 is 170 so 170 - 1170 = 1,000
So your discount price would be $1,000
Hope this helps

50 POINTS + BRAINLIEST

Answers

x + 2y = 6
2y = -x + 6
  y = -1/2 x + 3 so slope = -1/2

parallel lines  has same slope = -1/2
perpendicular lines slope is opposite and reciprocal so slope = 2  
if slope not equal either -1/2 or 2 then neither.

y = -1/2 x - 5 ....m= - 1/2....  parallel

-2x + y = -4
          y = 2x - 4...m = 2 ....perpendicular

-x + 2y = 2
2y = x + 2
y = 1/2 x + 1 ...m = 1/2 ...neither

x + 2y = -2
2y = -x - 2
 y = -1/2 x - 1 ...m = -1/2 .....parallel

hope it helps

Answer:x + 2y = 6

2y = -x + 6

 y = -1/2 x + 3 so slope = -1/2

parallel lines  has same slope = -1/2

perpendicular lines slope is opposite and reciprocal so slope = 2  

if slope not equal either -1/2 or 2 then neither.

y = -1/2 x - 5 ....m= - 1/2....  parallel

-2x + y = -4

         y = 2x - 4...m = 2 ....perpendicular

-x + 2y = 2

2y = x + 2

y = 1/2 x + 1 ...m = 1/2 ...neither

x + 2y = -2

2y = -x - 2

 y = -1/2 x - 1 ...m = -1/2 .....parallel

Other Questions
If y = 5/17 when x = 10, find y when x=5 "Talking Wrong" is an essay about author Patricia Smith's mother's move from Alabama to Chicago and her attempt to speak standard English when she gets there. Based on the following excerpt, how does Smith feel when she hears her mother's original, customary language?When my mama talks, the sound is flat and broad and wild with unexpected flowers, like fields in Alabama.A. exhilaratedB. ashamedC. complacentD. comforted During a chemical reaction, an iron atom became the ion Fe2+. What happened to the iron atom? According to the fluid mosaic model a membrane is composed of What makes dimmesdale a good father in the scarlet letter? 1. Which of the following are the three primary membership considerations of the deaf community? a. Audiological, attitudinal, disabilityb. Audiological, attitudinal, linguisticc. Attitudinal, audiometric, disabilityd. Audiological, attitudinal, audiometric2. Which of the following would be considered a special population within the deaf community? a. People who are deaf blindb. People who are blind and hearingc. ear, nose, and throat doctorsd. cousins of deaf adults3. Sign language interpreters are considered to be which of the following? what is the purpose of subheadings in an informational text a) highlight supporting ideas b) to identity the main idea c) to summer prize information in a visual ways D)to define specialized vocabulary When did the global nir peak and what was it? 1.A pool company is trying out several new drains. Drain A empties a pool at a rate of 2 gal/min. Drain B empties a pool at a rate of 5 gal/min. One pool has 108 gal of water in it. Write an equation for each drain that shows the amount of time it takes to empty the pool. Then solve each equation showing your work. BRAINLIESTTTTA plane can fly 11 miles per minute. The plane will fly 6 trips, and each trip is 500 miles. How many hours will the plane fly? Show your work to receive full credit. (10 points) The economic activities of the English colonies during the late-17th and early-18th centuries could BEST be described as A) industrial in both north and south. B) agricultural in both north and south. C) agricultural in the south, industrial in the north. D) industrial in the south, and agricultural in the north A poll conducted in 2013 found that 52% of u.s. adult twitter users get at least some news on twitter.40. the standard error for this estimate was 2.4%, and a normal distribution may be used to model the sample proportion. construct a 99% confidence interval for the fraction of u.s. adult twitter users who get some news on twitter, and interpret the confidence interval in context. Question 4 southern governors used their power as ______ in resisting desegregation during the civil rights era.a. chief spokespersonb. party chiefc. chief lawmakerd. commander in chief What is the height of the wall that is 30 feet long and that required 2310 bricks to build What did frederick law olmstead design to solve the problems of urban growth? Calculate the inductance of a coil that induces 120v when the current through it changes at a rate of 5a/s. calculate the inductance of a coil that in Each nephron has a coiled tube that has a blank membrane Why are dna fragments with more base pairs found near the sample wells (origin) and the lower number of bp fragments found near the anode? How was the chinese government organized under the tang and song dynasties? When several factors affect some physical quantity, what is the general strategy that you would use to determine how each factor affects that quantity? Steam Workshop Downloader