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
adelina 88 [10]
2 years ago
9

dam 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 correct

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?
Computers and Technology
1 answer:
Virty [35]2 years ago
6 0

Answer:

Adam had most likely made a logic error.

Explanation:

Adam should check his code for any wrong formulas used or wrong arithmetic symbols.

You might be interested in
What is the value of count after this nested FOR loop executes fully.
Alisiya [41]

Answer:

168 (although the =< must be corrected to <=)

Explanation:

int count = 0;

for (int row = 4; row <= 15; row++)

for (int col = 0; col < 13; col = col +2)

count+=2;

The inner for loop runs 7 times (for col = 0,2,4,6,8,10,12). Anything higher is not less than 13. Therefore the inner loop increments count by 2 seven times, i.e. it increments count by 14.

The outer for loop runs 12 times (for row = 4,5,6,7,8,9,10,11,12,13,14,15).

If the count is incremented by 14 twelve times, you are incrementing it by 14*12 = 168.

Therefore the count goes from 0 to 168 after the nested loops.

5 0
3 years ago
The following is a sequence of undo-log records written by two transactions T and U: &lt; START T&gt;; ; &lt; START U&gt;; ; ; ;
tatiyna

Answer:

Giving that: The following is a sequence of undo-log records written by 2 transactions T and U:

< START T >;

< T,A,10 >;

< START U >;

< U, B, 20 >;

< T, C, 30 >;

< U, D, 40 >;

< Commit U >;

< T, E, 50 >;

< Commit T >;

1. < START U >

      Recovery action in this case will be undo(-1) and undo(0). All restored to its original Value

     log records < T, A, 10 >,  < T, abort >; as written out

2. < T, E, 50 >

      Recovery action in this case will be undo(8) and redo(0). A and C is restored to its original value, B and D are set to 20 and 40

      log records <T, C, 30 >,  < T, A, 10 >,  < T, abort >  are written out

3. < Commit T >

      Recovery action in this case will be redo(7) and redo(4). A and C are set to 10 and 30, B and D are set to 20 and 40

7 0
3 years ago
Why is art important to heritage?
Sophie [7]
<span>but of culture, values and traditions. Cultura</span>
7 0
3 years ago
Write a program that allows the user to enter a start time and a future time. Include a function named compute Difference that t
Aleonysh [2.5K]

Step 1

Following is the c++ program:

Variables used:

startHours, startMins are used to store the starting time of time machine.

futureHours, futureMins are used to store the future time of time machine.

xAM variable is used to store meridiem of start and future time.

isSAM is boolean variable that is true if starting time is AM.

isFAM is boolean variable that is true if future time is AM.

 

Functions:

main() is used to call computeDifference() function that will calculate the difference between the start and future time.

computeDifference() takes as input six variables from the user and then apply the following logic to compute the difference between the start and future time:

If Meridien of both start and future time are the same, then simply subtract the start time from the future time.

Difference = future minutes – start minutes

If Meridien of both start and future time are different, then apply the following formula to calculate difference:

Difference = (12 * 60 – start minutes) + future minutes

Step 2

Program :

#include <iostream> //header file for input and output

 

using namespace std;

//calculate the time difference(in minutes) between start time and future time.

int computeDifference(int startHours, int startMins, bool isSAM, int futureHours, int futureMins, bool isFAM) {

 int difference = 0; //to store difference

 startMins = startHours * 60 + startMins; //converting in minutes.

 futureMins = futureHours * 60 + futureMins; //converting in minutes.

 //applying formula for difference.

 if (isSAM == isFAM) {

   difference = futureMins - startMins;

 } else if (isSAM == true && isFAM == false) {

   difference = (12 * 60 - startMins) + futureMins;

 }

}

int main() {

 int startHours, startMins; //it will store start time

 int futureHours, futureMins; //it will store future time.

 string xAM; //it will store meridiem.

 bool isSAM; //it will be true if start time is AM.

 bool isFAM; //it will be true if future time is in AM.

 int difference = 0; //it will store difference.

 cout << "Enter start time of time machine as 'HH MM AM/PM': "; //take input from

7 0
3 years ago
Which is an example of an binary number?
Liula [17]
The second one
01111
This is because a computer uses binary and only understands two digits which consit of 1 and 0
8 0
3 years ago
Read 2 more answers
Other questions:
  • HELP PLEASE NOW ASAP BRAINLIEST
    13·2 answers
  • You have a site (Site1) that has about 20 users. For the last few months, users at Site1 have been complaining about the perform
    9·1 answer
  • The data in a data warehouse have which of the following characteristics?
    12·1 answer
  • Which of the following is NOT considered a step in the problem solving process. A Try B Discover C Prepare D Define
    12·1 answer
  • The overall visual look of a chart in terms of its graphic effects, colors, and backgrounds is the:
    5·1 answer
  • Calculate the performance of a processor taking into account stalls due to data cache and instruction cache misses. The data cac
    11·1 answer
  • What does the FixedUpdate loop do? Why do developers use it?
    14·1 answer
  • cpp g Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print fo
    15·1 answer
  • Which of the following is an example of a trade journal?
    7·2 answers
  • Def rectangle_area(base,height):
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!