Reference no: EM13165802
Write a program using for loops to produce the following output. Please read carefully the entire specification! Your program must work for any odd number entered by the user, not just 13.
Enter an odd number width: 13
Hill:
*
***
*****
*******
*********
***********
*************
Triangle:
*
***
*****
*******
*********
***********
*************
Diamond:
*
***
*****
*******
*********
***********
*************
***********
*********
*******
*****
***
*
Start with the Hill. Each line must be printed with a 1 for loop. Figure out how to print a line of stars, printing 1 star at a time. The number of lines is controlled by a for loop around that loop and prints each line
To print the Triangle, figure out how to print an upside down Hill, like this
*******
*****
***
*
Then, change the star * to a single space! Each line should be printed with more than 1 for loop, which is embedded in anotherfor loop that prints multiple lines (i.e. the top 6 lines). This diagram might help:
Finally, to print the Diamond, print the Triangle for the top, and then use similar, sort of backward for loops to produce the bottom of the Diamond.
The load master for a freighter
: The load master for a freighter wants to determine the mix of cargo to be carried on the next trip. The ship's volume limit for cargo is 100,000 cubic meters, and it weight capacity is 2,310 tons.
|
Storage systems increasingly rely on the internet
: Storage systems increasingly rely on the Internet infrastructure as a transport medium. What are the advantages of this approach? What problems are present in terms of security and reliability?
|
Slugworth candies
: Slugworth Candies, LLC, is a candy maker company that employs 450 people. The company is composed of six departments: Executive Staff (20), Human Relations (6), Finance and Accounting (15), Marketing and Sales (15), Factory (150), and Research & D..
|
We would like to implement the lexical order
: We would like to implement the lexical order for lists. For simplicity, we only consider lists of numbers, where , >= have their usual meaning.
|
Write a program using for loops t
: Write a program using for loops to produce the following output. Please read carefully the entire specification!
|
Gradesaverage, which prompts user
: Write a program called GradesAverage, which prompts user for the number of students, reads it from the keyboard, and saves it in an int variable called numStudents. It then prompts user for the grades of each of the students and saves them in an i..
|
Consider an array of integers
: Consider an array of integers as below: int[] a = {5, 2, -4, 3, 0, -5, 7, 11, 6, 13} Complete the method named count(int[] a) in the class Count. The method should return the number of positive numbers in the array
|
The interest rate per period
: The interest rate per period. For example, if your loan's interest is 6.5% per year, and you are paying monthly, this would be 6.5%/12. If you are paying every two weeks, r would be 6.5%/26, because there are 26 two-week periods in a year.
|
. label the rows that make good power ciphers and explain
: a) Make a power table for numbers mod 11. Indicate how the table shows Fermat's theorem, label the primitive roots mod 11. Explain how you can tell they are primitive roots. Label the rows that make good power ciphers and explain
|