Answer:
please mark as brainliest!!
Explanation:
public class SumOfDigits{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Please enter a number to calculate sum of digits"); int number = sc.nextInt(); // Remember number/10 reduces one digit from number // and number%10 gives you last digit int sum = 0; int input = number; while (input != 0) { int lastdigit = input % 10; sum += lastdigit; input /= 10; } System.out.printf("Sum of digits of number %d is %d", number, sum); // closing Scanner to prevent resource leak sc.close(); } }
Answer:
complex formatting feature enables you to represent text as colorful
visuals.
mark as brainliest
In technicality, humans can work healthily 14-15 hours a day, 365 days a year. I subtracted the hours of the day needed for sleep and feeding.
Import java.util.Scanner;
public class MinutesConversion {
private static Scanner inputDevice;
public static void main(String[] args) {
int minutes, hours;
float days; // float for decimal point
inputDevice = new Scanner(System.in);
System.out.println("Please enter minutes for conversion >> ");
minutes = inputDevice.nextInt();
hours = minutes / 60;
days = hours / 24.0f;
System.out.println(+ minutes + " minutes is " + hours + " hour(s) or" + days " days");
}
}