Write a Java program that displays the following picture. (Hint: Write a sequence of println statements that display lines of asterisks and blanks.)
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Java: An Introduction to Problem Solving and Programming plus MyProgrammingLab with Pearson eText -- Access Card Package (7th Edition)
Additional Engineering Textbook Solutions
C++ How to Program (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
- In Java find the value of x , y after the statements are executed: (statements are in picture)arrow_forwardPlease help repeat this Java programming using the text method of input or outputarrow_forwardOutput a half pyramid of stars with a height determined by the user. If the user enters a number less than one, exit. Write the code in java and use the test case example as referencearrow_forward
- To increment a variable x in Java, we code the following: x=x+1; x++; x+=1; All of the above are correct.arrow_forwardCode the following statments in JAVA If your average time to run each mile is under 11 minutes, display a"you got gold" message 5. If your average time to run each mile is under 15 minutes, display a"you got silver" message 6. If your average time to run each mile is equal to or more than 15minutes, "you got bronze" messagearrow_forwardIn java Write a program that works as follows: Note that the last number entered must be a 0 which is not considered in the average calculation and it just shows the end of the input.arrow_forward
- The following is related to a Java Code: The following if statement determines whether choice is equal to ‘Y’ or ‘y’: if (choice == 'Y' || choice == 'y') Rewrite this statement so it makes only one comparison and does not use the || operator. 1) How will it get fixed?arrow_forwardIn Java Determine the output of the following code. boolean done = false; if (done = false) System.out.println("Not"); if( done = true) System.out.println("Done "); else System.out.println("Undecided "); System.out.println("End");arrow_forwardWrite a code in Java: Write a program that will prompt the user for a temperature, and a choice to convert that temp to f or c. The program should then return the correctly converted temperature. Use conditional statements such as "if" and "else."arrow_forward
- In Java, If a = 4; and b = 3;,then after the statement a = b; executes, the value of b is 4 and the value of a is 3. True or Falsearrow_forwardJava Fill in the blank to complete the code so that it will print out "looks good" if the value of the integer variable input is within the range of 1 through 10. Do not use any additional parentheses in your answer. if (____________________) { System.out.println("looks good");}arrow_forwardwrite a java programme for this question Suppose you want to deposit a certain amount of money into a savings account, and thenleave it alone to draw interest for the next 10 years. At the end of 10 years, you would like tohave $10,000 in the account. How much do you need to deposit today to make that happen?You can use the following formula, which is known as the present value formula, to find out:The terms in the formula are as follows:• P is the present value, or the amount that you need to deposit today.• F is the future value that you want in the account. (In this case, F is $10,000.)• r is the annual interest rate.• n is the number of years that you plan to let the money sit in the account.Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years asarguments. It should return the present value, which is the amount that you need to deposit today.Demonstrate the method in a program that…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT