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
bonufazy [111]
3 years ago
14

I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the

number i typed, "3".

Computers and Technology
1 answer:
sweet-ann [11.9K]3 years ago
3 0

You're substracting one from the variable "exponent" with every iteration of the loop, and you told it to break out of the loop once "exponent" is 0, therefore, it's always going to end up as 0 at the end.


If you want to keep the input from the user, then declare another variable like "counter" and assign the value of "exponent" to it and use it for the loop


Or even better, do this for the loop:

for(int i = 0; i < exponent; i++)

{

//Code here

}

You might be interested in
Which group of commands all appear on the Standard toolbar?
topjm [15]
I hope this helps

print 
copy 
past 
send 

7 0
3 years ago
.WAP to enter monthly sale of Salesman and give him commission i.E. If the monthly sale is more than 500000 then commision will
nexus9112 [7]

sales = float(input("Enter monthly sales amount: $"))

commission = 0.05

if sales> 500000:

   commission = 0.1

print("You earned: $"+str(sales*commission))

I wrote my code in python 3.8. I hope this helps.

5 0
2 years ago
Which of the following is typically used in a flowchart to indicate a decision?
Vilka [71]
Diamond is typically used in a flowchart or indicate a decision.
6 0
3 years ago
The person who Oversee the direct work of employees and is responsible for the day-to-day tasks the employees complete is likely
tatuchka [14]

Answer: Operational Manager

3 0
3 years ago
Read 2 more answers
What are the basic tools for coding HTML manually?
ipn [44]
The answer should be C, you need a text editor to write out the code, and then a web browser to view what the code creates.
5 0
3 years ago
Read 2 more answers
Other questions:
  • All animations on the world wide web are flash animations
    11·2 answers
  • Which statements best describe slaves in ancient times? Select all that apply.
    8·1 answer
  • Many computer magazines and Web sites present comparisons of several DBMSs. Find one such DBMS comparison article and compare th
    10·1 answer
  • In the Dynamic Partitioning technique of memory management, the placement algorithm that scans memory from the location of the l
    11·1 answer
  • The browser on which you are viewing web pages is called the
    13·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
  • What is the theory of relativity? How does it relate to the creation of electricity through solar energy?
    12·1 answer
  • If a movie, song, or book is offered for free, is it malware?
    15·1 answer
  • What is the first step in finding a solution to a problem?
    9·2 answers
  • Why do companies use online collaborative productivity software.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!