please Asap thanks (20 Points) Write a Java program that prints the following sequence. Note the terms
Fantastic news! We've Found the answer you've been seeking!
Question:
please Asap thanks
Transcribed Image Text:
(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 (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
Expert Answer:
Answer rating: 100% (QA)
Program 1 Printing a decreasing sequence public class Q5 public stat... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Let r and s be solutions to the quadratic equation x 2 b x + c = 0. For n N, define d0 = 0 d1 = r s dn = b dn1 c dn2 (n 2) Prove that dn = r n s n for all n N. [4 marks] (b) Recall that a commutative...
-
3. In this problem the bond sells for a premium, which indicates that interest rates have declined. The current yield is $70/$1,222 = 5.73%. To confirm that interest rates have declined, determine...
-
According to the News Wire "Reserve Requirements," 1. By how much did excess reserves in China increase (in yuan)? 2. By how much did the lending capacity of Chinese banks increase as a result?
-
Find the coordinates of the stationary points on each of the following curves and determine the nature of each stationary point. Sketch the graph of each function and use graphing software to check...
-
You need to understand the approach described in question 3 in More Genetic TIPS before answering this question. A gene that is normally expressed in pancreatic cells was cloned and then subjected to...
-
State whether the following provisions impair or preclude negotiability, the instrument in each instance being otherwise in proper form. Answer each statement with either the word Negotiable or...
-
I wrote a relational model for the ER form, but I failed to normalize it. I separated customer contact from customer but I think there should be more. According to the EER chart given, is this...
-
You are Maria Herrera and have been recently promoted to the position of director of financial analysis for a medium-size consumer goods firm. During your first few weeks on the job, you took the...
-
How should the tort system be viewed: as a method of social insurance, a method of deterrence of uneconomical accidents, or something else? Answer from both a law and economics perspective and a...
-
How would you describe the attributes of an annuity? What are some key differences between an ordinary annuity and an annuity due? Explain
-
1. Describe and define what is PEST analysis from a supply chain management perspective? What are the advantages of doing a PEST analysis? Give a concrete example. 2. What is supply chain mapping?...
-
Car payment example A fully electric car can be purchased for 200,000, or for a down payment, plus 5 equal end of year payments, with an interest rate of 10%. Determine the annual payment. If state...
-
Briefly define the role of the following agencies, laws, or terms in connection to labor relations in the US today. a) American Federation of Labor b) Congress of Industrial Organization c) Wagner...
-
1- For the program below: a) Find the number of times the NOP instruction is executed. b) Modify the program to execute the NOP operation 20000 times. LDI R16, 0xC8 R18, 0xAA LDI NOP +0000: +0001:...
-
At time t = 0, a particle of mass m in a 2-dimensional harmonic oscillator potential V(x, y) (x + y), = mw 2 where w is a constant, is described by the wave function 2 p(x, y) = $20 (x, y) 02(x, y),...
-
Make an argument that Williams had a right to delay the closing until after August 1.
-
The boiling point of water drops by about one degree centigrade for every 300 meters (or 1,000 feet) of altitude. Improve the program of Exercise E3.10 to allow the user to supply the altitude in...
-
Design a modification of the BankAccount class in How To 8.1 in which the first five transactions per month are free and a $1 fee is charged for every additional transaction. Provide a method that...
-
Extend Exercise P15.12 to a program that can handle shares of multiple companies. The user enters commands buy symbol quantity price and sell symbol quantity price. Hint: Keep a Map> that manages a...
-
Identify from Cresseys research the six situational categories that cause nonshareable problems.
-
Which of the following is true with regard to Cresseys theory of crime causation? 1. For a fraud to occur, only one of the fraud triangle attributes (perceived pressure, perceived opportunity, or...
-
Identify which of the following is not considered a nonshareable problem from Cresseys research. 1 .Business reversal such as bankruptcy 2.Losses due to gambling 3. Justification of the fraud act by...
Study smarter with the SolutionInn App