Computer the value of the given number

Assignment Help Basic Computer Science
Reference no: EM13234449

Prompt the user for a number and an exponent. Computer the value of the given number (the base) raised to the power of the exponent. (For example, the number two raised to the fourth power is 16.) Their suggested correct answer: Get base Get exponent Set i to 1 Set answer to 1 While (i <= exponent) Set answer = answer x base Add 1 to i End loop Print answer Ok my problem... Set answer = answer x base if answer is 1 then we get base as answer every time in this loop for all values of i, as long as, i is equal to or smaller than 1. This does not express an exponential situation or value as asked for in the prompt. What am I not understanding or getting here?

Reference no: EM13234449

Questions Cloud

Define the electron transport chain : In the electron transport chain, electrons from FADH2 are eventually used to reduce O2 into H2O. Experimentally, the proton motive force created by this process will generate 2 ATP molecules from ADP and Pi, using ATP synthase.
Which of the following is most correct : Bob has always performed well and has an excellent track record with the company. He and Arnold do not have any type of employment contract - they've just worked together for the last 30 years.
Explain how the new entrant acts first : Suppose that an industry cartel wishes to keep a new entrant out of an industry. Cartel members can conduct "predatory pricing", where the cartel lowers its price until the entrant leaves, after which it returns it price to the cartel's optimal (m..
Describe electrolysis continue to produce 0.50 g of copper : Electrolysis of a solution of CuSO4(aq) to give copper metal is carried using a current of 0.66 A. How long should electrolysis continue to produce 0.50 g of copper
Computer the value of the given number : Prompt the user for a number and an exponent. Computer the value of the given number (the base) raised to the power of the exponent.
Explain the same density and specific heat as water : If the solution has the same density and specific heat as water, what is ?H for this reaction (per mole of H2O produced)? Assume that the total volume is the sum of the individual volumes. Find kJ/mol of H20
Determine what is the equilibrium price and quantity : Research suggests that taxing pizza and soda would reduce the incidence of obesity in the U.S.A. Suppose you were required to choose between a price ceiling and a floor price to achieve the same result.
Describe the problem of genocide in the 20th century : Describe the problem of genocide in the 20th century. Include a description of the each of the three cases studies of genocide examined in lecture, their commonalities and contrasts, and how they each evidence some of the elements of 20th century glo..
Determine the density : Assume that there is a very beautiful ornate crown, supposedly made of solid gold, how would you determine its density

Reviews

Write a Review

Basic Computer Science Questions & Answers

  File contains data for an individual wedding album

Each line of this file contains data for an individual wedding album and delivery. These data  are used to determine the total cost of producing and posting a batch of albums to a  customer. Each column of this file contains values for the following..

  What is the technique called

In the transport layer, data transmission is controlled to ensure data integrity and avoid data loss. What is the technique called?

  Averages ten homework grades entered

Write a program that averages ten homework grades entered by the user. Allow for a bonus homework grade that can count as 5 extra points on their average. Create at least two functions (excluding main() ) in your program. In the first function, pr..

  Represent processor demand in the time interval

Let the function D[i, j] represent processor demand in the time interval (i, j). Prove the following theorem.

  How lseek call makes a seek to file

Where lseek call makes a seek to byte 3 of file. What does buffer comprise after the read has completed?

  Passing an "in out" parameter to a procedure

In Ada, when passing an "in out" parameter to a procedure, the system is allowed to use either pass-by-reference or pass-by-value-result as it sees fit. Why?

  Write recursive method prints out the digits reverse order

Write the code for a recursive method that accepts an integer argument and prints out the digits in reverse order

  Explaining straight-line depreciation method

Explain in scholarly detail how to carry out Straight-line Depreciation Method calculations.

  When accessing the remote linux machine

When accessing the remote Linux machine

  Determine integer to divide maximum number of partial sums

Now, given sequence, can you determine the integer M (L ≤ M ≤ U) which divides maximum number of partial sums of the sequence?

  Explain decrease in memory cost and push to keep data

Explain the apparent contradiction between the decrease in memory cost and the push to keep a single copy of Explain decrease in memory cost and the push via the paradigm of deduplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd