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 21 to 30 of 109 total

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

Grid  List 

Set Ascending Direction
  1. Flower Pack Java Assignment 1

    CSC 275 Flower Pack Java Assignment 1

    Regular Price: $12.00

    Special Price: $10.00

    CSC 275 Flower Pack Java Assignment 1
    As I was on a hike the other day I came across a small child in the woods. He told me his life story, with special mention of his disabled sister that loves flowers, and asked me for a favor.
    He wanted a way to organize the flowers that he picks for her each day and perform a few basic tasks with them, along with a few restrictions. It is our goal to help him out!
    • He can only carry 25 flowers as adding any more causes many of them to become crushed.
    • He needs to be able to search for a specific type of flower in his pack incase his sister has a special request.
    • He needs to be able to sort flowers by their names alphabetically in ascending order (A-Z)
    • He needs to know how many of each flower he has in his pack.


    Now, I have started a simple program which will serve as guidance for you, please help me finish it. (Please don’t modify the code that I give you, just add your code where required)
    import java.util.Scanner;
    public class Assignment01Driver {
    public static void main(String[] args){
    new Assignment01Driver ();
    }
    // This will act as our program switchboard
    public Assignment01Driver (){
    Scanner input = new Scanner(System.in);
    String[] flowerPack = new String[25];
    System.out.println("Welcome to my flower pack interface.");
    System.out.println("Please select a number from the options below");
    System.out.println("");
    while(true){
    // Give the user a list of their options
    System.out.println("1: Add an item to the pack.");
    System.out.println("2: Remove an item from the pack.");
    System.out.println("3: Sort the contents of the pack.");
    System.out.println("4: Search for a flower.");
    System.out.println("5: Display the flowers in the pack.");
    System.out.println("0: Exit the flower pack interfact.");
    // Get the user input
    int userChoice = input.nextInt();
    switch(userChoice){
    case 1:
    addFlower(flowerPack);
    break;
    case 2:
    removeFlower(flowerPack);
    break;
    case 3:
    sortFlowers(flowerPack);
    break;
    case 4:
    searchFlowers(flowerPack);
    break;
    case 5:
    displayFlowers(flowerPack);
    break;
    case 0:
    System.out.println("Thank you for using the flower pack interface. See you again soon!");
    System.exit(0);
    }
    }
    }
    private void addFlower(String flowerPack[]) {
    // TODO: Add a flower that is specified by the user
    }
    private void removeFlower(String flowerPack[]) {
    // TODO: Remove a flower that is specified by the user
    }
    private void sortFlowers(String flowerPack[]) {
    // TODO: Sort the flowers in the pack (No need to display them here) - Use Selection or Insertion sorts
    // NOTE: Special care is needed when dealing with strings! research the compareTo() method with strings
    }
    private void searchFlowers(String flowerPack[]) {
    // TODO: Search for a user specified flower
    }
    private void displayFlowers(String flowerPack[]) {
    // TODO: Display only the unique flowers along with a count of any duplicates
    /*
    * For example it should say
    * Roses - 7
    * Daffodils - 3
    * Violets - 5
    */
    }
    }

    Learn More
  2. CMIS242 Homework 2 Java Division Exception

    CMIS242 Homework 2 Java Exceptions and Interface

    Regular Price: $12.00

    Special Price: $10.00

    CMIS242 Homework 2 Java Exceptions and Interface


    Write a Java application that asks a user to enter two integers (A and B) and then display the results of A/B. Catch any division by zero errors and prompt the user to reenter the value of B. Be sure your code compiles and runs as expected. Name your Java file SafeDivision.java.


    Write a Java interface named Searchable with two abstract methods: one named Way2Search that returns a String and another named MaxTime that returns an Integer. Write another class that implements that interface and that contains a simple test. Be sure your code compiles and runs as expected. Name your Java files Searchable.java, and TestSearchable.java.

    Learn More
  3. CMIS 242 Final Project Person Details

    CMIS 242 Final Project Person Details

    Regular Price: $15.00

    Special Price: $12.00

    CMIS 242 Final Project Person Details

    This project focuses on demonstrating your understanding of Java Collections. Before attempting this project, be sure you have completed all of the reading assignments listed in the syllabus to date, participated in the weekly conferences, and thoroughly understand the examples throughout the chapters. The project requirements include:

    1. Write a Java application that effectively uses Java collections to store up to 20 instances of the Person class and its subclasses. Then write a GUI that displays the Person names using radio buttons to select a name. When selected a TextArea of the GUI should display the information about the selected Person.

    2. Your program should compile and run without errors.

    Learn More
  4. Travel Agents System Java Program

    Travel Agents System Java Program

    Regular Price: $30.00

    Special Price: $25.00

    Travel Agents System Java Program


    You are to develop program in Java for a small travel agents. The company arranges holidays from four UK airports to five international destinations. Users need to find flight times and costs for journeys between these destinations. The system also provides information on hotels at the destinations (name of hotel and cost per person per night). Information on hotels can only be added, or loaded from file, when the program is running. The following table (Table 1) provides the airport names, destinations, costs and flight times for the journeys Table 1 Information for the travel agents program – the two values represent cost (£) and flight time (hours) respectively – you can make up your own (realistic values) if you wish


    Airport/Destination | New York |Dahab | Rome |Sydney |Tokyo
    East Midlands |200/5.0 |150/4.0 |100/1.0 |500/22.0 |400/12.0
    Birmingham |190/4.8 |140/3.5 |95/1.1 |480/22.5 |380/12.5
    Heathrow |195/4.9 |140/3.6 |95/1.1 |490/23.0 |390/12.5
    Manchester |210/5.5 |145/3.7 |110/1.2 |470/22.7 |370/12.6


    (the above is a data table, where there is a line, represents the cell)


    Your program should have a main menu with four options – Time, Price, Hotels and End (which terminates the program). The Hotels option takes the user to another (Hotel) menu with the following six options – View Hotels; Add Hotel; Delete Hotel; Save Hotels; Retrieve Hotels; Exit (back to the previous menu). Note that your program should include appropriate error trapping – for example, entering an invalid date (eg 30 February).
    Functionality for each of these menu options is explained below:
    Time – Provides the flight time presented in hours.
    Price – The cost of travelling from an airport to a given destination (both selected by the user). Note, if the customer is travelling on the last day of the month the fare should be increased by 5% (and display a message to say that this has been done). The system will therefore need to ask the user the date of travel. It should not simply ask the user if it is the end of the month – but work this out from a date provided by the user.
    Hotels – Takes the user to a Hotels Information Menu.
    Hotels menu
    View Hotels – The user selects a destination and the system displays all available hotels at that destination including the overnight cost per person. If there are no hotels for a destination it should display a message to say so.
    Add Hotel – Allows the user to add a hotel for a given destination. This should add to the list of existing hotels for that destination (if there are any). For example, I might add 'Belle Vue' as a hotel in Sydney at a cost of £50 per person per night.
    Delete Hotel – Allows the user to delete a hotel from a list of hotels at a destination.
    Save Hotels – save all the information on all hotels to a single file in a format of your choosing.
    Retrieve Hotels – read in all the information on hotels from a user selected file (a file saved using the previous option). This should overwrite any existing hotel data in the program when it is running.


    Marking
    The more functionality you add to the program the higher your mark. Begin by getting the menu options in place then add functionality to your program in the following order (make sure that earlier parts of the system are working properly before moving on). Your program should also be structured in an object oriented way. You should try to identify and implement a number of classes for this program.


    Minimum pass (40%)
    The flight time between any airport and destination;
    The cost of travel between any airport and destination;
    Increased cost of travel on the last day of the month and a message to say this has been applied;


    40%-70%
    View hotels – users can view information on all hotels at a chosen destination; Add hotel – the ability for users to add hotels for a destination;
    Sort hotels – users can sort all hotels alphabetically;


    Documentation
    Your coursework should be submitted with appropriate documentation. You should include class diagrams, designs, functionality not completed, functionality working, test plans, evaluation, and program listings. Make sure you include an explanation of how your code should be run (eg. which file should be compiled and run and anything I need to know about using the program – a user guide).

    Learn More
  5. Tracking Contributors Linked List Java Program

    Tracking Contributors Linked List Java Program

    Regular Price: $15.00

    Special Price: $12.00

    Tracking Contributors Linked List Java Program


    Your first task in developing the application for tracking contributors is to load a list of the people who are helping the cause. Design and develop a linked list, implemented as a stack, to track all of the contributors. You will read the contributor information from a file provided; it is a comma delimited (CSV) file. 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 Push constructor to implement the stack)
    • Print constructor: //to print out the contributor data
    • Pop constructor
    • Push constructor


    Deliverables:
    • A fully documented program to load the data implemented as a stack
    • A test plan to show how the program runs and can be executed
    • A screenshot showing that the program loaded the data, and after all data is loaded, perform a single pop of the stack

    Learn More
  6. BMIS 212 Week 4 Programming Assignment Exercise 6.35 Computer-Assisted Instruction

    BMIS 212 Week 4 Programming Assignment

    Regular Price: $15.00

    Special Price: $12.00

    BMIS 212 Week 4 Programming Assignment


    Exercise 6.16 (Multiples) Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take 2 integer arguments and return true if the second is a multiple of the first and false otherwise.[Hint: Use the remainder operator]. Incorporate this method into an application that inputs a series of pairs of integers (1 pair at a time) and determines whether the second value in each pair is a multiple of the first.


    Exercise 6.20 (Circle Area) Write an application that prompts the user for the radius of a circle and uses a method called circleArea to calculate the area of the circle.


    Exercise 6.35 (Computer-Assisted Instruction) The use of computers in education is referred to as computer assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a Random object to produce 2 positive 1-digit integers. The program should then prompt the user with a question, such as "How much is 6 times 7?"


    The student then inputs the answer. Next, the program checks the student’s answer. If it's correct, display the message "Very Good!" and ask another multiple question. If the answer is wrong, display the message "No. Please try again." And let the student try the same question repeatedly until the student finally gets it right. A separate method should be used to generate each new question. This method should be called once when the application begins execution and each time the user answers the question correctly.

    Learn More
  7. BMIS 212 Week 5 Programming Assignment Variable-Length Argument List

    BMIS 212 Week 5 Programming Assignment

    Regular Price: $15.00

    Special Price: $12.00

    BMIS 212 Week 5 Programming Assignment

    Exercise 7.14 (Variable-Length Argument List) Write an application that calculates the product of a series of integers that are passed to method product using a variable-length argument list. Test your method with several calls, each with a different number of arguments.

    Exercise 7.19 (Airline Reservations System) A small airline has just purchased a computer for its new automated reservations system. You've been asked to develop the new system. You're to write an application to assign seats on each flight of the airline's only plane (capacity: 10 seats).
    Your application should display the following alternatives: "Please type 1 for First Class" and "Please type 2 for Economy." If the user types 1, your application should assign a seat in the first class section (seats 1–5). If the user types 2, your application should assign a seat in the economy section (seats 6–10). You application should then display a boarding pass indicating the person's seat number and whether it's in the firstclass or economy section of the plane.
    Use a 1 dimensional array of primitive type Boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available.
    Your application should never assign a seat that has already been assigned. When the economy section is full, your application should ask the person if it's acceptable to be placed in the first class section (and vice versa). If yes, make the appropriate seat assignments. If no, display the message "Next flight leaves in 3 hours."

    Exercise 8.4 (Rectangle Class) Create a class Rectangle with attributes length and width, each of which defaults to 1. Provide methods that calculate the rectangle's perimeter and area. It has set and get methods for both length and width. The set methods should verify that length and width are each floating-point numbers larger than 0.0 and less than 20.0. Write a program to test class Rectangle.

    Learn More
  8. BMIS 212 Week 7 Programming Assignment Catching Exceptions Using Class Exception

    BMIS 212 Week 7 Programming Assignment

    Regular Price: $15.00

    Special Price: $12.00

    BMIS 212 Week 7 Programming Assignment


    Exercise 11.9 (Order of catch Blocks) Write a program that shows that the order of catch blocks is important. If you try to catch a superclass exception type before a subclass type, the compiler should generate errors.


    Exercise 11.17 (Catching Exceptions with Superclasses) Use inheritance to create an exception superclass (called ExceptionA) and exception subclasses ExceptionB and ExceptionC, where ExceptionB inherits from ExceptionA and ExceptionC inherits from ExceptionB. Write a program to demonstrate that the catch block for type A ExceptionA catches exceptions of types ExceptionB and Exception C.


    Exercise 11.18 (Catching Exceptions Using Class Exception) Write a program that demonstrates how various exceptions are caught with Catch
    (Exception exception).
    This time define classes ExceptionA (which inherits from class Exception) and ExceptionB (which inherits from class ExceptionA). In your program, create try blocks that throw exceptions of types ExeptionA, ExceptionB, NullPointerException and IO Exception. All exceptions should be caught with catch blocks specifying type Exception.

    Learn More
  9. CSC 275 Assignment 3 Flower Pack

    CSC 275 Assignment 3 Flower Pack

    Regular Price: $20.00

    Special Price: $15.00

    CSC 275 Assignment 3 Flower Pack


    After dinner with Alexander and Elizabeth we notice that Alexander is mixing some herbs as a medication for Elizabeth which eases her pain and helps her sleep. Once the medicine is administered we begin small talk with Alexander. During the conversation he tells us the story about how his mother and father were hopelessly in love and were lucky enough to die side by side protecting the things they loved most, their children.
    In the middle of the story we become distracted by Elizabeth trying to request something, but we can't make out what she wants because her medicine has kicked in. After a few moments we determine she is requesting a flower, but we can't understand the entire name, just the start. Instantly we remember that we know how to search through our flower pack while only using partial names. We instantly turn around and start working on yet another improvement to the flower pack.
    • Create a flower object that has specific traits (name, color, presence of thorns and smell)
    • These flower objects must be able to stay in his pack (Use an ArrayList)
    • Be able to add and remove flowers
    • Implement a partial search (Searching for 'r' should return all flowers with an 'r' in their name, and the same goes for any partial search). This is commonly known as a filter.


    As a new addition a rubric has been added to blackboard for the assignment.
    Using the same code as assignment 2 you can make your changes. I have included some base code for your convenience (This is 2 classes, Assignment3 and Flower).

    Learn More
  10. CIS355A Week 5 iLab 5 Step 1 Write Clients to File

    CIS355A Week 5 iLab GUI Graphics and File I/O

    Regular Price: $25.00

    Special Price: $20.00

    CIS355A Week 5 iLab GUI Graphics and File I/O


    Scenario/Summary
    In this lab, you will create one project that reads from a file, one project that writes to a file, and one project drawing a snowman.


    iLAB STEPS
    STEP 1: Writing out Client Information
    1) Create the following GUI, so that when your program is running, your user can input information regarding a client and hit the save button to save the information out to a file.
    2) Every time the user hits the save button, that information should be saved out to a file called client.txt; each new client's information should append to the information already saved onto the file client.txt.
    3) The data in the client.txt file should be formatted like the following.
    Client Activity Report
    Client Name Client ID Starting Balance Closing Balance
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99

    STEP 2: Reading in Client Information
    1) Create a class called Client, the Client class must contain attributes for Client name, Client ID, starting balance, and closing balance, and all other accessor/mutator/constructor functions as necessary.
    2) Assume you have a client.txt file with the following sample information.
    Charles Smith|100235|5700.75|1200.00
    James Peterson|320056|349.56|4005.56
    Francis Lewis|400556|7500.00|456.23
    William Burgess|45399|5000.00|1245.56
    Philip Wilson|10090|10000.00|2300.75
    James Brown|34291|25000.45|31454.86
    3) Create a Client ArrayList to process input records in main().
    4) Use a for loop to read in the information from client.txt.
    5) The GUI to this program should look similar to this:
    6) Once the user hits the display button, everything read in from the file should display in the Console window in this format.
    Client Activity Report
    Client Name Client ID Starting Balance Closing Balance
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99
    XXXXXXXXX 9999999 99999.99 99999.99


    STEP 3: Snowman!
    Use the many draw methods provided to you by Java and draw a Snowman—be as creative or as basic as you would like, as long as the final result resembles a snowman. It doesn't have to necessarily look exactly like this, but this is the minimum you should achieve with your drawing.
    1) You must have at least three circles in your project.
    2) You must have at least a line, a polygon, an oval, or a rectangle.
    3) In addition to your snowman, you should also use drawString to draw some text.
    4) Use draw or fill and the color class as you see fit.
    Hint: frame.getContentPane().setBackground(Color.blue); //This is the code you need to set the frame's background color. Have Fun!

    Learn More

Items 21 to 30 of 109 total

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

Grid  List 

Set Ascending Direction