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
Which best compares portrait and landscape orientations?
julsineya [31]
#2: Portrait taller than wide & landscape wider than tall
8 0
3 years ago
How is a cell named?
bixtya [17]
Im guessing a cell is named by the scientist that found that cell in the fist place.
8 0
4 years ago
Digital cameras are less susceptible to UV light true or false
Nesterboy [21]
Yes because the UV light is brighter
3 0
3 years ago
Read 2 more answers
Yazmin is reading a book that has 74 pages. She has read 38 pages. How many more pages does she need to read to finish the book​
Brut [27]

Answer:

36 book

im sure it is correct

4 0
3 years ago
explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
sasho [114]

It means that there are people  who understand binary and those that do not understand it. That is, binary is said to be the way that computers are known to express numbers.

<h3>What is the joke about?</h3>

This is known to be a popular  joke that is often  used by people who are known to be great savvy in the field of mathematics.

The joke is known to be one that makes the point that a person is implying that the phrase is about those who only understands the decimal system, and thus relies on numbers in groups of 10.

The binary system is one that relies on numbers that are known to be  in groups of 2.

Therefore, If the speaker of the above phrase is one who is able to understand binary, that person  would  be able to say that that the phrase  is correctly written as  "there are 2 types of people that understand binary".

Learn more about binary from

brainly.com/question/21475482

#SPJ1

7 0
2 years ago
Other questions:
  • one business rule is that each project has one manager. Identify two (and no more than two) problems with the data structure or
    9·1 answer
  • Intranets are typically set up behind a firewall. <br> a. True <br> b. False
    15·1 answer
  • You run anti-virus software on your computer; however, you are experiencing symptoms that may be caused by a virus. What should
    13·1 answer
  • Retype the statements, correcting the syntax errors.
    9·1 answer
  • Which NSX feature would enhance their security so that this doesn’t happen again?
    15·1 answer
  • You will be given a string, containing both uppercase and lowercase alphabets(numbers are not allowed).
    14·1 answer
  • How does the government is i.t to run the country?
    9·1 answer
  • Should a social network own our social data? Is it an invasion of privacy for social networks to collect and use the information
    6·1 answer
  • Double[][] vals =
    8·1 answer
  • 1. How can you help prevent being a target of cyberbullying?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!