Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# please with screen shot Lab5B: Sensible Division Heads up! You will need to use the modulus function for the question. If you do not

C# please with screen shot
image text in transcribed
image text in transcribed
Lab5B: Sensible Division Heads up! You will need to use the modulus function for the question. If you do not know or have any questions about this function, please ask your Lab Instructor. A brief explanation of the function is presented below. The modulus function, which looks I this \%, is a function that can be used in the Java, CH, and C++programming languages much like the division /, multiplication *, addition +, and subtraction functions. This function is like the division function, however, the idea behind it is that it should provide you with the remainder of two divided integers (think long division) rather than with the answer of that division. For example, if we were to integer divide 5 and 2 (int w=5/2 ) the answer of this division would be 2 (remember this is integer division). However, if we were to mod 5 and 2 (int w=5% 2) then the answer would be 1. Keeping that in mind, if we were to mod the number that is left of the modulus sign with a number that it is divisible by on the right of the modulus sign, what would the answer be? For this exercise, please design a program that determines if the number that was entered in as input by the user is divisible by 2,3 , or 5 . If it is not divisible by any of these numbers, please just print out "This number is undetermined". Disclaimer: The answer that should be provided by your program should be the smallest number that equally divides by the number entered in. For example, 200 in sample output \#2 is both divisible by 2 and by 5 , however, your program should prioritize printing out it is divisible by 2 rather than it being divisible by 5 . Only numbers that are strictly divisible only by 5 should print "This number is divisible by 5 " for example like 25. Remember, the class name should be Lab5B. The user input should be an integer and sample runs are shown below. User input is in bold. Note: You must use a switch statement as part of your solution. Sample output \#1: Enter an integer: 2 This number is divisible by 2 Sample output #2: Enter an integer: 200 This number is divisible by 2 Sample output 43 : Enter an integer: 13 This number is undetermined C++ programming languages much like the division /, multiplication , addition +, and subtraction functions. This function is liks the division function, however, the idea behind it is that it should provide you with the remainder of two divided integers (think long division) rather than with the answer of that division. For example, if we were to integer divide 5 and 2 (int w=5/2 ) the answer of this division would be 2 (remember this is integer division). However, if we were to mod 5 and 2 (int w=5% 2) then the answer would be 1. Keeping that in mind, if we were to mod the number that is left of the modulus sign with a number that it is divisible by on the right of the modulus sign, what would the answer be? For this exercise, please design a program that determines if the number that was entered in as input by the user is divisible by 2,3 , or 5 . If it is not divisible by any of these numbers, please just print out "This number is undetermined". Disclaimer: The answer that should be provided by your program should be the smallest number that equally divides by the number entered in. For example, 200 in sample output \#2 is both divisible by 2 and by 5 , however, your program should prioritize printing out it is divisible by 2 rather than it being divisible by 5 . Only numbers that are strictly divisible only by 5 should print "This number is divisible by 5 " for example like 25. Remember, the class name should be Lab5B

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

How to use a circuit to create a boelean expression

Answered: 1 week ago