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
miskamm [114]
2 years ago
9

Adam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correc

t answer. But when Adam tests the program, it always outputs that it took the user one guess, even when it takes many guesses. What error did Adam most likely make, and how should it be fixed? The difference between a for loop and a while loop is that a for loop is a loop that happens for a certain number of times. A while loop happens until a certain condition is met. How do you know when to use each one? Give specific examples in your answer. What are some programs that you have used that have condition-controlled loops and count-controlled loops? Why is it important that if, elif, and else statements appear in the proper order? What are some situations where you might find it useful to use the “!” symbol in a program?
Computers and Technology
2 answers:
nadezda [96]2 years ago
6 0

Answer:

Adam most likely forgot to add a while loop to the guessing code or didn’t add it properly, meaning that instead of letting him guess multiple times it just continues the code, all he needs to do is add a while loop to fix the line of code.  

Explanation:

hope this helps

NNADVOKAT [17]2 years ago
5 0

Answer:

There are two ways in which programs ... count-controlled loops; condition-controlled loops ... Sometimes it is necessary for steps to iterate a specific number of times. ... A count-controlled loop is used when the number of iterations to occur is ... the variable 'count' is used to keep track of how many times the algorithm

Explanation:

You might be interested in
Q: Why can't I log in to Brainly
algol13

Answer:

yes you are probably on a school Chromebook

Explanation:

5 0
3 years ago
What is professionalism and unprofessionalism in the work place?​
Dmitrij [34]

Answer:

Professionalism means communicating effectively and appropriately and always finding a way to be productive. Employers want new workers to be responsible, ethical, and team oriented, and to possess strong communication, interpersonal, and problem solving skills. Wrap these skills up all together and you've got professionalism.

There are many types of unprofessional behavior in the workplace, which include habitual tardiness, absence, harassment or bringing personal issues to the job. These behaviors can cause disruption to the company as a whole, which means they should be dealt with as soon as possible.

8 0
2 years ago
FREEFREEFREEFREEFREEFREE
Brrunno [24]

Answer:

niceeee :0

Explanation:

5 0
3 years ago
Read 2 more answers
g Write a program that prompts the user for an integer n between 1 and 100. If the number is outside the range, it prints an err
grin007 [14]

Answer:

The cpp program is given below.

#include<iostream>

#include<iomanip>

using namespace std;

int main() {

   

   // variables declared

   int n;

   int sum=0;

   float avg;

   

   do

   {

       // user input taken for number    

       cout<< "Enter a number between 1 and 100 (inclusive): ";

       cin>>n;

       

       if(n<1 || n>100)

           cout<<" Number is out of range. Enter valid number."<<endl;

       

   }while(n<1 || n>100);

   

   cout<<" "<<endl;

   

   // printing even numbers between num and 50  

   for(int num=1; num<=n; num++)

   {

       sum = sum + num;

   }

   

   avg = sum/n;

   

   // displaying sum and average

   cout<<"Sum of numbers between 1 and "<<n<<" is "<<sum<<endl;

   cout<<"Average of numbers between 1 and "<<n<<" is ";

   printf("%.2f", avg);

   

       return 0;

}

OUTPUT

Enter a number between 1 and 100 (inclusive): 123

Number is out of range. Enter valid number.

Enter a number between 1 and 100 (inclusive): 56

 

Sum of numbers between 1 and 56 is 1596

Average of numbers between 1 and 56 is 28.00

Explanation:

The program is explained below.

1. Two integer variables are declared to hold the number, n, and to hold the sum of numbers from 1 to n, sum. The variable sum is initialized to 0.

2. One float variable, avg, is declared to hold average of numbers from 1 to n.

3. User input is taken for n inside do-while loop. The loop executes till user enters value between 1 and 100. Otherwise, error message is printed.

4. The for loop executes over variable num, which runs from 1 to user-entered value of n.

5. Inside for loop, all the values of num are added to sum.

sum = sum + num;

6. Outside for loop, average is computed and stored in avg.

avg = sum/n;

7. The average is printed with two numbers after decimal using the following code.

printf("%.2f", avg);

8. The program ends with return statement.

9. All the code is written inside main() and no classes are involved.

3 0
3 years ago
How might a company gain followers on Twitter?
Tresset [83]
By sending persuasive / informable and interesting posts to gain followers.
3 0
3 years ago
Other questions:
  • What is the primary criticism against a national identification system based on biometric data?
    13·1 answer
  • Describe the following software process models using your own words .Your explanation should also provide an example of a softwa
    12·1 answer
  • A user deletes a message from a mailbox while on a desktop. What happens to the email message on the user's synchronized devices
    13·2 answers
  • Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline.
    15·1 answer
  • The architecture that the large paper company Mohawk adopted enables the company to scale technology services up and down instan
    14·1 answer
  • User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all that apply)
    10·2 answers
  • A human subject’s photographs show two catchlights in each eye that are unwanted by the photographer. What is the most likely ca
    12·1 answer
  • What is computer science​
    9·1 answer
  • Imagine that you are creating a website for a client. How will you interact with the client, gather requirements, and update the
    7·2 answers
  • To make the monster pace, you needed the monster to turn ___ degrees.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!