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 of the following is one way a corporation can raise money?
Vladimir [108]
Selling stock on the stock market
4 0
4 years ago
WHAT DO I DO IN MY FREE TIME????
yanalaym [24]

Answer:

what do u mean

Explanation:

7 0
3 years ago
Read 2 more answers
Technology trends continue to increase the processing capabilities of mobile devices. The latest smartphones include up to 8 pro
baherus [9]

Answer:

Two circumstances under which it might be beneficial to offload application functionality from a powerful smartphone are Data Saving and Ransomware/Malware Protection.

Explanation:

Various data like documents, videos,photos etc can be offloaded to a cloud or cloud-let in order to prevent permanent data loss during inevitable as loss of phone, theft etc.  Such saved data can be easily retrieved from cloud storage when new phones are gotten without any loss. Also, in order to prevent total data and application loss by various various attacks, it is advisable that one stores various application and data on cloud servers to enable retrieval easily. Even some cloud servers offer backup security against such virus attacks.

6 0
3 years ago
Public abstract class Playerpublic class ComputerPlayer extends Player;public class SmartComputerPlayer extends ComputerPlayer;C
ZanzabumX [31]

Here's the full question;

<em>Assume the following partial declarations have been made, with default (no parameter) constructors for the classes.</em>

<em />

<em>public abstract class Player</em>

<em>public class ComputerPlayer extends Player;</em>

<em>public class SmartComputerPlayer extends ComputerPlayer;</em>

<em />

<em>Consider the following declarations.</em>

<em />

<em>I. ComputerPlayer playerA = new SmartComputerPlayer();</em>

<em>II. Player playerB = new SmartComputerPlayer();</em>

<em>III. Player playerC = new Player();</em>

<em />

<em>Which of these declarations will compile correctly?</em>

A.) I only

B.) II only

C.) III only

D.) I and II

E.) II and III

<u>Answer:</u>

<u>C)</u>

Explanation:

One of the rules of Java programming is that it must have a class which is a blueprint that informs about the behavior that the object of that class support.

If we go by the strict rules of Java programming only the class declaration;

Player playerC = new Player();

would compile correctly.

All other options would result in compiler error.

6 0
3 years ago
A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
ch4aika [34]

The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

The following information related to artificial intelligence is:

  • It refers to the human intelligence where the machines could be treated as humans and according to this, the actions should be mimic.
  • It should be used for any kind of machine where the traits should be associated along with the mind of the human-like for learning & problem-solving purpose.

Therefore we can conclude that The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

Learn more about the machine here: brainly.com/question/2555822

3 0
3 years ago
Other questions:
  • Write a program that uses a two dimensional array to store the highest and lowest temperatures for each month of the calendar ye
    10·1 answer
  • Invention I chose was radio.
    9·1 answer
  • Which of the following best describes the protocols used on the Internet?
    9·1 answer
  • The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IE
    6·1 answer
  • ________ is an encryption standard used for secure transactions such as credit card processing and online banking. TLS DMZ White
    14·1 answer
  • What is metrical task system algorithm?? and can we use that in online shopping project??
    11·1 answer
  • State three reasons why users attach speakers to their computer​
    8·1 answer
  • 9. Lael wants to determine several totals and averages for active students. In cell Q8, enter a formula using the COUNTIF functi
    9·1 answer
  • Develop a program working as a soda vending machine. The program should show the product menu with price and take user input for
    11·1 answer
  • Olivia wants to change some settings in Outlook. What are the steps she will use to get to that function? open Outlook → File →
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!