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
Pavel [41]
2 years ago
5

Debug the following program.

Computers and Technology
1 answer:
mamaluj [8]2 years ago
4 0

Answer:

The debugged program is as follows:

A=2

B=2

For I=1 to 10

PRINT A

TEMP = A

A=B

B=TEMP+A

NEXT I

END

Explanation:

First, the value of B should be changed to 4 (because the second term of the sequence is 2

Next, change Display to Print because Q-basic uses the print keyword to display output

The sequence is not properly generated. So, I update that part of the program to:

<em>For I=1 to 10 </em>

<em>PRINT A </em>

<em>TEMP = A </em>

<em>A=B </em>

<em>B=TEMP+A </em>

<em>NEXT I </em>

<em />

Lastly, the loop is controlled by variable I (not X).

So change NEXT X to NEXT I

You might be interested in
Write a class named Book containing: Two instance variables named title and author of type String. A constructor that accepts tw
andrey2020 [161]

Answer:

The code to this question can be given as:

Code:

public class Book  //define class.  

{

private String title, author;   //define variable.

Book(String a, String b)  //define parameterized constructor.

{

title = a;   //holding value.

author = b;

}

public String toString()  //string function

{

return title + "\n" + author;    //return value.

}

}

Explanation:

In the above java code firstly we declare the class book that name is already given in the question. Then we declare the private variable that datatype is string author and title. Then we declare the parameterized constructor. In the parameterized constructor we use the private variable for hold constructor parameter value. Then we declare the tostring() function in this function we return value of the title and author variable.

3 0
3 years ago
The highlighted items in the webpage are called …………………………………..
seraphim [82]

Answer:

highlighted items in webpage are called links.

5 0
3 years ago
1. For the following program to be executed over the single accumulator
AlexFokin [52]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

#include <iostream> // it is preprocessor director that manipulate the input output in the program

using namespace std;// it is used to format input and output

int main() { // main function is started

int x = 5; // variable x is declared and initialized with value 5.

int y = 6; //variable y is declared and initialized with value 6.

int z = 34;  //variable z is declared and initialized with value 34.

int total = (x+(x + y)*z+y); // variable total is declared and initialized with value of x,y,and z. and calculation performed on these value such as (5+(5+6)*34+6) that is equal to 385.

cout << total; // print the value of total variable that is 385

return 0;

}​

6 0
3 years ago
What’s the difference between the alternative press and a tabloid?
miskamm [114]

Answer:

Alternative Press just differs in opinion from mainstream media. A tabloid is literally smaller and is contains sensationalist and largely photographic content.

Most alternative presses aren't reliable and are effectively tabloids in nature, but their content differs.

4 0
2 years ago
Media _____ refers to a worldwide educational movement that aims to teach to people to understand how the media affect both indi
mario62 [17]

Answer:

literacy

Explanation:

Media literacy. This is a worldwide educational movement that aims to teach to people to understand how the media affect both individuals and society as a whole.

3 0
2 years ago
Other questions:
  • You are attempting to gather information about a client's network, and are surveying a company site. Access is gained via secure
    8·1 answer
  • When you write a check, why do you always begin writing the amount of the check as far to the left as you can?
    6·1 answer
  • What is the difference between simple and complex waveforms?
    10·1 answer
  • Which DHCPv4 message will a client send to accept an IPv4 address that is offered by a DHCP server? (Points : 5) Unicast DHCPACK
    8·1 answer
  • The World Wide Web Click on a Description on the left, then click the Term that best fits the Description. Description Technolog
    5·1 answer
  • A _______ policy states that the company may access, monitor, intercept, block access, inspect, copy, disclose, use, destroy, or
    5·1 answer
  • ...............is a personal computer that fits on desk.​
    5·2 answers
  • SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SU
    6·2 answers
  • Which of the statements below is true?
    15·1 answer
  • 1. The opportunity to create several equations for launching program files is called
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!