Can i ask how to do this

0 votes
Create a program that accepts an input of a string and 2 integers using a Scanner. The program should get the larger integer of the two integers that were supplied, and display:

1.“string < 3 and int > 10” if string length is less than 3 and the larger integer is greater than 10.

2.“string > 3 and int > 10” if string length is greater than 3 and the larger integer is greater than 10.

3.“string == 3 and int < 10” if string length is exactly 3 and the larger integer is less than 10.

4.“none” if no condition is satisfied.

TEST CASE 1:

Dog

4

5

OUTPUT:

string == 3 and int < 10  

TEST CASE 2:

Carabao

11

5

OUTPUT:

string > 3 and int > 10

TEST CASE 3:

in

-1

-5

OUTPUT:

none

TEST CASE 4:

in

-35

-35

OUTPUT:

none

 #

Furthermore, if the larger integer is a negative integer (e.g. -1, -2, etc), get its absolute value, and print its corresponding character in the ASCII table if and only if the absolute value is between 33 and 126 (inclusive).
Sep 26, 2021 in Java by anonymous

edited 5 days ago 14 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP