Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is my code file. Is there any way to split up what I have already and put it in the utility file? I am
This is my code file. Is there any way to split up what I have already and put it in the utility file? I am confused about how utility class files work. Thanks
Assignment: Create a Java class named Homework5 that performs the following: This file will include your mainline logic (e.g. main method) Given the activity diagram provided in Figure 1 below, create the necessary Java code to satisfy the algorithmic requirements o This code file will not contain the logic for totaling the value of all entered data, it will only perform the iterative data entry logic and store those values into an appropriate data structure o That data structure must then be passed to static method in another code file described below Note: Your program should perform the correct number of data entry repetitions based upon the 1st value provided by the user. Create a second Java class named Utility that includes the following members: O A single static method that declares an appropriate parameter to receive the data structure populated and passed in from the mainline logic o This method will return a single value of an appropriate data type that is the sum total of all values contained in the data structure received from the mainline logic o This class will not contain any System.out.println() invocations Submit your Java code to the appropriate MISGrader assignment using your personalized link provided via email at the start of the course. o There will be a separate entry box with appropriate labels on the MISGrader assignment for each of the code files. Make sure to paste the correct code file into the correct box before submitting! How many locations will you enter daily sales totals for? 3 Please enter the daily sales total for store #1: 1500.00 Please enter the daily sales total for store #2: 2500.00 Please enter the daily sales total for store #3: 750.00 The grand total for this day's sales is: $4750.00 The highest sales total was: $2500.00 The lowest sales total was: $750.00 Table 1 - Example program input & output 4 6. 1 package homework5; 2e import java.util.ArrayList; 3 import java.util.Collections; import java.util.Scanner; import java.text.DecimalFormat; 7 public class Homework5 { public static void main(String[] args) { 9 Scanner in = new Scanner(System.in); 10 11 System.out.println("How many locations will you enter daily sales totals for?"); E12 13 String numOfLocations= in.nextLine(); 14 ArrayListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started