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]
3 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]3 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
(Count the occurrences of words in a text file) Rewrite Listing 21.9 to read the text from a text file. The text file is passed
Oksanka [162]

Answer:

Explanation:

The following is written in Java. It uses File input, to get the file and read every line in the file. It adds all the lines into a variable called fullString. Then it uses regex to split the string into separate words. Finally, it maps the words into an array that counts all the words and how many times they appear. A test case has been created and the output can be seen in the attached image below. Due to technical difficulties I have added the code as a txt file below.

3 0
3 years ago
For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
Marrrta [24]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

int main()

{

// Declare variables

int childticket, adultticket, childprice, adultprice;

double total, net, distributor;

string movie;

// Prompt user for name of movie

cout<<"Movie Name; ";

// Accept input for movie name

cin>>movie;

// Prompt user and accept input for price of adult tickets

cout<<"Adult Ticket Price: $";

cin>>adultprice;

// Prompt user and accept input for price of child tickets

cout<<"Child Ticket Price: $";

cin>>childprice;

// Prompt user and accept input for number of sold adult tickets

cout<<"Adult Ticket Sold: ";

cin>>adultticket;

// Prompt user and accept input for number of child tickets sold

cout<<"Child Ticket Sold: ";

cin>>childticket;

// Calculate total

total = childticket * childprice + adultticket * adultprice;

// Calculate distributor's payment

distributor = 0.25 * total;

// Calculate net box pay

net = 0.75 * total;

// Display and format results

cout<<"Gross Box Office Revenue: $";

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

cout<<"\n Amount Paid to Distributor: -$";

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

cout<<"\nNet Box Office Revenue: $";

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

return 0;

}

6 0
2 years ago
Timing circuits are a crucial component of VLSI chips. Here’s a simple model of such a timing circuit. Consider a complete balan
gregori [183]

Answer:

Let L and R be the sub-trees underneath the root r.

If the height of L (where we consider height to be the maximum length of all root-leaf paths) is ∆ more than that of R, ∆ ≥ 0, then the length of the edge  (r, R) is increased by ∆.

Then, we separately perform the same cycle over L and R.

Once more, by induction, argue that this greedy algorithm is efficient –

when it does not increase the length of (r, R) edge by ∆, then prove that the solution can be improved.

5 0
3 years ago
Which of these is the function of a modeler?
Liono4ka [1.6K]

Answer:

Create 3D assets from sketches

Explanation:

A modeler Job is to model all of the 3D/2D assets needed to obtain the final result wanted by the developers. The modeler creates the assets from sketches or images provided to him according to the theme.

5 0
3 years ago
Read 2 more answers
Which of the following is true about REST?
goblinko [34]

Answer:

D

Explanation:

7 0
3 years ago
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • _______ are unprocessed facts that a computer feeds on.
    5·1 answer
  • What would be a situation in which you could use an excel chart to present your data
    8·2 answers
  • 1.Which type of camera tool pushes the picture back and makes it wider, exaggerating the distance between the background and for
    13·2 answers
  • A _____ is a harmful program that resides in the active memory of a computer and duplicates itself. Select one: a. scareware b.
    7·1 answer
  • Write a method named removeRange that accepts an ArrayList of integers and two integer values min and max as parameters and remo
    10·1 answer
  • Only need help on f and correct me if im wrong for the other questions please
    11·1 answer
  • What is the extension of a Microsoft access database 2013​
    7·2 answers
  • How can she change that value so it is reflected in the chart in her presentation?
    5·2 answers
  • Which of the following statements is correct? User data cannot be combined and shared among authorized users. In a nondatabase,
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!