How to write a program called NestedLoops that contains a main() method with 5 nested loops that output the patterns shown below:
$ java NestedLoops
*****
*****
*****
*****
*
**
***
****
*****
1
22
333
4444
55555
666666
7777777
1
2
3
4
5
1
22
333
4444
55555
Complete the OrderApp program below that uses the getCost() method to calculate the cost for some number of t-shirts, hoodies, or shorts. There is a $6.00 surcharge for each size x-large item.
Here is the expected output for the program:
$ java OrderApp 5 t-shirts, size medium: $50.00 2 hoodies, size x-large: $72.00 3 shorts, size small: $45.00
Here is the program that you must complete using the provided enumerations and class constants:
import java.util.*;
public class OrderApp {
public enum Size {SMALL, MEDIUM, LARGE, XLARGE}
public enum Item {TSHIRT, HOODIE, SHORTS}
public static final int TSHIRT_COST = 10;
public static final int HOODIE_COST = 30;
public static final int SHORTS_COST = 15;
public static final int XLARGE_SURCHARGE = 6;
public static void main(String[] args) {
System.out.println(“\n5 t-shirts, size medium: $” + getCost(/* Add Code Here */) + “.00”);
System.out.println(“\n2 hoodies, size x-large: $” + getCost(/* Add Code Here */) + “.00”);
System.out.println(“\n3 shorts, size small: $” + getCost(/* Add Code Here */) + “.00”);
}
public static int getCost(Item i, Size s, int number) {
//Add code here
}
}