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
Keith_Richards [23]
3 years ago
5

A(n) ________ virus runs a program that searches for common types of data files, compresses them, and makes them unusable.

Computers and Technology
1 answer:
ad-work [718]3 years ago
5 0

Answer:

encryption

Explanation:

A(n) encryption   virus runs a program that searches for common types of data files, compresses them, and makes them unusable.

You might be interested in
Write a static method called bothStart that allows the user to input two Strings and returns the String that is the longest subs
marishachu [46]

Answer:

  1.    public static String bothStart(String text1, String text2){
  2.        String s = "";
  3.        if(text1.length() > text2.length()) {
  4.            for (int i = 0; i < text2.length(); i++) {
  5.                if (text1.charAt(i) == text2.charAt(i)) {
  6.                    s += text1.charAt(i);
  7.                }else{
  8.                    break;
  9.                }
  10.            }
  11.            return s;
  12.        }else{
  13.            for (int i = 0; i < text1.length(); i++) {
  14.                if (text1.charAt(i) == text2.charAt(i)) {
  15.                    s += text1.charAt(i);
  16.                }else{
  17.                    break;
  18.                }
  19.            }
  20.            return s;
  21.        }
  22.    }

Explanation:

Let's start with creating a static method <em>bothStart()</em> with two String type parameters, <em>text1 </em>&<em> text2</em> (Line 1).  

<em />

Create a String type variable, <em>s,</em> which will hold the value of the longest substring that both inputs start with the same character (Line 2).

There are two possible situation here: either <em>text1 </em>longer than<em> text2 </em>or vice versa. Hence, we need to create if-else statements to handle these two position conditions (Line 4 & Line 13).

If the length of<em> text1</em> is longer than <em>text2</em>, the for-loop should only traverse both of strings up to the length of the <em>text2 </em>(Line 5). Within the for-loop, we can use<em> charAt()</em> method to extract individual character from the<em> text1</em> & <em>text2 </em>and compare with each other (Line 15). If they are matched, the character should be joined with the string s (Line 16). If not, break the loop.

The program logic from (Line 14 - 20) is similar to the code segment above (Line 4 -12) except for-loop traverse up to the length of <em>text1 .</em>

<em />

At the end, return the s as output (Line 21).

5 0
3 years ago
Input and Output. Keep the program running in a Do-While Loop or While Loop. Conditional statements. User defined functions for
kolezko [41]

Answer:

See explaination

Explanation:

#include <stdio.h>

#define MAX_SIZE 50

#define password "mypassword"

void addProduct(struct product arr[], struct product p);

void deleteProduct(struct product arr[], char[] productId)

void editProduct(struct product arr[], int incrementKey, char[] productId) //incrementKey is the how much quanity user wants to add of the existing product

void display(struct product arr[]);

void saleProduct(struct product arr[], char[] productId, int soldItems);

void displayHighestSaleProduct(struct product arr[]);

void displayProductWithZeroQuantity(struct product arr[]);

int totalItems = 0;

struct product

{

char id[10]; //product id

char name[50]; //name of product

int quantity; //number of items of product in the inventory

int numSold; //number of items sold

float price; //price of the product

float sales; //total sale

};

void saleProduct(struct product arr[], char[] productId, int soldItems)

{

int index = 0;

while(strcmp(arr[index].id, productId) != 0) //getting the index of product same as productId

index++;

arr[index].qunatity -= soldItems;

arr[index].sales += (soldItems*arr[index].price);

}

void displayProductWithZeroQuantity(struct product arr[])

{

int x = 0;

printf("Zero Quantity Product:");

for(int i=0;i<totalItems;i++)

if(arr[i].qunatity == 0)

{

printf("Id=>%s\tName=>%s\tQuantity=>%d\tNumSold=>%.2f\tPrice=>%d\tSales=>%.2f", &arr[i].id, &arr[i].name, &arr[i].quantity, &arr[i].numSold, &arr[i].price, &arr[i].sales);

x = 1;

}

if(x == 0)

printf("No product with zero quantity.");

}

