how to Create a Java Package from MATLAB Code?

Can someone PLEASE help with a java program. I am trying to create it an I don't even know how to start it!!

  • This is the program I am writing: Each day, Wayne, Chuck, Owen and Mike start at dawn and play golf all day going from course to course. Each day, each golfer wants to find out how well he did that day compared to par. To this end, each day Mr. Waynes wife, Sarah, enters the days data in a text file where each line of the file consists of 5 numeric values. These are the •par for the hole •strokes Mr. Wayne used on the hole •strokes Mr. Chuck used on the hole •strokes Mr. Owen used on the hole •strokes Mr. Mike used on the hole For example: 4 5 7 3 4 3 1 5 4 8 5 6 6 7 6 ... You are to write a Java program in a NetBeans project that reads the data from a file with this organization and outputs the final number of strokes taken by each golfer in terms of par. For example: •par (if the golfer finished at par) •+10 (if the golfer finished 10 strokes above par) •-3 (if the golfer finished 3 strokes below par) When the program is run, the user will enter the name of the file to read. Additional Information and Requirements 1.Create two data files to be used to test your code. Name one "golf1.txt" and the other "golf2.txt". The files must have at least 5 lines of data and cannot have the same number of lines of data. Place these two files in the root directory of your project. (This is the main directory of your project.) 2.You may place all of your code in the public static void main function of your main project class. 3.Your program must read until the end of file condition is reached. 4.Your program must count the number of holes, i.e. the golfers may want to use the program again and don't want to change it if they don't play the same number of holes one day to the next. 5.All golfing data is input from the user indicated file. 6.All output is to screen or to a single dialog box. 7.Label all output. This is as far as I can get and I am stuck :( package golfman.java; import java.util.Scanner; import java.io.File; public class golfman

  • Answer:

    int sum = 0; int count = 0; int total= 0; int par= 0; System.out.print("Enter the name of the file: "); Scanner fileName = new Scanner(System.in); String input= fileName.nextLine(); while (fileName.hasNext()) { if (count par) { total = count - par; } } } This is the rest of the code I had completed I am sure it makes no sense because it doesnt even compile but its the best I can do right now because I am so confused and I dont understand what we are doing right now. Id appreciate any help anyone can give me right now because my assignment is due TONIGHT I am completely stressed and Ive been working on it all day. Please someone help Thanks yall

sheekygeeks at Answerbag.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.