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
sergey [27]
3 years ago
11

What is wrong, logically, with the following code? if (x > 10) System.out.println("Large"); else if (x > 6 && x &l

t;= 10) System.out.println("Medium"); else if (x > 3 && x <= 6) System.out.println("Small"); else System.out.println("Very small");
Computers and Technology
1 answer:
Alex73 [517]3 years ago
8 0

Answer:

The above code will hold the second condition with && operator, like "x<=6" or"x<=10" condition in the else if statement which is of no use.

Explanation:

  • The above code holds a condition-based statement by the help of if-else statement where--
  • The first if-condition will states true when the value of x will be greater than 10, So the if-else condition will be tested for that value of x which is less than or equal to 10.
  • So there is no needs to justify the " x <= 10" for else if statement and " x <= 6" for the second else if statement because the second else if statement will be tasted when the value of x will be less than or equal to 6.
You might be interested in
The Constitution party advances a conservative approach to issues and would most likely support policies that __________.
vodka [1.7K]
The correct answer for this question is this one
reflect our basic principles." The Constitution party advances a conservative approach to issues and would most likely support policies that <span>reflect our basic principles and as well as respect whatever what we believe in.</span>
3 0
3 years ago
Pls help I will thx and give points
azamat

Answer:

Desktop

Explanation:

A tablet and smartphone dont have enough storage like a desktop, so they would edit very efficiently

5 0
3 years ago
Read 2 more answers
What is an instance of a computer program that is being executed?
Lostsunrise [7]
It is processing because it is processing the data on the program.
7 0
3 years ago
PLEASE PLEASE PLEASEEEE HELP
labwork [276]

Answer:

Quality is critical to satisfying your customers and retaining their loyalty so they continue to buy from you in the future. Quality products make an important contribution to long-term revenue and profitability.

have a nice day! (^o^)

8 0
3 years ago
Write a class called Product. The class should have fields called name, amount, and price, holding the product’s name, the numbe
vichka [17]

Answer:

public class Product {

//Declaring the fields

   private String name;

   private int amount;

   private double price;

   //Constructor

   public Product(String name, int amount, double price) {

       this.name = name;

       this.amount = amount;

       this.price = price;

   }

   // The method get_price

   public double get_price(int amount){

       // amount of goods less than 10

       if(amount<10){

           double zeroDiscPrice;

           zeroDiscPrice = this.price;

           return zeroDiscPrice;

       }

       // amount of goods less than 100

       else if(amount>=10 && amount<100){

           double tenPercentDiscPrice;

           tenPercentDiscPrice = this.price-(this.price*0.1);

           return tenPercentDiscPrice;

       }

       // amount of goods greater than 100

       else{

           double twentyPercentDiscPrice;

           twentyPercentDiscPrice = this.price-(this.price*0.2);

           return twentyPercentDiscPrice;

       }

   }

}

Explanation:

The class is implemented in Java programming language

Three member variables (fields) are declared as described in the question

A constructor is created to initialize an instance of the class

The method get_price() as created uses a combination of if...else if....else To determing the price based on the amount of items bought as described in the question.

5 0
3 years ago
Other questions:
  • Into which of these files would you paste copied information to create an integrated document? A. Mailing list B. Source C. Data
    13·2 answers
  • Select the correct answer.
    11·1 answer
  • Proszę daje wszystko potrzebuje tego
    8·2 answers
  • Write a program that deliberately contains an endless or infinite while loop. The loop should generate multiplication questions
    13·1 answer
  • I - For any two points on the Internet, there exists only one path between the two points II - Routing on the Internet is fault
    12·1 answer
  • How can this be achieved? Universal Containers stores invoices in SAP. Users want to view invoice data onthe related Account rec
    9·1 answer
  • What has impacted the world more: The initial creation of telephone or a smart cellphone? Explain your reasoning!
    6·1 answer
  • TOT al<br>Name TWO examples of these settings and utilities. (2)​
    12·1 answer
  • Ayuda pliz es para ya!!!!!<br> nesesito un codigo html que me muestre este texto
    8·1 answer
  • Sara wants to set up her lights to turn on when she arrives home. She has heard that she might be able to do this using IoT. Wha
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!