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
Alekssandra [29.7K]
3 years ago
11

A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the va

lue of each variable at each step is known asError checking
Hand writing
Hand tracing
Error handling
None of these
Computers and Technology
1 answer:
Elza [17]3 years ago
5 0

Answer:

Hand tracing.

Explanation:

Similar to regular debugging which is mainly used for finding errors, hand tracing or simply tracing, is the process of stepping through each statement while tracking and recording the value of specific variables at each step. Tracing is a debugging process which allows programmers to get required information about how a program executes or how it works.

To perform hand-tracing, the programmer might add tracing messages at logical points of the code. Like comments, tracing messages can enhance readability and understandability of the code or program.

<em>PS: Tracing can even be done without a computer. </em>

You might be interested in
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

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

  {

      sum = sum + arr[i]; //count sum

  }  

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

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

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

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
Write some positive and negative impacts of computer in our daily life​
8090 [49]
Positive impacts are
1. Communicating with people
2. Daily update of what going on in the world
3. learn new things
Negative impacts are
1. Viruses
2. Private information shared
3. Less face to face conversations
3 0
2 years ago
Define a method named swapValues that takes an array of four integers as a parameter, swaps array elements at indices 0 and 1, a
Luba_88 [7]

The program is an illustration of arrays.

Arrays are used to hold multiple values.

The program in java, where comments are used to explain each line is as follows:

import java.util.*;

public class Main{

   //This defines the method

public static int[] swapValues(int[] arr) {

   //This swaps the first and second array elements

       int temp = arr[0];

       arr[0] = arr[1];   arr[1] = temp;

   //This swaps the third and fourth array elements

       temp = arr[2];

       arr[2] = arr[3];   arr[3] = temp;

   //This returns the swapped array to main

       return arr;

}

//The main method begins here

   public static void main(String[] args) {

       //This creates a Scanner object

       Scanner input = new Scanner(System.in);

 //This declares an array of 4 elements

 int[] intArray = new int[4];

 //This gets input for the array

 for(int i = 0; i<4;i++){

     intArray[i] = input.nextInt();

 }

 //This calls the swapValues method

 intArray=swapValues(intArray);

 //This prints the swapped array

 for (int i = 0; i < 4; i++){

 System.out.print( intArray[i]+ " ");     }

}  

}

At the end of the program, the elements are swapped and printed.

Read more about similar programs at:

brainly.com/question/14017034

6 0
2 years ago
1. Scrieţi un program care citeşte un număr natural n şi determină produsul cifrelor impare ale lui n. De exemplu, pentru n = 23
saveliy_v [14]

Answer:

1.  

num1 = input("Enter the value of n")  

n = int(num1)  

def calc(n):  

Lst = []  

while n > 0:  

remainder = n % 10  

Lst.append(remainder)  

quotient = int(n / 10)  

n = quotient  

i = len(Lst) - 1  

sum = 1  

for i in range(0, len(Lst)):  

if(i % 2 != 0):  

sum *=Lst[i];  

else:  

continue  

print(sum)  

return(0)  

\ r2

num=input("Enter the value of n")

arr=[12,-12,13,15,-34,-35,35,42]

def div7positive():

  sum = 0

  m = 0

  i = 0

  while m <= 7:

      if(arr[i]>=0 and arr[i]%7 == 0):

          sum +=arr[i]

      i = i + 1

      m += 1

       

   

  print("sum of number divisible by 7 and positive is", +sum);

div7positive()

\ r

\ r3.Write an algorithm that reads a natural number n and calculates the sum:

\ rS = 1 / (1 * 2) + 1 / (2 * 3) + 1 / (3 * 4) +… + 1 / ((n-1) * n)

\ r

num=input("Enter the value of n")

def sumseries():

  sum = 0

  m= 0

  while m <= 7:

      sum +=1/((int(num)-1)*int(num))

      m += 1

  print("sum of series is", +sum)

sumseries()

\ R4. Read a natural number n. Calculate the sum of its own divisors n. For example, for n = 12, the sum of its own divisors is 2 + 3 + 4 + 6 = 15

num=input("Enter the value of n")

def sumdivisors():

  sum = 0

  m= 2

  while m <= int(num):

      if int(num) % m == 0:

          sum += m

      m += 1

  print("sum of divisors is", +sum)

sumdivisors()\ r

\ R5. We read a natural number n and then whole numbers. Calculate and display the sum of the natural numbers between 10 and 100. For example, if n = 5 and then read 30, –2, 14, 200, 122, then the sum will be 44 (that is, 30 + 14).

\ r

Lst = []  

num=input("Enter the value of n")

i = 0

while i<= int(num):

  num1=input("Enter the element of array")

  Lst.append(int(num1));

  i += 1

def numbet0and100():

  sum = 0

  m= 0

  while m <= int(num):

      if Lst[m] <= 100 or Lst[m] >=0:

          sum += Lst[m]

      m += 1

  print("sum of numbers between 0 and 100 is", +sum)

