Question: code in java, please also show steps For this assignment you must do the following tasks: 1. Write a method to calculate the sum of
code in java, please also show steps

For this assignment you must do the following tasks: 1. Write a method to calculate the sum of digits of any integer. Your program should ask the user to input a number in the main method and should then call your method to calculate the sum of the digits. (5 Points) Enter a number: 3782 Sum of digits of 3782 is 20 2. Write a method to compute the distance between two points A(x1, y1) and B(x2, y2). Using this method, write another method that will compute the area of a triangle whose vertices are A(x1, y1), B(x2, y2) and C(x3, y3). You may assume that point coordinates are integers. (15 Points) Hints: o O Distance between points = [(x1 - x2)2 + (y1 - y2)2 If a, b and c are the lengths of a triangle, then area of triangle is given by i. area = VS (S a)(S b)(S c) ii. S = (a + b + c)/2 Enter Point A coordinates: -2 0 Enter Point B coordinates: 50 Enter Point C coordinates: 0 4 Area of triangle is 14.03
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
