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
inna [77]
3 years ago
10

Assuming the user enters integers, how many times will the following program print hi x = int(input()) y = int(input()) if x &gt

; 0 or y > 0: print("hi") if x <= 0 and y <= 0: print("hi")
Computers and Technology
1 answer:
raketka [301]3 years ago
3 0

Answer:

It prints "hi" only one time.

Explanation:

It will print the result depending on the if statements. If you look at the if statements, you will see that no matter you enter it is going to be either true for the first if statement or for the second if statement.

Let's say you entered 1 for x and 0 for y, first if statement will print hi, but the second one will not print because x is not smaller or greater than 0.

Let's say you entered 0 for x and 6 for y, second if statement will print hi, but the first one will not print because x is not greater than 0.

You might be interested in
These are keywords used with mysql_query/ mysqli_queryto update records in a table.
Brrunno [24]

Answer:

D.insert, into, values

3 0
3 years ago
Read 2 more answers
Write a program FindDuplicate.java that reads n integer arguments from the command line into an integer array of length n, where
kozerog [31]

Answer:

  1. public class FindDuplicate{
  2.    public static void main(String[] args) {
  3.        Scanner input = new Scanner(System.in);
  4.        int n = 5;
  5.        int arr[] = new int[n];
  6.        for(int i=0; i < arr.length; i++){
  7.            int inputNum = input.nextInt();
  8.            if(inputNum >=1 && inputNum <=n) {
  9.                arr[i] = inputNum;
  10.            }
  11.        }
  12.        for(int j =0; j < arr.length; j++){
  13.            for(int k = 0; k < arr.length; k++){
  14.                if(j == k){
  15.                    continue;
  16.                }else{
  17.                    if(arr[j] == arr[k]){
  18.                        System.out.println("True");
  19.                        return;
  20.                    }
  21.                }
  22.            }
  23.        }
  24.        System.out.println("False");
  25.    }
  26. }

Explanation:

Firstly, create a Scanner object to get user input (Line 4).

Next, create an array with n-size (Line 7) and then create a for-loop to get user repeatedly enter an integer and assign the input value to the array (Line 9 - 14).

Next, create a double layer for-loop to check the each element in the array against the other elements to see if there is any duplication detected and display "True" (Line 21 - 22). If duplication is found the program will display True and terminate the whole program using return (Line 23). The condition set in Line 18 is to ensure the comparison is not between the same element.

If all the elements in the array are unique the if block (Line 21 - 23) won't run and it will proceed to Line 28 to display message "False".

7 0
3 years ago
What are the correct answers to the following questions?
Lena [83]

Answer:

1. analog sound

2. digital sound

3. pixels

4.  local area network

5.bus

6. slots

Explanation:

4 0
2 years ago
When two files are linked together, the __________ file receives the data from another workbook.?
Ket [755]
When two files are linked together, the <u>d</u><span><u>estination </u></span>file receives the data from another workbook.

If i'm not wrong.

3 0
3 years ago
You defined a book data type.
tensa zangetsu [6.8K]

Answer:

myBook = book()

Explanation:

Correct answer edge 2020

4 0
3 years ago
Other questions:
  • Richman Investments is an investment and consulting firm. Richman wants to expand its business operations both in the U.S. and i
    14·1 answer
  • "Unicorn designs Inc., a software company, requires its employees to wear a specific color every day of the week. The colors for
    8·2 answers
  • Who have a ps4 ?<br> Who have 2k20? <br> Are you good a 2k20 ? <br> Add me on Ps4 eoKyriie
    13·2 answers
  • Which type of network cover a large geographical area and usually consists of several smaller networks, which might use differen
    12·1 answer
  • Given the following while() loop, which statement is true assuming A,B,C,D are int variables and A &gt; B? while ( ( A &gt;= B)
    8·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • Where can you find the sizing handles for a graphic, shape, or text box? Check all that apply.
    10·2 answers
  • According to programming best practices, how should you handle code that needs to be repeated several times in a program?
    6·1 answer
  • On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. En
    15·1 answer
  • Write a program to input elements of 4*3matrix and prints its elements properly using array ​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!