Explanation:
Please find the below EastCoastSalesDevision class which contains quarterSalesReport (double[] tSales) and quarterCommissionReport (double[] tSales) methods. Also find the output of both the methods.
Please check and revert back in case anything needs to be changed.
Program:
public class EastCoastSalesDevision {
public static void main(String[] args) {
double[] tSales = {4.8, 5.7,6.6,7.5};
quarterSalesReport(tSales);
System.out.println();
quarterCommissionReport(tSales);
}
public static void quarterSalesReport (double[] tSales) {
System.out.printf("%-10s %-25s %-25s %-25s","Quarter","Total
Sales","East Coast Sales","Other Sales");
System.out.println();
System.out.println("--------------------------------------------------------------------------------------------------");
for (int i=0;i<tSales.length;i++) {
double totalSales = tSales[i];
double eastCoastSales = (totalSales*60)/100;
double otherSales = totalSales - eastCoastSales;
System.out.printf("%-10s %-25s %-25s
%-25s","Q"+String.valueOf(i+1),
String.valueOf(totalSales)+"m",String.valueOf(eastCoastSales)+"m",String.valueOf(otherSales)+"m");
System.out.println();
}
}
public static void quarterCommissionReport (double[] tSales)
{
System.out.printf("%-10s %-25s %-25s %-25s","Quarter","Total
Sales","East Coast Sales","Total Commision");
System.out.println();
System.out.println("--------------------------------------------------------------------------------------------------");
for (int i=0;i<tSales.length;i++) {
double totalSales = tSales[i];
double eastCoastSales = (totalSales*60)/100;
double commision = ((((totalSales*10)/100)*0.2)/100);
double totalCommision = commision*5*1000;
System.out.printf("%-10s %-25s %-25s
%-25s","Q"+String.valueOf(i+1),
String.valueOf(totalSales)+"m",String.valueOf(eastCoastSales)+"m",String.valueOf(totalCommision)+"k");
System.out.println();
}
}
}
Output:
Quarter Total Sales East Coast Sales Other Sales
--------------------------------------------------------------------------------------------------
Q1 4.8m 2.88m 1.92m
Q2 5.7m 3.42m 2.2800000000000002m
Q3 6.6m 3.96m 2.6399999999999997m
Q4 7.5m 4.5m 3.0m
Quarter Total Sales East Coast Sales Total Commision
--------------------------------------------------------------------------------------------------
Q1 4.8m 2.88m 4.800000000000001k
Q2 5.7m 3.42m 5.7k
Q3 6.6m 3.96m 6.6k
Q4 7.5m 4.5m 7.500000000000002k

* Create a Single Java Class that contains two static methods that solve the specified problems...
Assignment is designed to develop your ability to create static methods and manipulate 1D and 2D arrays in Java. Create a single Java class Matrix and inside the class create the specified static methods as described Task # Description 1 Create a matrix (known components) 2 Create a matrix (random components) 3 Create a matrix from vectors 4 Compare two matrices 5 Add two matrices 6 Subtract two matrices 7 Multiply a matrix by a scalar 8 Multiply two matrices...
Create a class named Program10. Your program should have the following 4 methods (other helper methods are allowed, but these four methods must be implemented as specified). You need to define a global scanner object and only use it inside the main method and the getValues method, since other methods do not get any values from the input. getValues: This method does not have any input parameter and returns an array of integers. This method prompts the user with a...
This is for JAVA programming. Create a test class that contains two arrays and two methods: - The first array has 3 rows and 3 columns and is initialized with type double data - The second array has 4 rows and 4 columns and is also initialized with type double data - The first method ArraysRows will receive an array of type double as an argument and then print out the sum and average of all elements in each ROW....
Language = JAVA Create a new Java file called PhotoBillingYourLastName with a public static void main. Create three overloaded computePhotoBill() methods for Shutterfly. When computePhotoBill() receives a single double parameter, it represents the price of one photo book ordered. Add 6% tax and return the total due as a double. When computePhotoBill() received two parameters, they represent the price of a photo book and the quantity ordered (int). Multiply the two values, add 6% tax and return the total due....
Last name is Vhora
3. Write a java class named FinalyourLastName, which contains three methods: main, arrayMystery, and countTotalOdd. You need to create main method. Inside the main method...you need to create an integer array named myld that consists of each of the digits in your student ID, call arrayMystery method and print out myld, then call count TotaOdd method and print out the total number of odd digits in your ID. (8 points) The arrayMystery method is given as...
In Java All methods listed below must be public and static. If your code is using a loop to modify or create a string, you need to use the StringBuilder class from the API. Keep the loops simple but also efficient. Remember that you want each loop to do only one "task" while also avoiding unnecessary traversals of the data. No additional methods are needed. However, you may write additional private helper methods, but you still need to have efficient...
Java : Please help me correct my code: create a single class (Program11.java) with a main method and some auxiliary methods to input a 2-D array from a disk file, input some “transactions” to change the 2-D array and output the changed 2-D array to another file. Your main method will be minimal (see below). Most of the work will go on in your methods. In main, declare (but do not instantiate) 2-D array. Then call the three methods. The...
pls help java ASAP!!!!!!!
Topic String Tokenizer Static Methods Static Variables Primitive Arrays Description Enhance the last assignment by providing the following additional features: (The additional features are listed in bold below) Class Statistics In the class Statistics, create the following static methods (in addition to the instance methods already provided). • A public static method for computing sorted data. • A public static method for computing min value. • A public static method for computing max value. • A...
I was presented with this problem: Create a Java class MonthNames with a single static method getMonthName which Takes a single integer corresponding to a month of the year, 1 representing January through 12 representing December, and Returns a string for the name of the month. This is what I have so far public class MonthNames { public static String getMonthName (int numMonth) { return "month"; } public static void main (String [] args) {...
JAVA PROGRAMMING PLEASE This lab has three parts: Create an ArrayList class. Create a LinkedList class. Print out the results after testing each of the methods in both of the classes and solving a simple problem with them. Task 1 – ArrayList Class Create an ArrayList class. This is a class that uses an internal array, but manipulates the array so that the array can be dynamically changed. This class should contain a default and overloaded constructor, where the default...