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
Allushta [10]
3 years ago
14

The template code provided is intended to take two inputs, x and y, from the user and print "pass" if one or more of the followi

ng is true:
x is not less than 4
y is not greater than 5 and x + y is less than 7
However, when using De Morgan's law to simplify this code, the programmer has made some mistakes. Can you correct the errors so the code functions as intended?
/* Lesson 6 Coding Activity Question 2 */
import java.util.Scanner;
public class U3_L6_Activity_Two{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int y = scan.nextInt();
if(!((x 5) || x+y > 7))
System.out.println("pass");
}
}
Computers and Technology
1 answer:
just olya [345]3 years ago
7 0

import java.util.Scanner;

public class U3_L6_Activity_Two{

   public static void main(String[] args){

       Scanner scan = new Scanner(System.in);

       int x = scan.nextInt();

       int y = scan.nextInt();

       if(x>=4|| ((y < 5) && ((x+y) < 7))){

           System.out.println("pass");

       }

   }

}

I'm pretty sure this is what you're looking for. Best of luck.

You might be interested in
SMART PEOPLE NEEDED
mario62 [17]
D doesn't make much sense, it's valid, but not what we're looking for. B also has a correlation with D, same reasoning applies. As for A, it seems pretty legit, but I don't believe that's what we're looking for.

Choice C is the most obvious one though. We're talking about a network and as may or may not know it's a wireless one in a manner of speaking. A <span>couple of computers in the network that have trouble maintaining a signal will indefinitely lead to failure of a network since both the links and nodes of certain computer systems are incapable of maintaining a signal. </span>
6 0
3 years ago
When you add a zero to the right of a decimal number, it multiplies its value by 10 (For example, "15" becomes "150"). What simi
My name is Ann [436]

Answer:

When you put a 0 on the right side of a binary number it multiplies it by 2

Explanation:

6 0
3 years ago
State whether True / False:<br>The pause option stops the recording temporarily.*<br>True<br>False​
defon

Answer:

true

Explanation:

when you pause a recording it will temporarily stop but, when you hit record again it will continue where you left off

7 0
3 years ago
The term asymptotic means the study of the function f as n becomes larger and larger without bound.
harkovskaia [24]

Answer:

False

Explanation:

The term asymptotic means approaching a value or curve arbitrarily closely

5 0
3 years ago
What are the core components of a computer system? CPU, RAM, ROM, I/O ports, keyboard CPU, RAM, ROM, I/O ports, system bus CPU,
zimovet [89]
CPU, RAM, ROM, system bus, I/O ports
8 0
4 years ago
Read 2 more answers
Other questions:
  • Why is art important to heritage?
    10·1 answer
  • To resize an embedded chart, ____. select one:
    5·1 answer
  • The computer that provides information or resources to the client computers on the network is called a(n) ________.
    5·1 answer
  • Which method is the best way to keep from running late on the day of a test
    10·1 answer
  • Difference between softcopy and hardcopy​
    8·2 answers
  • To display a pop-up form for a control, such as account number in a datasheet create a user interface (UI) macro that is associa
    12·1 answer
  • var shirt = "blue"; 2. var pants = "gray"; 3. var clothes = wearIt(shirt, pants); 4. function wearIt( x, y) 5. { 6. var myOutfit
    7·1 answer
  • Item 19 A student pushes a box across a rough horizontal floor. If the amount of work done by the student on the box is 100 J an
    15·1 answer
  • What is the best Genshin impact ship? My favorite is Xiao x Lumine. Put yours bellow.
    13·2 answers
  • List and briefly describe the major types of system in organization?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!