Find Jobs
Hire Freelancers

Create 2 Java Programs Using Info Provided

$10-30 USD

Completed
Posted over 6 years ago

$10-30 USD

Paid on delivery
I need 2 java programs created using using specifics given. Below PROGRAM # 1 [login to view URL] a class dataset that stores a number of values of type double. Provides a constructor Public dataset (int maximumNumberOfValues) And a write a method Public void add (double value) that adds a value. Lastly provide methods to compute the sum, avg, max, and min values Please feel free to work off of what I started. Thanks */ public class DataSet { // Implmentation . . . /** Constructs an empty data set. @param maximumNumberOfValues the maximum this data set can hold */ public DataSet(int maximumNumberOfValues) { . . . } /** Adds a data value to the data set if there is room in the array. @param value a data value */ public void add(double value) { . . . } /** Gets the sum of the added data. @return sum of the data or 0 if no data has been added */ public double getSum() { . . . } /** Gets the average of the added data. @return average of the data or 0 if no data has been added */ public double getAverage() { . . . } /** Gets the maximum value entered. @return maximum value of the data NOTE: returns -Double.MAX_VALUE if no values are entered. */ public double getMaximum() { . . . } /** Gets the minimum value entered. @return minimum value of the data NOTE: returns Double.MAX_VALUE if no values are entered. */ public double getMinimum() { . . . } } /** Run some tests for the DataSet class */ public class DataSetTester { public static void main(String[] args) { DataSet data = new DataSet(5); [login to view URL](3.5); [login to view URL](7.9); [login to view URL](15.2); [login to view URL](-7.3); [login to view URL]("Sum: " + [login to view URL]()); [login to view URL]("Expected: 19.3"); [login to view URL]("Average: " + [login to view URL]()); [login to view URL]("Expected: 4.825"); [login to view URL]("Maximum: " + [login to view URL]()); [login to view URL]("Expected: 15.2"); [login to view URL]("Minimum: " + [login to view URL]()); [login to view URL]("Expected: -7.3"); } } PROGRAM#2 2. A supermarket wants to reward its best customers of each day, showing the customer’s name on a screen in the supermarket. For that purpose the store keeps an Arraylist in the Store class. Please implement the following methods. Public void addSale(String customerName, double amount ) Public String nameOfBestCustomer () To record the sale and returns the name of the customer with the largest sale. Please use the following information to write a program that prompts the cashier to enter all prices, and names. Adds them to a store object, and displays the best customer’s name. import java.util.*; /** * Code for P7.13 * @author */ public class Store { public String nameOfBestCustomer(ArrayList<Double> sales, ArrayList<String> customers) { String top = " "; // Your work starts here // Your work ends here return top; } public static void main(String[] args) { ArrayList<Double> price = new ArrayList<Double>(); ArrayList<String> names = new ArrayList<String>(); Scanner in = new Scanner([login to view URL]); // Your work starts here // Your work ends here Store top = new Store(); [login to view URL]("Best customer's name " + [login to view URL](price, names)); } }
Project ID: 15141509

About the project

4 proposals
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
hi i am a java SE ,ee developer this is easy work lets start it. visit my profile and see what other people say about me Relevant Skills and Experience java SE, EE Proposed Milestones $30 USD - milestone
$15 USD in 1 day
5.0 (20 reviews)
4.7
4.7
4 freelancers are bidding on average $28 USD for this job
User Avatar
hi sir, i will create the java class with the details provided to maintain the list of double values, thanks............................................................ Relevant Skills and Experience java Proposed Milestones $15 USD - completion
$15 USD in 1 day
5.0 (44 reviews)
5.3
5.3
User Avatar
I can help you in max 1 day! I know a lot of about Java and Java Web.
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
wdm, United States
5.0
5
Payment method verified
Member since Apr 2, 2017

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.