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
Zielflug [23.3K]
3 years ago
9

The template code provided is intended to check whether an integer entered by the user is outside of the range 20-29 (inclusive)

. If it is outside of this range the program should print a warning and change the number to 25. 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?
code:
Scanner scan = new Scanner(System.in);
System.out.println("Enter a number in the twenties");
int num = scan.nextInt();

if(num 30){
System.out.println("That's not in the twenties!");
num = 25;
}
System.out.println("Your number is " + num);
sample run: Enter a number in the twenties
28
Your number is 28
Computers and Technology
1 answer:
Pavlova-9 [17]3 years ago
3 0

import java.util.Scanner;

public class JavaApplication60 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a number in the twenties");

       int num = scan.nextInt();

   if(num >= 30 || num <= 19){

       System.out.println("That's not in the twenties!");

       num = 25;

   }

   System.out.println("Your number is " + num);

   }

}

This is the complete code including the main class and main method. I hope this helps!

You might be interested in
Computer Vision and Industrial Robots
rjkz [21]

Answer:

View Computer Vision Unit Activity.docx from COMPUTER SCIENCE 101 at Edoptions High School. Consider an industrial robot performing several tasks in an assembly line.Machine Vision in industrial applications. Robots working in industrial applications need visual feedback. This is used to navigate, identify parts, collaborate with humans and fuse visua

Explanation:

Many industries are feeling the effects of skilled labor shortages. At the same time, companies are reluctant to invest heavily in training and developing unskilled employees, for fear of losing them afterward through defection to competitors. With no end in sight to the workforce shortfall, the appeal of robots as an efficient supplement, and even replacement, for human labor is continuing to grow.

The cost of robotics is generally falling, and alternative business models like robotics-as-a-service (RaaS) make industrial robots accessible even to companies that don’t have substantial capital budgets to exploit. The affordability of the units themselves, along with the fact that programming is becoming more straightforward and hence less costly, is also boosting the appeal of industrial robotics adoption.

7 0
2 years ago
Kaylen has been working on his computer and notices that the screen seems to be flickering. The monitor is not turning on and of
Komok [63]

Answer:

Screen flickering is usually caused by an incompatible app or display driver. It could also be caused by a bad HDMI/VGA connection to the monitor.

Hope it helps ! :)

6 0
4 years ago
How can you find the square root of 8 using the pow() function
zimovet [89]

import math

print(math.pow(8, 0.5))

You can find the square root of any number by squaring it by 0.5

7 0
3 years ago
What is Application Software ??
Paraphin [41]


Hi Pupil Here's Your Answer ::



➡➡➡➡➡➡➡➡➡➡➡➡➡


Application software and software that are created to facilitate/perform a specific type of real life application directly for the end user. These are available in the market as single readymade software or as an integrated package like MS Office, Visual Studio or Adobe integrated suite.


There are three types of application software which you would know about ::

# General Purpose Application Software.

# Special Purpose Application Software.

# Customized or Bespoke Purpose Application Software.


⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅




Hope this helps .........
6 0
3 years ago
Read 2 more answers
If it malfunctions and I can throw it, then it's a hardware problem; if I have to yell at it because there is nothing to pick up
kobusy [5.1K]
Software problem.
Assuming "Software" is one of the available answers.

3 0
3 years ago
Read 2 more answers
Other questions:
  • A(n ____________ is considered a named collection of bytes having persistent or lasting storage.
    10·1 answer
  • 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
  • Write a function named times_ten. the function should accept an argument and display the product of its argument multiplied time
    13·1 answer
  • Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variabl
    6·1 answer
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • If you wanted to buy a house that cost $150,000 and you knew you needed a down payment of five percent, how much would you need
    8·1 answer
  • What are some other features of sending attachments in Outlook 2016? Check all that apply.
    9·2 answers
  • Type the correct answer in the box. Spell all words correctly. Complete the sentence based on the role education plays to help y
    5·1 answer
  • Which of these apps could be a Trojan Horse designed to install malware on your system? Select all that apply. *
    8·1 answer
  • Aii so is anyone pushing P?<br> if u are u a g
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!