void displayHighestSaleProduct(struct product arr[])

{

float max = 0.0f;

int index = 0;

for(int i=0;i<totalItems;i++)

if(arr[i].sales > max)

{

max = arr[i].sales;

index = i;

}

printf("Highest saling product:");

printf("Id=>%s\tName=>%s\tQuantity=>%d\tNumSold=>%.2f\tPrice=>%d\tSales=>%.2f", &arr[index].id, &arr[index].name, &arr[index].quantity, &arr[index].numSold, &arr[index].price, &arr[index].sales);

}

void display(struct product arr[])

{

for(int i=0;i<totalItems;i++)

{

printf("Id=>%s\tName=>%s\tQuantity=>%d\tNumSold=>%.2f\tPrice=>%d\tSales=>%.2f", &arr[i].id, &arr[i].name, &arr[i].quantity, &arr[i].numSold, &arr[i].price, &arr[i].sales);

printf("\n");

}

}

void editProduct(struct product arr[], int incrementKey, char productId[])

{

int index = 0;

while(strcmp(arr[index].id, productId) != 0) //getting the index of product same as productId

index++;

arr[index].quantity += incrementKey ;

}

void addProduct(struct product arr[], struct product p)

{

int index = 0;

while(index < totalItems)

index++;

arr[index] = p;

totalItems++;

}

void deleteProduct(struct product arr[], char[] productId)

{

int index = 0;

while(strcmp(arr[index].id, productId) != 0) //getting the index of product same as productId

index++;

for(int i = index;i<totalItems-1;i++)

arr[i] = arr[i+1] ;

totalItems--;

}

void processintChoice(int x, struct product arr)

{

switch(x)

{

case 1:

{

char id[10];

char name[50];

int quantity;

float price;

printf("\nenter the id of product:");

scanf("%s", &id);

printf("\nenter the name of product:");

scanf("%s", &name);

printf("\nenter the quantity of product:");

scanf("%d", &quantity);

printf("\nenter the price of product:");

scanf("%.2f", &price );

struct product p;

p.id = id;

p.name = name;

p.quantity = quantity;

p.price = price;

p.numSold = 0;

p.sales = 0.0f;

addProduct(arr, p);

}

case 2:

{

char str[10];

int num;

printf("enter the product id");

scanf("\n%s", &str);

printf("enter the number by which you want to increase product items.")

scanf("\n%d", &num);

editProduct(arr, num ,str);

}

case 3:

{

char p[10];

printf("enter the product id to delete product:");

scanf("\n%s", &p);

deleteProduct(arr, p);

}

case 4:

{

display(arr);

}

case 5:

{

char p[10];

int num;

printf("enter the product od to purchse:");

scanf("\n%s", &p);

printf("enter the number of items u want to purchse:");

scanf("\n%d", &num);

saleProduct(arr, p, num);

}

case 6:

{

displayHighestSaleProduct(arr);

}

case 7:

{

displayProductWithZeroQuantity(arr);

}

case 8:

{

exit(0);

}

}

}

int main()

{

struct product arr[MAX_SIZE];

char pass[10];

printf("please enter the password:")

scanf("\n%s", &pass);

if(strcmp(pass, password) == 0)

{

label:

printf("\nplease select the proper option from the below menu:");

printf("\n1.) Input new product record");

printf("\n2.) Edit a product");

printf("\n3.) delete a product");

printf("\n4.) display all existing products");

printf("\n5.) make a purchase");

printf("\n6.) display the product detail with highest sale");

printf("\n7.) display a product with zero quantity");

printf("\n8.) exit the program");

int choice;

printf("\nChoice - >");

scanf("%d", &choice);

if(choice < 1 && choice > 8 )

{

printf("Invalid Choice! please choose again");

goto label;

}

else

processChoice(choice, arr);

}

else return(0);

}

