Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please Asap thanks (20 Points) Write a Java program that prints the following sequence. Note the terms are decreasing by a value of 3. public
please Asap thanks
(20 Points) Write a Java program that prints the following sequence. Note the terms are decreasing by a value of 3. public class Q5 { } public static void main(String[] args) { } 21, 18, 15, 12, 9, 6, 3, 0 // declare and initialize an integer to 21 // print the first integer // loop that prints a "," then reduces the integer by 3 then prints the // integer. This loop should end when the integer is no longer more than // or equal 0 (20 Points) Write a java program that accepts a temperature from the user and prints out to the screen if it is cold or warm. If the temperature is more than or equal 50 then it is WARM, otherwise, it is a COLD. import java.util.Scanner; public class Q4 { public static void main(String[] args) { double temperature = 0.0; Scanner input= new Scanner (System.in); System.out.print("Enter temperature: "); //Accept user input //Print WARM if more than or equal 50.0, otherwise print COLD
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Program 1 Printing a decreasing sequence public class Q5 public stat...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started