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
USPshnik [31]
3 years ago
13

Which of the following are actions a programmer could take when debugging a segment of code that would most likely lead to findi

ng a problem and fixing it? (choose two)
A. Change the names of variables within the program and run the program again.
B. Display the value of variables at various points during the program.
C. Ask a friend or collaborator to look over the code segment to see if they are able to find any errors.
D. Delete the code and re-type it to make sure there were no spelling errors and that it was written correctly.
Computers and Technology
1 answer:
Verizon [17]3 years ago
6 0

Answer:

Option B and C are the correct answer for the above question

Explanation:

The above question asked about the work of the programmer to catch an error of the program--

  • Then the option B states that the programmer needs to prints the value of the various program variable on every line of the program which is the correct solution because it is used to find the error easily. It defines the value of every variable in every place of the program and the programmer caught the error statement in the program if anywhere the variable gets the false value.
  • The C option states to help from a friend, it is also a good solution because the friend can easily be caught the error of the program by seeing every line of code.
  • But the other option is not correct because the option A states that the change the name of the variable which is not a result of anything.
  • And the option D states that the code will be retyped again which is also not justify anything.

You might be interested in
____must cooperate with each other to neutralize the global threat of information censorship. Select 3 options.
AysviL [449]

<u>The media </u> must cooperate with each other to neutralize the global threat of information censorship. The correct option is the A.

<h3>What is the media?</h3>

The media is the group that collect information about the world and then provide it to the public. It is the main medium to get information about what is going on in the world.

Thus, the correct option is A.

Learn more about the media

brainly.com/question/21333773

#SPJ1

7 0
2 years ago
Write an algorithm to print the odd number from 100 to 1​
stiks02 [169]

Answer:

In python:

for x in range(0,100):

   if x % 2 == 1:

       print(x)

3 0
2 years ago
Your task is to write a C program that measures the latencies of various system calls. In particular, you want to know 1) the co
tensa zangetsu [6.8K]

Answer and Explanation:

#include <stdio.h>

#include<fcntl.h>

#include <sys/time.h>

#include<time.h>

#define MAX 1000

int main()

{

int pid;

int i,fd ;

char c[12];

FILE *fp;

struct timeval start,end;

double time1,time2,time3;

//open file for writing

fp=fopen("output.txt","w");

 

if(!fp)

{

printf("Not able to open the file output.txt\n");

return -1;

}

for(i = 0; i < MAX ; i++)

{

gettimeofday(&start,NULL);

//invoke getpid call

system(pid = getpid());

//printf("%d\n",start.tv_usec);

}

gettimeofday(&end,NULL);

//printf("%d\n",(end.tv_usec - start.tv_usec));

time1 = ((end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec) / 1000000.0)/MAX;

 

//wtite the time taken to execute getpid to

//to get micro second , divide multiply time by 1000000 , to get nano multiply time by 1000000000

printf("getpid(): %.10f %.10f\n",time1*1000000,time1*1000000000);

fprintf(fp,"getpid():%.10f %.10f\n",time1*1000000,time1*1000000000);

//in similar way execute other two commands ,open and read

 

for(i = 0; i < MAX ; i++)

{

gettimeofday(&start,NULL);

//invoke getpid call

system(open("/dev/null", O_RDONLY ));

//printf("%d\n",start.tv_usec);

}

gettimeofday(&end,NULL);

//printf("%d\n",(end.tv_usec - start.tv_usec));

time2 = ((end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec) / 1000000.0)/MAX;

 

//wtite the time taken to execute getpid to

printf("open(): %.10f %.10f\n",time2*1000000,time2*1000000000);

fprintf(fp,"open():%.10f %.10f\n",time2*1000000,time2*1000000000);

//in similar way execute other two commands ,open and read

fd = open("/dev/dev",O_RDONLY );

//printf("fd = %d\n",fd);

for(i = 0; i < MAX ; i++)

{

gettimeofday(&start,NULL);

//invoke getpid call

system( read(fd,c,10));

//printf("%d\n",start.tv_usec);

}

gettimeofday(&end,NULL);

//printf("%d\n",(end.tv_usec - start.tv_usec));

time3 = ((end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec) / 1000000.0)/MAX;

 

//wtite the time taken to execute getpid to

printf("read(): %.10f %.10f\n",time3*1000000,time3*1000000000);

fprintf(fp,"read(): %.10f %.10f\n",time3*1000000,time3*1000000000);

}

----------------------------------------------------------

//output

//I have written output to standard output also , you can remove that

getpid(): 0.1690000000 169.0000000000    

open(): 0.1890000000 189.0000000000    

read(): 3.1300000000 3130.0000000000

------------------------------------------------------

//Makefile content

prob2.o : prob2.c    

         gcc -c  prob2.c                                                                                                                                      

prob2 : prob2.o                                                                                                                                                

       gcc -o prob2 prob2.o                                                                                                                                    

all   :                                                                                                                                                        

       gcc -o prob2 prob2.c                                                                                                                                    

clean:                                                                                                                                                          

       rm -rf prob2.o  

---------------------------------------

use

$make all

then execute as below

$./prob2

3 0
3 years ago
You are building a gaming computer and you want to install a dedicated graphics card that has a fast gpu and 1gb of memory onboa
irga5000 [103]
Usually a graphics card would be plugged in manually through a PCI-e express slot on the motherboard. But to give the card enough power (based on how powerful the card is) you would use a 6 pin or an 8 pin power connector.
<span />
5 0
3 years ago
Read 2 more answers
Word processing programs have different view options that you can use depending on the tasks your performing
inysia [295]

Answer:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Explanation:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Word Views

The Print Layout View

Its the default one, and you will find this one as you open the document. It's best when you are documenting with things such as images, footers, columns headers, etc. And each of the components is going to be visible. You will hence get a view of documents, and how it looks like as per the page breaks.

The full-screen reading view is for reading purposes. It also shows how a printed page will look like.

Web Layout View

This gives us a view of how the document will look like on the web page. And the text gets wrapped to fit into the view if required.

Outline View

This helps when you want to move the sections in your documents, or if you are creating an outline.

Draft View

This will help you to quickly edit the text with the document being opened as a draft, and the headers and footers cannot be viewed in this view.

5 0
3 years ago
Other questions:
  • Which feature is an interface between the user and the file system of a computer?
    6·2 answers
  • Instructions:Drag the tiles to the boxes to form correct pairs.
    11·2 answers
  • describe a real-world scenario where data is collected and needs to be both accurate and precise for the safety of the community
    9·1 answer
  • Why does my Office Computer send packet #1? What device responds by sending back packet #2? What information does my Office Comp
    15·1 answer
  • The "origin" of the cartesian plane in math is the point where x and y are both zero. Given a variable, origin of type Point-- a
    5·1 answer
  • How do you reduce computer screen flicker
    11·1 answer
  • All of the following are examples of being computer literate, EXCEPT ________. Group of answer choices knowing how to build and
    7·1 answer
  • 1. Write an if statement that assigns 20 to the variable y, and assigns 40 to the variable z
    10·1 answer
  • List any three positive impact of a computer​
    9·1 answer
  • Define the term visual as used in visual programming
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!