3 0
3 years ago
PLEASE HURRY!!!!! Part of a program that does not work correctly
stiv31 [10]

Answer:

bug

Explanation:

A bug computer definition is referred to as a failure or a flaw in the software program. A Bug produces an incorrect or undesired result that deviates from the expected result or behavior.

8 0
2 years ago
Read 2 more answers
3-Write a Python program that has subprograms nested four deep and in which each nested subprogram references local variables, v
vivado [14]

Answer:

Explanation:

Below is a little explanation to guide us through;

There are 4 nested methods : level 0, level 1, level 2, and level 3.

Before the methods, there's a global variable defined that can be accessed by all the methods.

Level 0:

This method uses global variable, creates a level 0 variable in its scope, this level 0 variable can be used by all underlying nested methods.

Level 1: this method uses global, level 0, and level 1 variable, which can be accessed by all underlying nested methods: level 2, level 3.

Level 2: similar to te previous ones, it also uses global, level 0, level 1 variables. And creates a level 2 variable that can be accessed by level 3 also.

Level 3:

This method uses all previously created variables, and creates a new level 3 variable.

Function calls:

As you can see, the function calls are part of the method scopes. So, in order to call level 3, we need to access level 2 (because it is getting called from level 2 scope), for level 2, we must call level 1, for which level 0 needs to be called.

So, level 0 is called, which gives its out put and calls level 1, which gives its own output and calls level 2 and so on till level 3 is also called.

CODE:

global_var = "global" #accessible to all functions

def level0():

level0_var = "level 0" #accessible to level 0,1,2,3

print();

print("Level 0 function:")

print("global variable: ",global_var)

print("local variable 0: ",level0_var)

def level1():

print();

print("Level 1 function:")

level1_var = "level 1" ##accessible to level 1,2,3

print("global variable: ",global_var)

print("local variable 0: ",level0_var)

print("local variable 1: ",level1_var)

def level2():

print();

print("Level 2 function:")

level2_var = "level 2" #accessible to level 2,3

print("global variable: ",global_var)

print("local variable 0: ",level0_var)

print("local variable 1: ",level1_var)

print("local variable 2: ",level2_var)

def level3():

print();

print("Level 3 function:")

level3_var = "level 3" #accessible to level 3

print("global variable: ",global_var)

print("local variable 0: ",level0_var)

print("local variable 1: ",level1_var)

print("local variable 2: ",level2_var)

print("local variable 3: ",level3_var)

level3()

level2()

level1()

level0()

attached is the result of the code, also take note of the indentations too

cheers i hope this helps!!!!!

5 0
3 years ago
Which of the following is not a method of the history object?
Volgvan

Answer:

replace()

Explanation:

The history object in javascript corresponds to browsing history.

It has the following methods for navigating through the history list:

back(): Go back in the history list

forward(): Go forward in the history list

go() : Navigate to the currently pointed url in the history list. It takes a parameter which can either be a numeric index or a string which is matched with the history list content.

replace() is not a method in the history object.

7 0
2 years ago
Other questions:
  • Electronic ledger that tracks mathematical data
    15·1 answer
  • The Accounting department is testing a new payroll system server. To facilitate their tests, they would like to add the server t
    13·1 answer
  • When a user runs an application, what transfers from a storage device to memory?
    8·1 answer
  • Use the Wrap Text icon to _____. modify which graphic appears in the front of layered images modify the picture effects change t
    5·2 answers
  • Explain each kind of pointer and for what it is appropriate
    15·2 answers
  • Match each code snippet to its appropriate markup language name
    12·1 answer
  • A ___ is an online collaborative event that may include such features as chat, slideshows, and PowerPoint presentations.
    8·1 answer
  • What is the full form of GUI​
    12·2 answers
  • A health care provider approaches Accenture to help them increase their efficiency through an advanced data science platform.Wha
    8·1 answer
  • What are some legal issues that can arise from the use of social media?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!