Java

Need Help in Java Assignment?
We can help you if you are having difficulty with your Java Assignment. Just email your Java Assignment at admin@assignmentcache.com.
We provide help for students all over the world in Java Assignment.

Items 31 to 40 of 98 total

per page
Page:
  1. 2
  2. 3
  3. 4
  4. 5
  5. 6

Grid  List 

Set Ascending Direction
  1. Penn foster Graded Project 4 BoardGameTester application Java

    Penn foster Graded Project 4 BoardGameTester application Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Project 4 BoardGameTester application Java

    In this project, you'll modify the BoardGameTester application to save the gameboard to a file. You'll perform the file writing process on a separate thread.

    INSTRUCTIONS
    1. In NetBeans, open the BoardGameTester project.
    2. Create a new package named games.utilities.
    3. Add a public class named FileManager that contains the following methods:
    public static void writeToFile(String saveState, String fileName) {
    //TODO: Write a string to a new file synchronously
    }
    public static void writeToFileAsync(final String saveState, final String fileName) {
    //TODO: Write a string to a new file asynchronously
    }
    4. Implement the writeToFile method using the new file I/O classes in a try-with-resources statement.
    Note: Use the code in Activity 15 as a guide for the writeToFile method. Remember to import the java.io, java.nio, java.nio.charset, and java.nio.file packages.
    5. Implement the writeToFileAsync method using a separate thread. Use the following code as a guide:
    new Thread() {
    public void run() {
    writeToFile(saveState, fileName);
    }
    }.start();
    Note: This code uses an anonymous inner class to declare and instantiate a Thread class. Unlike a traditional inner class, anonymous inner classes are available only within the statement they're declared. You'll see more examples of anonymous classes with Swing in the next lesson. To ensure that local variables are unchanged by the inner class, the parameters saveState and fileName must be declared with the final keyword.
    6. In the main() method of the BoardGameTester project, add the following code:
    FileManager.writeToFileAsync(ticTacToe.toString(), "ttt.txt");
    FileManager.writeToFileAsync(connectFour.toString(), "c4.txt");
    FileManager.writeToFileAsync(mastermind.toString(), "mm.txt");
    7. Compile and run the project to create three files, one for each saved board game. Open the files to ensure they contain the correct game board display.
    Note: Notepad won’t display the line returns in the file. You may need to open the text files using Microsoft Word or Wordpad instead.
    These three game board files will be required for submission.

    Learn More
  2. Penn foster Graded Project 5 TicTacToe Game GUI Java

    Penn foster Graded Project 5 TicTacToe Game GUI Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Project 5 TicTacToe Game GUI Java

    In this project, you'll create the GUI front-end for the TicTacToe game. This application will leverage the classes you wrote in the graded project for Lesson 3. You'll copy code from Graded Project 3 for this project.
    Figure 20 is a guide for the completed user interface.

    INSTRUCTIONS
    1. In NetBeans, create a new Java Application project named TicTacToeGUIGame.
    2. Copy the games.board package from the Lesson 3 project named BoardGameTester.
    - Right-click on the game.board package in the BoardGameTester project of the Projects pane panel.
    - Choose the Copy option from the context menu or use the keyboard shortcut CTRL+C.
    - Paste it in the TicTacToeGUIGame project using the Paste option in the context menu or the keyboard shortcut CTRL+V.
    Make sure to copy and paste the package in the Source Packages folder.
    3. In the Cell.java file, have the Cell class extend the JButton class. This action will ensure that each cell on the board has the look and feel of a standard Java button.
    4. Override the paintComponent method in the Cell class as follows:
    public void paintComponent(Graphics g) {
            //paint the basic button first
            super.paintComponent(g);
            int offset = 5;
            Graphics2D g2 = (Graphics2D) g;
            g2.setStroke(new BasicStroke(5));
            switch (content) {
                case NOUGHT:
                    g2.setColor(Color.RED);
                    //Draw O
                    g2.drawOval(offset, offset, this.getWidth()
                            - offset * 2, this.getHeight() - offset * 2);
                    break;
                case CROSS:
                    g2.setColor(Color.BLACK);
                    //Draw X
                    g2.drawLine(offset, offset, this.getWidth() - offset,
                            this.getHeight() - offset);
                    g2.drawLine(this.getWidth() - offset, offset, offset,
                            this.getHeight() - offset);
                    break;
            }
        }
    This code uses the enhanced Graphics2D class to set the stroke thickness to more than one pixel. The Oracle documentation provides more guidance on creating complex geometric shapes using the Graphics2D class at http://docs.oracle.com/javase/tutorial/2d/geometry/index.html. Remember to import the java.awt and javax.swing packages!
    5. In the Board.java file, have the Board class extend the JPanel class. This action will ensure that the board can lay out each cell and process its UI events.
    6. Make the following modifications to the Board constructor:
    public Board(int rows, int columns, ActionListener ah) {
    cells = new Cell[rows][columns];
    this.setLayout(new GridLayout());
    for( int r = 0; r < cells.length; r++ ) {
    for (int c = 0; c < cells[r].length; c++) {
    cells[r][c] = new Cell(r,c);
    this.add(cells[r][c]);
    cells[r][c].addActionListener(ah);
    }
    }
    }
    These changes will add each cell to the UI and assign an ActionListener object to each cell.
    Note: Remember to import the java.awt, java.awt.event, and javax.swing packages.
    7. In the TicTacToeGUIGame.java file, have the TicTacToeGUIGame class extend JFrame. This action will ensure that the game is hosted in a Java window.
    8. Import the games.board, java.awt, and javax.swing packages.
    9. Add the following code to the main method:
    SwingUtilities.invokeLater( new Runnable () {
    public void run() { new TicTacToeGUIGame(); }
    });
    10. Declare the following instance variables in TicTacToeGUIGame:
    private Board gb;
    private int turn;
    11. Add the following method to handle each turn:
    private void takeTurn(Cell c) {
    Mark curMark = (turn++ % 2 == 0)?Mark.NOUGHT
    : Mark.CROSS;
    gb.setCell(curMark,c.getRow(),c.getColumn());
    }
    12. Define the following constructor to create the board, provide the event listener, and display the board in the window:
    private TicTacToeGUIGame() {
    gb = new Board(3, 3, new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    Cell c = (Cell) ae.getSource();
    takeTurn(c);
    }
    });
    this.add(gb);
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setTitle(“TIC-TAC-TOE”);
    this.setSize(300, 300);
    this.setVisible(true);
    }
    13. Compile and run the project. How did you do? Test to make sure that each button displays a nought or cross when clicked.

    Learn More
  3. Penn foster Graded Final Project TicTacToe Game GUI Java Player 1 Wins

    Penn foster Graded Final Project TicTacToe Game GUI Java

    Regular Price: $20.00

    Special Price: $15.00

    Penn foster Graded Final Project TicTacToe Game GUI Java


    In this project, you’ll finish the GUI version of the Tic-Tac-Toe game. This project will require you to rewrite the application logic found in the graded project for Lesson 2, but using object orientation this time. In the instructions, code will be referenced from the previous graded projects.


    Instructions
    1. In NetBeans, open the TicTacToeGUIGame project.
    2. In the TicTacToeGUIGame.java file, make the following changes to the TicTacToeGUIGame class:
    a. Add a new method named getOutcome that returns an Outcome enumeration. Use the winOrTie method in the Lesson 2 graded project as a guide.
    b. In the takeTurn method, use the getOutcome method to determine whether to continue the game.
    c. In the takeTurn method, display a dialog message that displays the winner or tie when the game ends.
    Optionally, you can clear the board and start a new game after it ends.
    Note: You can use the following method to display a dialog message in the current window:
    JOptionPane.showMessageDialog (this, "Both players tie.");
    3. Build and run the project. Verify it works as expected. Don’t be discouraged if it doesn’t run as expected right away. Try tracing your steps and using System.out.write statements to figure out where you went wrong.

    Learn More
  4. CMIS 141 Final Project Titanic

    CMIS 141 Final Project Titanic

    Regular Price: $20.00

    Special Price: $15.00

    CMIS 141 Final Project Titanic


    Design a Java application that will read a file containing data related to the passengers on the Titanic. The description of the file is shown below. The application should provide statistical results on the passengers including:
    a. Total number of passengers on the Titanic
    b. Total number of passengers who perished on the Titanic
    c. Total number of Passengers who survived the sinking of the Titanic
    d. Number of passengers who survived the sinking of the Titanic as a function of the passenger class (e.g. 1,2,3)
    e. Number of passengers who survived the sinking of the Titanic as a function of the passenger gender (e.g., male, female)
    f. A list of the names of passengers who paid greater than $200 for their tickets
    g. A list of the names of passengers who were less than 10 years old who survived the sinking of the Titanic
    h. A list of the names of passengers who were less than 10 years old who perished on the Titanic
    i. The count of the number of passengers as a function of the first letter of their last name. (e.g., A: 13, B:33)
    j. Additional statistical results you add to enhance the functionality


    The following are some design criteria and specific requirements that need to be addressed:
    a. Use command line arguments to send in the name of the Titanic file.
    b. Use a 2D array to store the Titanic data. (Hint: You will probably need to store the array as String values and then convert to other types as needed since some data is null)
    c. You should create at least 2 Java classes – Titanic and TestTitanic. You are welcome to create additional classes if you want to further separate the functionality.
    d. You should create separate methods for each of the required functionality. (e.g. getTotalPassengers() will return the total number of passengers on the Titanic.)
    e. A user-friendly and well-organized menu should be used for users to select which data to return. A sample menu is shown in run example. You are free to enhance your design and you should add additional menu items and functionality.
    f. The menu system should be displayed at the command prompt, and continue to redisplay after results are returned or until Q is selected. If a user enters an invalid menu item, the system should redisplay the menu with a prompt asking them to enter a valid menu selection
    g. The application should keep track of the elapsed time (in seconds) between once the application starts and when the user quits the program. After the program is exited, the 2 application should provide a prompt thanking the user for trying the Titanic program and providing the total time elapsed.
    Here is sample run:
    java TestTitanic Titanic.txt
    ********** Welcome to the Titanic Statistical Application **************************
    Enter the number of the question you want answered. Enter ‘Q’ to quit the program :
    1. How many passengers were on the Titanic?
    2. What percentage of passengers perished on the Titanic?
    3. What percentage passengers survived the sinking of the Titanic?
    4. What percentage of passengers survived for each of the three classes?
    5. What percentage of passengers survived as a function of gender?
    6. What specific passengers paid more than $200 for their tickets?
    7. What specific passengers who were less than 10 years old perished on the titanic?
    8. What specific passengers who were less than 10 years old survived the sinking of the titanic?
    9. For each letter in the alphabet, how many passengers last names started with that letter?
    Q. Quit the program
    Enter your selection: 1
    There were 1310 Passengers on the Titanic.


    Submission requirements:
    Your deliverables include all Java files (.java) and a single word (or PDF) document. The Java files should be named appropriately for your applications. Your word document should include screen shots showing the successful compiling and running of each application, and a detailed description of the test plan for each application. The test plan should include the input, expected output, actual output and if the test case passed or failed. Submit your files to the Final Project assignment area no later than the due date listed in the calendar.


    Titanic Data Description:
    The attached tab delimited file, named titanic.txt contains the known passengers on the Titanic. There are 5 fields included in the file in the order:
    Passenger class (1,2,3)
    Survived (1=yes, 0=no)
    Name (Passenger name)
    sex (male or female)
    age (some values are blank)
    fare (some values are blank)

    Learn More
  5. CMIS 141 Homework 3 HeadPhones Class

    CMIS 141 Homework 3 HeadPhones Class

    Regular Price: $20.00

    Special Price: $15.00

    CMIS 141 Homework 3 HeadPhones Class


    1. (25 points) Create a Java class named HeadPhones to represent a headphone set.
    The class contains:
    - Three constants named LOW, MEDIUM and HIGH with values of 1, 2 and 3 to denote the headphone volume.
    - A private int data field named volume that specifies the volume of the headphone. The default volume is MEDIUM.
    - A private boolean data field named pluggedIn that specifies if the headphone is plugged in. The default value if false.
    - A private String data field named manufacturer that specifies the name of the manufacturer of the headphones.
    - A private Color data field named headPhoneColor that specifies the color of the headphones.
    - getter and setter methods for all data fields.
    - A no argument constructor that creates a default headphone.
    - A method named toString() that returns a string describing the current field values of the headphones.
    - A method named changeVolume(value) that changes the volume of the headphone to the value passed into the method
    Create a TestHeadPhones class that constructs at least 3 HeadPhones objects. For each of the objects constructed, demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment.


    2. (25 points) Create your own Java class that represents your favorite musical instrument. Your musical instrument class should have at least 3 constants, 4 private data fields, getters and setters for each private data field, a toString() method, and two additional methods of your choice.
    Create a test class that constructs at least 3 of your musical instrument objects. For each of the objects constructed demonstrate the use of each of the methods. Be sure to use your IDE to accomplish this assignment. You can pick any instrument you want. When designing your class, think about what would make sense to describe and use the instrument.
    For example, if you selected a trumpet, you might need to provide the number of valves, the manufacturer, if the instrument is using a mute, and the volume or even notes the trumpet is playing. Make this your own creation and have fun with it.

    Learn More
  6. ITSD322 Unit 1 Java console program

    ITSD322 Unit 1 Java console program

    Regular Price: $15.00

    Special Price: $12.00

    ITSD322 Unit 1 Java console program


    Throughout this course, you will be learning about object-oriented programming and demonstrating what you learn by writing some programs in Java. The first step will be to install and integrated development environment (IDE) that will be where you will write and compile your programs. You will also write your first program using Java to show that you have correctly installed the IDE.
    The project instructions and deliverables are as follows:
    Download and install Java JDK and NetBeans IDE using the default installation options.
    Run the IDE, and take a screenshot.
    Create a console program that prompts the user to enter the name and address of their employer and position they hold or the name and address of their favorite restaurant and their favorite meal.
    Display this information on the screen, each on a separate line.
    Run your modified program and take a screenshot of the results.
    Create a document in Word, and add the following:
    Title page which includes: CourseNumber, CourseSection, CourseName, ProjectName (Unit 1 IP), StudentName and Date.
    Screen shots showing the IDE running.
    Screen shot showing the program's output.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  7. ITSD322 Unit 2 Java console program

    ITSD322 Unit 2 Java console program

    Regular Price: $20.00

    Special Price: $15.00

    ITSD322 Unit 2 Java console program


    The first step in writing a software application is to determine the requirements. There is no value in writing a program that does not address the needs of the client. Requirements can be gathered in many ways, but ultimately, the requirements serve to document what the application should and should not do. After the requirements are written, the application design can be prepared, followed by the actual coding. For this project, you will gain some practice in the design phase of software development by designing a program that will meet a given set of requirements.
    Develop a console program that simulates a section of a restaurant menu. Each item will have a different price and your program should define at least ten (10) items. You will need to obtain an order from the user who should provide their menu selection along with quantity. The total cost for the meal must be calculated. The user will enter the amount of their payment ($10, $20, etc.). The program needs to calculate the amount due back to the user (payment minus total cost of meal).
    The project instructions and deliverables are as follows:
    Create a document in Word (name the design document yourName_Unit2.IP), and add the following:
    Title page
    Course number and name
    Project name
    Student name
    Date
    List the data items that must be stored and used by the program. Each data item should be given a name for reference. Develop a UML class diagram that illustrates the data items for your program.
    List the decisions the program must make. References to the data items in the previous step should be used where appropriate.
    Describe the flow of operation of the program by preparing pseudocode or a UML activity diagram. All key activities should be included, and references to the data items and decisions listed in the previous steps should be used.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  8. ITSD322 Unit 3 Java AnimalInfo console program

    ITSD322 Unit 3 Java AnimalInfo console program

    Regular Price: $20.00

    Special Price: $15.00

    ITSD322 Unit 3 Java AnimalInfo console program


    So far, you have learned about design and how to create a simple Java application using an IDE. Now, you are going to gain some experience writing an object-oriented program with classes, objects, inheritance, and polymorphism. These terms sound complex, but you will find they are not difficult to use. You will be drawing on all the information you have gained, and this project will require some time, so start early, and pay attention to instructions.


    For this project, you will write a Java program that allows the user to select an animal from a menu and then display information about the animal.
    Create a new project in your IDE named "AnimalInfo."
    Create a class called "AnimalInfo" as the main class for the program.
    Create a class called "Animal" with a virtual method displayInfo().
    Create 3 classes inherited from Animal (one for each of your animals). Each of the inherited classes should override Animal.displayInfo() to display information about the animal. The information should just be a short description of the animal displayed to the screen.
    In the AnimalInfo.main) method, display a menu allowing the user to choose 1 of 3 animals or quit the program. The menu should accept input from the user and take the appropriate action and then repeat until the user selects the option to quit. Hint: Simple menus are easiest to implement if the user selects a letter or number for each menu item.
    When the user selects an animal, use the displayInfo() method of the appropriate class to display information about the selected animal.
    Use comments throughout your code demonstrating your understanding of each statement of code.
    Make sure the program runs correctly before submission.
    Create a zip that includes your project folder and Word document, and upload it to the course portal.

    Learn More
  9. Tracking Contributors Linked List Insertion Sort Java Program

    Tracking Contributors Linked List Insertion Sort Java Program

    Regular Price: $20.00

    Special Price: $15.00

    Tracking Contributors Linked List Insertion Sort Java Program


    Based on the new requirement from your boss to be able to search for contributor's name, you decide it will be good idea to have the data sorted. You will read the contributor information from a file provided; it is a common delimited (CSV) file. AS each record is read, create a sorted Linked List of the contributors using the insertion sort method. At this point, you no longer need to maintain the stack. Your design should include the following:


    Each contributor will have the following information:
    • Name: String; //the name of the contributor
    • City: String; //the city in which the contributor lives
    • Country: String; //the country in which the contributor lives
    • Phone: String; //the phone number for the contributor
    • Contribution: Double; //the amount of the contribution given by the contributor to the zoo
    • ID: Integer; //identifier key for future needs


    Contributor Functions/Methods:
    • Input constructor: //to accept a string for the name and additional information for each contributor(this should call the Add constructor to implement the sorted list)
    • Print constructor: //to print out the contributor data
    • Print All constructor: //to print the entire list of contributor names
    • Add constructor: //to traverse the linked list and find the proper location for adding the instance


    Deliverables:
    • A Fully Documented Program to load the data creating a sorted linked list.
    • A Test Plan to show how program runs and can be executed.
    • A screen shot showing that the program loaded the data. After the data is loaded perform a Print All showing the sorted list.

    Learn More
  10. CIS355A Week 7 Course Project Flooring Application User Manual and Application Code

    CIS355A Week 7 Course Project Flooring Application User Manual and Application Code

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 7 Course Project Flooring Application User Manual and Application Code


    Your application must include at least three tabs. The user will choose wood flooring or carpet, enter the length and width of the floor, as well as the customer name and address. The application will compute the area of the floor and the cost of the flooring considering that wood floor is $20 per square foot and carpet is $10 per square foot. A summary should be displayed, either in a tab or another window, listing the customer name and address, floor selection, area, and cost. This information should also be stored in the MySQL database table. The program should validate that all information is entered and that the length and width are numeric values. Any numeric or currency values must be formatted appropriately when output. Recommendations for the components used for input are
    • radio buttons—flooring type (wood or carpet);
    • text fields—customer name, customer address, floor length, and floor width; and
    • buttons—calculate area, calculate cost, submit order, display order summary, display order list.
    The MySQL database table is called flooring and has the following description.
    Field Type
    CustomerName varchar(30)
    CustomerAddress varchar(50)
    FlooringType varchar(10)
    FloorArea Double
    FloorCost Double
    In addition to entering new customer orders, your application should list all customer orders stored in the database. These will be viewed as a list, in a text area, and will not be updated by the user.


    User Manual (Due Week 7)
    Your actual Course Project and user manual are due at the end of Week 7. However, it is strongly recommended that you start your project in Week 5 to avoid many last minute issues.
    In Week 7, you will be required to submit a user manual, as well as your Java code. The user manual can be a simple Word document with screenshots that explains how to run your application. Your mark will depend both on the program quality and the quality of the user manual.
    Here are some more detailed guidelines about the user manual.
    It does not need to be long, probably not more than 5 pages, including screenshots.
    Write at the expected user's level, not too technical.
    Detail all the functionality that the application provides.
    For each function, show what is its purpose and sample execution, with a screenshot.


    User Manual Points Description
    Sufficient length to describe the application 5 Manual contains explanation in detail of all relevant areas of the application
    Contains screenshots of the key interface components 5 Images of each section of the application
    Operations are explained 5 Detailed operation of each section of the application
    Written to the user's level and is not technical 5 Must not contain code or any other technical items irrelevant to the users
    Subtotal 20


    Application Code (Due Week 7)
    The following grading rubric will be used for the code portion of the project.
    Flooring Application Points Description
    Standard header included 2 Must contain program name, student name, and description of the program
    Program compiles 2 Program does not have any error
    Program executes 2 Program runs without any error
    Includes at least 3 tabs 10 Three or more tabs are used
    Includes components for all required inputs 35 Components for customer name, address, floor type, length, width, area and cost with buttons to calculate area, calculate cost, display order summary, and display order list are included
    Area calculation 4 Area is calculated correctly
    Cost calculation 5 Cost is calculated correctly
    Included data validation 10 If no values or non-numeric values are entered, the proper error message should display.
    Correct data is stored in the database table 10 When values are entered, the data is stored correctly in the database table.
    Customer orders are displayed in a list 10 All records saved to the database are displayed in a list with appropriate formatting.
    Correct output is displayed 10 When values are entered, the order summary is shown with appropriate formatting.
    Total 100

    Learn More

Items 31 to 40 of 98 total

per page
Page:
  1. 2
  2. 3
  3. 4
  4. 5
  5. 6

Grid  List 

Set Ascending Direction