Question: Write a Java program that gets an integer from user and prints zero if the number is zero. Otherwise, print positive or negative depending
Write a Java program that gets an integer from user and prints "zero" if the number is zero. Otherwise, print "positive" or "negative" depending on whether the number entered is positive or negative. Write a Java program to find the number of days in a month. The program must ask user the number of the month and should print the days accordingly. e.g. for month I the days printed should be 31, for month 2 it should be 28 and so on. Write a Java program that gets an angle in degrees from the user and print the sin() of that angle. e.g. if the user enters 90 as angle then the result should be 1. Hint: you need to first convert the angle into radians and then apply Math.sin(x) method
Step by Step Solution
3.51 Rating (148 Votes )
There are 3 Steps involved in it
1 Java program to input an integer and display a message based on the entered integer import javautilScanner public class Program1 public static void ... View full answer
Get step-by-step solutions from verified subject matter experts
