Write an if statement that assigns 100 to x when y is equal to 0.

Answers

Answer 1
Answer:

Answer:

if(y==0)

{

   x=100;

}

Explanation:

The above written if statement is for assigning 100 to x when the value of y is equal to 0.To check the value of the y I have used equal operator == which returns true when the value on it's left side is equal to the value to it's right else it returns false and for assigning the value to y I have used assignment operator =.

First it will be checked that the value y is equal to 0.If the then it return true means the if statement will execute.Inside if statement 100 is assigned to x.


Related Questions

When applying scenario logic to technology commercialization we should not consider if there is enough social, political, and market support for commercialization to take place Select one: True False
(5 pt.) The name of a variable in the C programming language is a string that can contain uppercase letters, lowercase letters, digits, or underscores. Furthermore, the first character in the string must be a letter, either uppercase or lowercase, or an underscore. If the name of a variable is determined by its first 8 characters, how many different variables can be named in C
3. If B3=6 and D5=8, what would the following function return? IF(B3>D5, "Closed", D5-B3) *A. "Closed"B. -2C. "Open"D. +2
In computer programming, what is syntax?
Select the correct answer.At which stage of art criticism do you sum up your evaluations?A descriptionB. judgmentC. interpretationD. analysisResetNext

Regarding computer protection, quarantining is defined as ________. Select one: A. placing a found virus in a secure area on the hard drive B. deleting an infected file C. repairing an infected file D. updating your antivirus software

Answers

Answer:

A. placing a found virus in a secure area on the hard drive

Explanation:

When a file is defected in a computer, quarantining is applied to prevent other parts of the computer. The infected file is isolated and if you let your antivirus software, it can delete the infected file.

PLEASE HELP!!!For this activity, you will create two designs for the same project. For example, you might choose to create a CD cover for your favorite band’s newest release, or you might want to design a menu for the local deli. No matter what you decide for your subject matter, the two designs must involve different media. One of these media will be an image-editing program, such as Inkscape. You will learn more about the basic tools available in Inkscape later in this lesson. The two designs should incorporate different techniques. For example, you might make one design abstract, while making the other more realistic. Be sure to save both of your designs. Scan or take a picture of the design that wasn’t created in an image-editing program. You will submit this item later in this lesson as your portfolio item. Select the link to access the Techniques Activity Rubric.

Answers

Answer:

I'm not exactly sure on what the question is, but from reading it, I determined that you'll be creating 2 different designs using Inkscape/Photoshop. I'm leaving 2 of my designs in here for you to use on your project. Unknown on what to do about the design that wasn't created in an image-editing program.

Which of the following terms is used to describe a program that copies itself repeatedly, using up resources and possibly shutting down the computer or network?(A) A virus
(B) A warm
(C) A trojan horse
(D) A rootkit

Answers

Answer: Option (B) is correct.

Explanation:

A worm in technical sense is also known as a computer worm which is a self-replicating virus/ malicious content that replicates itself in order to spread to the uninfected PC. They often use components of an OS (operating system) which are automatic and also invisible to an individual. It should be duly noted that it is usual for a computer worm to be observed only when their replication utilizes system content, slowing other tasks at hand.

On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows: Pocket 0 is green. For pockets 1 through 10, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 11 through 18, the odd-numbered pockets are black and the even-numbered pockets are red. For pockets 19 through 28, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 29 through 36, the odd-numbered pockets are black and the even-numbered pockets are red. Write a program that asks the user to enter a pocket number and displays whether the pocket is green, red, or black. The program should display an error message if the user enters a number that is outside the range of 0 through 36.

Answers

Answer:

pkt = int(input("Pocket Number: "))

if pkt == 0:

   print("Green")

elif pkt >= 1 and pkt <=10:

   if pkt%2 == 0:

       print("Black")

   else:

       print("Red")

