Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I had posted this question on march 13 and house data also. mine due date is tomorrow please check these both questions and answer

image text in transcribed
image text in transcribedHi I had posted this question on march 13 and house data also. mine due date is tomorrow please check these both questions and answer me till tonight. Thank you!
image text in transcribed
image text in transcribed
image text in transcribed
Programming Project 2 - Number Sum Note: When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor or teaching assistants). Write a program called Number Sum.java that determines if a number, when properly configured, is modularly divisible by 11,9. or 6 based on the user's input. To find this out you will need to randomly generate or enter a 5-digit number. You can randomly generate each digit independently or the number all at once. Each digit will then be placed into the following formula and to determine if it is modularly divisible by 11,9, or 6. Number Sum Formula: 5d+4d, + 3d + 2de + 1ds = 0 (mod 11 or mod 9 or mod 6) (where d; is the first digit of the number, starting on the left-hand side, d, is the next digit, and so on.) Example 1. if the number was 67439, then you would add up: 5*6 + 4*7 + 3*4 + 2*3 + 19 = 85 % 11 = 8, so not divisible by 11. 5*6 +47+3*4 + 2*3 + 19 = 85 % 9 = 4, so not divisible by 9. 5*6 +4+7+34 +2+3 + 19 = 85% 6 = 1, so not divisible by 6. Example 2, if the number was 03063, then you would add up: 5*0 +4+3 + 3*0 + 26 + 13 = 27 % 11 = 5, so not divisible by 11 5*0 + 4*3 +30 + 2*6 + 13 = 27 % 9 = 0, so is divisible by 9. 5*0 +4+3 + 3*0 + 2*6 + 13 = 27 % 6 = 3. so not divisible by 6. The program will first ask the user if they would like to randomly generate a number or enter it if the user picks the randomly generated number the program will use Math random to randomly generate the digits and will display the 5-digit number to the lyje Page

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

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago