4. (25) Write a Java program: (25 = 4(a) + 3(b) + 4(c) + 4(d) +3(e) + 3() + 4(g)) a. Randomly generate a 3-digit integer number (a 3-digit number is a number in range [100, 999]). Store this number in variable rn. Display rn. 1|Page b. Check if rn is divisible by 5 or 11 but not both. Display message: “[rn-value] is divisible by 5 or 11 but not both" or message “[rn-value] is not divisible by 5 or 11 but not both." c. Check if rn is divisible by at least 2 of the following numbers: 3, 7, 11, 13. Display message “[rn- number] is divisible by at least 2 numbers" or “[rn-value] is not divisible by at least 2 numbers".
4. (25) Write a Java program: (25 = 4(a) + 3(b) + 4(c) + 4(d) +3(e) + 3() + 4(g)) a. Randomly generate a 3-digit integer number (a 3-digit number is a number in range [100, 999]). Store this number in variable rn. Display rn. 1|Page b. Check if rn is divisible by 5 or 11 but not both. Display message: “[rn-value] is divisible by 5 or 11 but not both" or message “[rn-value] is not divisible by 5 or 11 but not both." c. Check if rn is divisible by at least 2 of the following numbers: 3, 7, 11, 13. Display message “[rn- number] is divisible by at least 2 numbers" or “[rn-value] is not divisible by at least 2 numbers".
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 40SA
Related questions
Question
in java eclipse ide can you insert the numbers in the code please
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning