Question: Please solve it in java A Harshad number is a positive integer that is divisible by the sum of its digits. Write a method that

 Please solve it in java A Harshad number is a positive

Please solve it in java

A Harshad number is a positive integer that is divisible by the sum of its digits. Write a method that checks if a number passed to the method is Harshard or no. For example, 12 is divisible by 3(=1+2), but 32 is not divisible by 5(=3+2). Write also a main method to check if a number entered by the user is Harshard or no. The program will give the option to the user to enter many numbers. The program stopes when the user enters a value different from y. Finally, the program should display the total of Harshad numbers found. If no harsher number if found the program displays "No Harshad number is found Sample runl: Enter anb:12 12 is a Harshad number Do you want to test a new number (y): Enter a nb:32 32 is not a Harshad number Do you want to test a new number (y): Y Enter a nb:18 18 is a Harshad number Do you want to test a new number (y):n We found 2 Harshad number(s) Sample run2: Enter a nb:19 19 is not a Harshad number Do you want to test a new number (y):y Enter a nb: 25 25 is not a Harshad number Do you want to test a new number (y):n No Harshad number is found Question2 You are asked to write a java program to simulate a small shop. First, you need to read the number of items bought by a client. You should read the price of all items in an array. You should also read the quantity in an array. The program should display the total per item (price * quantity) in an array. Finally, you should display the total bill to be paid by the client. The program stops directly when the user enters an invalid input (negative value or zero)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!