elif pkt >= 11 and pkt <=18:

   if pkt%2 == 0:

       print("Red")

   else:

       print("Black")

elif pkt >= 19 and pkt <=28:

   if pkt%2 == 0:

       print("Black")

   else:

       print("Red")

elif pkt >= 29 and pkt <=36:

   if pkt%2 == 0:

       print("Red")

   else:

       print("Black")

else:

   print("Error")

Explanation:

The program was written in Python and the line by line explanation is as follows;

This prompts user for pocket number

pkt = int(input("Pocket Number: "))

This prints green if the pocket number is 0

if pkt == 0:

   print("Green")

If pocket number is between 1 and 10 (inclusive)

elif pkt >= 1 and pkt <=10:

This prints black if packet number is even

   if pkt%2 == 0:

       print("Black")

Prints red, if otherwise

   else:

       print("Red")

If pocket number is between 11 and 18 (inclusive)

elif pkt >= 11 and pkt <=18:

This prints red if packet number is even

   if pkt%2 == 0:

       print("Red")

Prints black, if otherwise

   else:

       print("Black")

If pocket number is between 19 and 28 (inclusive)

elif pkt >= 19 and pkt <=28:

This prints black if packet number is even

   if pkt%2 == 0:

       print("Black")

Prints red, if otherwise

   else:

       print("Red")

If pocket number is between 29 and 36 (inclusive)

elif pkt >= 29 and pkt <=36:

This prints red if packet number is even

   if pkt%2 == 0:

       print("Red")

Prints black, if otherwise

   else:

       print("Black")

Prints error if input is out of range

else:

   print("Error")

create a Java program that prompt the user to enter a number of hours, wages, over time factor, then your program should calculate the employee total wages. Make sure your program can calculate the over time and regular wages if number of hours are great than 40 hours. Use 1.5 for over time factor. Make sure your Java code has comments showing declarations and description of your variables.

Answers

Answer:

The program to the given question as follows:

Program:

import java.util.*; //import package for user input.

public class Main //defining class Main

{

public static void main(String[] as) //defining main method

{

final double over_time_factor = 1.5; //define final variable

double number_Of_hours,wages,total_Wages=0; //defining variables  

System.out.println("Enter hours and wages rate:"); //print message

Scanner obc = new Scanner(System.in); //creating Scanner class object for user input

number_Of_hours = obc.nextDouble(); //taking input

wages = obc.nextDouble(); //taking input

if(number_Of_hours>40) //check condition if number_Of_hours greter then 40

{

total_Wages=40*wages+(number_Of_hours-40)*wages*over_time_factor; //calculate value

}

else //else part

{

total_Wages = number_Of_hours*wages; //calculate total_Wages

}

System.out.println("Total Wages: $"+total_Wages); //print value

}

}

Output:

Enter hours and wages rate:

12

3

Total Wages: $36.0

Explanation:

In the above java program, the package is first imported into the user input and then the class is defined and inside this, the main method is defined, that defines a double type final variable "over_time_factor" is defined that holds a value "1.5", Then double type variable is defined that are " number_Of_hours, wages, and total_Wages", in which first two variables are used for taking input from the user and the third variable is used to calculate their values. After taken input from the user, the conditional statement is used that can be defined as follows:

  • The if block, checks the variable "number_Of_hours" value is greater than 40 it will calculate over_time_factor value that is held by total_Wages variable.  
  • In else block, it will multiply the user input value that is store in total_Wages variable.  
  • At the end of the conditional statement, the print function is used that prints total_Wages variable value.  

In QlikView, ________ are used to search information anywhere in the document.

Answers

Answer:

Search Object

Explanation:

Qlikview is a form of computer software application that is basically used in analytics explanation. In order to search for information anywhere in the document inside the Qlikview application, a form of sheet object referred to as SEARCH OBJECT is utilized.

Hence, in this case, In QlikView, SEARCH OBJECT is used to search for information anywhere in the document.