numbet0and100()

\ R6. A natural number n of maximum 4 digits is read. How many digits are in all numbers from 1 to n? For example, for n = 14 there are 19 digits, and for n = 9 there are 9 digits.

\ r

num = input("Enter the value of n")

n = int(num)

print(“sum as required is:” (n -9) + n)  

 

\ R7. Read the natural numbers n and S, where n can be 2, 3, 4 or 5. Show all the numbers of n digits that have the numbers in strictly ascending order, and the sum of the digits is S. For example, for n = 2 and S = 10, 19, 28, 37, 46 will be displayed.

num = input("Enter the value of n")

n = int(num)

Lst = []

def calc(n):

  i = 1

  total = pow(10,n)

  while i <= total:

      j = i

      while j > 0:

          remainder = j % 10  

          Lst.append(remainder)

          quotient = int(j / 10)

          if quotient > 0:

              j = quotient

          else:

              length = len(Lst) - 1

              sum = 0

              while length >= 0:

                  sum += Lst[length]

                  length = length - 1

              if sum == pow(10,n):

                  print(j)

              k = len(Lst)

              del Lst[0:k]

      i = i + 1

  return(0)

calc(n)

\ r

\ R8. We consider the row 1, 1, 2, 3, 5, 8, 13, ... in which the first two terms are 1, and any other term is obtained from the sum of the preceding two. Write an algorithm that reads a natural number n and displays the first n terms of this string. For example, for n = 6, 1, 1, 2, 3, 5, 8 will be displayed.

\ r

nterm = int(input("What number of terms do you want?"))

a, b = 0, 1

totalcount = 0

if nterm <= 0:

 print("Please input a positive number")

elif nterm == 1:

 print("Fibonacci number upto which",nterm,":")

 print(a)

else:

 print("Fibonacci series:")

 print(nterm)

 while totalcount < nterm:

     print(a)

     nth = a + b

     a = b

     b = nth

     totalcount += 1

 

\ 9. Write an algorithm that reads two natural numbers n1 and n2 and displays the message "yes" if the sum of the squares of the digits of n1 is equal to the sum of the numbers of n2 or "no" otherwise. For example, for n1 = 232 and n2 = 881, "yes" will be displayed, and for n1 = 45 and n2 = 12, "no" will be displayed.

num1 = input("Enter the value of n")

num3 = input("Enter the value of n")

n = int(num1)

num2 = int(num3)

def calc(n):

  Lst = []

  while n > 0:

      remainder = n % 10  

      Lst.append(remainder)

      quotient = int(n / 10)

      n = quotient

       

  i = len(Lst) - 1

  sum = 0

  while i >= 0:

      sum += Lst[i]* Lst[i]

      i = i - 1

  return(sum)

def calc1(num2):

  Lst = []

  while num2 > 0:

      remainder = num2 % 10  

      Lst.append(remainder)

      quotient = int(num2 / 10)

      num2 = quotient

       

  i = len(Lst) - 1

  sum = 0

  while i >= 0:

      sum = Lst[i] + Lst[i]

      i = i - 1

  return(sum)

a = calc(n)

b = calc1(num2)

if a == b:

  print("yes")

else:

  print("No")

\ r

\ R10. Write an algorithm that reads a natural number n and displays the message "yes" if all of its n numbers are distinct, or "no" if n does not have all the distinct digits. For example, for n = 37645 it will display "yes" and for 23414 it will show "no".

\ r

num1 = input("Enter the value of n")

n = int(num1)

def calc(n):

  Lst = []

  while n > 0:

      remainder = n % 10  

      Lst.append(remainder)

      print( remainder)

      quotient = int(n / 10)

      n = quotient

       

  flag = 1

  for i in range(0, len(Lst)):

      for j in range(i+1, len(Lst)):    

          if Lst[i] == Lst[j]:    

              flag = 0

              break

           

  if flag == 1:

      print("YES")

  else:

      print("NO")

  return(0)

Explanation:

Please check answer.  

3 0
2 years ago
How do you get a free ps4
KatRina [158]

Answer:

By having very good luck and winning it in a giveaway!!!

4 0
2 years ago
Read 2 more answers
Other questions:
  • In addition to talking to other doctors remotely, telegraphy technology?
    5·1 answer
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • Melissa needs to put a topic name on her email that she will send will to her teacher . choose the name of the field
    6·2 answers
  • Is spread spectrum transmission done for security reasons in commercial WLANs?
    13·1 answer
  • Who creates Virus ? virus is not made for what?
    14·2 answers
  • Can I change my username?
    6·1 answer
  • Which statements about organizing messages in Outlook 2016 are true? Check all that apply. The Categories function is used for g
    13·2 answers
  • Detecta 1 problema
    5·2 answers
  • Why is quantum computing potentially a better fit for weather forecasting than classical computers?.
    8·1 answer
  • Determine which program you would recommend each of the customers should use. There are multiple correct answers so please inclu
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!