Write a program named PlusSigns.java that asks the user for a number from 1-10 and then prints
Question:
Write a program named PlusSigns.java that asks the user for a number from 1-10 and then prints an inverted "triangle of plus signs".
For example, an input of 6 would produce this output:
+++++++++++
+++++++++
+++++++
+++++
+++
+
Hint: Make a table that tells how many leading spaces and plus signs you'll need:
row #plus signs #spaces
+++++++++++ 0 11 0
+++++++++ 1 9 1
+++++++ 2 7 2
+++++ 3 5 3
+++ 4 3 4
+ 5 1 5
Then use that to figure out formulas that, given a row number, will tell you how many spaces and plus signs you need to print in the inner loop.
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch