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]
2 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]2 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
Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolut
STALIN [3.7K]

Solution :

x = float_(input())

y = float_(input())

z = float_(input())

res1 = x**z

res2 = x**(y**z)

res3 = abs(x-y)

res4 = (x**z)**0.5

print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(res1,res2,res3,res4))

Output is :

5.0

1.5

3.2

172.47 361.66 3.50 13.13

6 0
2 years ago
Call 334-399-4201 to annoyed my mom
yaroslaw [1]

Answer: why...

Explanation:

3 0
3 years ago
Can someone see what this says? ​
Rzqust [24]

Not really. xD

I only see "Not A.." and It's backwards too soooo..

3 0
3 years ago
9.4 Code Practice
stepladder [879]

I've included my code in the picture below. Best of luck.

6 0
2 years ago
Travis is getting ready to present his PowerPoint slides to his class. What is a good tip Travis should use during his presentat
Margaret [11]

Answer:

REad from slide and speak clearly and slowy.

Explanation:

5 0
3 years ago
Other questions:
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    7·1 answer
  • It is either snoming or below freezing
    10·1 answer
  • What operator is used to create a validation rule? A. – B. / C. &lt; or &gt; D. +
    12·1 answer
  • NEED HELP FAST
    13·2 answers
  • What is the service provided by a third party (such as an ISP) that enables you to connect another cloud directly to your Google
    15·1 answer
  • When you're working with a word processing document and you press the del key, what happens?
    5·1 answer
  • Which scenario is invalid for execution by unit Tests? A. Executing test scenarios for negative test scenarios.B. Executing meth
    5·1 answer
  • How much a T-mobile plan cost​
    11·2 answers
  • What allows users to connect via the Internet to its private network?
    11·2 answers
  • What is the difference between a computer’s RAM and its hard disk?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!