subject

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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
You know the right answer?
The template code provided is intended to check whether an integer entered by the user is outside of...
Questions
question
Mathematics, 02.09.2019 02:30
Questions on the website: 13722362