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
For some reason i cant see brainly answers
denis23 [38]

Answer:

Same thing happening to me and several other people. At this point I wonder if there site is having troubles. I tried to email them but even that is not working.

Explanation:.

4 0
3 years ago
You try to enter your name into a cell that accepts a numeric value. What error would you receive? A. #NAME B. #VALUE C. #REF D.
UNO [17]

Answer:

<h2>Option B: #VALUE</h2>

is the correct answer.

Explanation:

<h3>Reasons of #VALUE error:</h3>
  • When cells are not given the expected type of value.
  • If cells are left blank unnoticeable or for giving a null value.
  • For entering dates and other numerical data in text form.
<h3>Correcting and fixing #VALUE error:</h3>

This type of error can only be fixed by finding the cell in which there is wrong data entered and correct it.

Fixing the #VALUE error is tricky as some functions automatically ignore the data that is invalid.

<h3>EXAMPLE:</h3>
  • Suppose a cell contains the value as cost of the object and in order to make it 0, NA is inserted into the cell.
  • While making total of all the costs, that particular cell might cause #VALUE error.
  • Following image attach will help you clear the concept.

I hope it will help you!

4 0
3 years ago
Read 2 more answers
If there is a need to write code in order to help the player move through the game which team member would create this code?
charle [14.2K]

Answer:

Run code, and then check the code

Explanation:

8 0
3 years ago
Your sister wants to purchase Microsoft Office 2013 for her new laptop. She doesn’t want to pay for a subscription and she wants
marishachu [46]
I recommend the Microsoft office 2013 home and student instant license.<span />
4 0
3 years ago
Read 2 more answers
Write the pseudocode for the following scenario. The final exam marks for 10 students are 65, 45, 78, 65, 89, 65, 79, 67, 75, an
tia_tia [17]

The pseudocode of the program serves as a prototype of the program

<h3>How to determine the pseudocode?</h3>

The pseudocode of the program is as follows:

  1. Start
  2. Declare array MARKS
  3. Input MARKS[0] to MARKS[9]
  4. Sort MARKS
  5. Print MARKS[9] ----- this prints the highest mark
  6. Print MARKS[0] ----- this prints the least mark
  7. FOR I = 0 TO 9; ADD MARK[I] TO TOTAL
  8. Print TOTAL
  9. Print TOTAL/10
  10. Stop

The above pseudocode gets input for the array; then sorts the array before performing the required operations

Read more about pseudocodes at:

brainly.com/question/24735155

4 0
2 years ago
Other questions:
  • Which of the following situations would not require knowledge of networking?
    6·1 answer
  • Named constants should be used when they serve to improve readability and understanding. T or F
    12·2 answers
  • A ____ by a design professional is used to determine the best system to provide the appropriate level and type of protection.
    6·1 answer
  • How do you interpret field in contest of a DBMS?
    5·1 answer
  • Mason is part of a project team that is creating a television advertisement. List one risk the team faces and a strategy for min
    5·1 answer
  • What are computer virus ? Explain in detail.In your answer include symptoms and prevention (3each)
    10·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    15·1 answer
  • In which client/server relationship can a computer act as both a client AND a server? Select one: a. X-Windows b. SSH c. Classic
    8·1 answer
  • Which part of the processing unit does the logic operations?<br> A. ALC<br> B. CU
    9·1 answer
  • _________ is the primary measurement used to gauge your typing ability
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!