Welcome to AssignmentCache!

Search results for 'My'

Items 1 to 10 of 26 total

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

Grid  List 

Set Descending Direction
  1. CIS355A iLab 5 GuessGame Java Programs

    CIS355A iLab 5 GuessGame and Text File I/O Java Programs

    $15.00

    CIS355A iLab 5 GuessGame and Text File I/O Java Programs

    In this lab you will create a single program that creates and reads a sequential file. All outputs must be GUI-based without using JOptionPane.

    Deliverables
    Program files for each of the following two programs
    1. GuessGame
    2. Text File I/O

    iLAB STEPS
    STEP 1: GuessGame
    Write a program named GuessGame.java that plays the game “guess the number” as follows: Your program chooses the number to be guessed by selecting an integer at random in the range 1–1000. The program then displays the following in a label.
    I have a number between 1 and 1000 -- can you guess my number?
    Please enter your guess: ____________________
    A JTextField should be used to input the guess. A JButton must be provided to allow the user to press each time a guess is entered. As each guess is input, the background color should change to either red or blue. Red indicates that the user is getting warmer, and blue indicates that the user is getting colder. A JLabel should display either Too High or Too Low to help the user zero in on the correct answer. When the user gets the correct answer, Correct! should be displayed, and the JTextField used for input should be cleared and changed to be uneditable. Also, a JButton should be provided to allow the user to play the game again. When the New Game JButton is clicked, a new random number should be generated and the input JTextField changed to be editable. A JButton must be provided to allow the user to exit the application. Also provide a count of the number of guesses the user entered when the correct number is guessed.

    STEP 2: Text File I/O (20 points)
    Write a program called TextFileIO.java to create a file named numbers.dat. Then create an algorithm that writes all even numbered integers from 1 to 100, separated by a comma. After the file has been created, close and reopen the file and display the results to the screen. After the results have been displayed append the odd number integers from 1 to 100, separated by a comma to the end of the file. Reopen the file and display the results. The contents of the file should be the even numbers from 1 to 100 separated by a comma followed by the odd number from 1 to 100 separated by a comma. The output of this program would be something like the following
    2,4,6,8,10,12,14,……,98,100
    2,4,6,8,10,12,14,……,98,100,1,3,5,7,9,……..97,99

    Learn More
  2. CMIS 141 Project 3 Stringed Musical Instrument Java Class

    CMIS 141 Project 3 Stringed Musical Instrument Java Class and UML class diagram

    $25.00

    CMIS 141 Project 3 Stringed Musical Instrument Java Class and UML class diagram

    This project focuses on demonstrating your understanding of classes and objects. 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. Design and implement a stringed musical instrument class using the following guidelines:
    a. Data fields for your instrument should include number of strings, an array of string names representing string names (e.g. E,A,D,G), and boolean fields to determine if the instrument is tuned, and if the instrument is currently playing. You are welcome to add additional data fields if you like.
    b. A constructor method that set the tuned and currently playing fields to false.
    c. Other methods 1) to tune the instrument, 2) to start the instrument playing, and 3) to stop the instrument from playing.
    d. Other methods as you see fit (Add at least one unique method).

    2. Create a UML class diagram using a diagram tool (e.g. PPT, Visio) of your choice. Prepare the diagrams and place them in a word document along with a brief description of each of your classes.

    3. Create Java classes for your instruments. Be sure that your code matches your design specifications and some minimal functionality is included. For example, if you called the violin.play() method, you should at least print that the violin is playing. Similar functionality should be supplied when you stop playing, tune or call any of your methods. For example:

    public void playviolin() {
    System.out.println("The violin is now playing.");
    }

    4. Write the output from your Instrument class methods to a text file that a user entered from the command line arguments (e.g. java Mynamep3tst myfilename.txt). This allows your program to accept filenames from the user via a command line argument.

    5. Finally, create a Java test class that simulates using your instrument class. In your test class be you should at a minimum: a) Construct 10 instances of your instrument, b) tune your instruments, c) Start playing your instrument, d) Call your unique method, and e) Stop playing your instruments. (Hint: Arrays and Loops will make your job easier and result in more efficient code!)

    6. Your programs should compile and run without errors.

    7. Be sure to test your program carefully. Provide a list of comprehensive test cases used to validate your application and include these test cases in your word document containing your UML diagrams and descriptions. Similar to Project 1, your test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test.

    Learn More
  3. Dreams Travel Agency Java GUI

    Dreams Travel Agency Java GUI Both parts

    $20.00

    Dreams Travel Agency Java GUI Both parts

    Field of Dreams Travel Agency has begun offering travel packages to baseball fans wanting to attend major league baseball games. The company offers a package allowing a fan to attend games in four cities of his or her choice, including transportation by car, tickets, lodging, and food. Assume that the fan lives in the city hosting one of the 30 major league baseball teams. The fan will travel from his or her home to the city of one of the teams of his choice, then will proceed to the city of one of the other teams and so on until all teams have been visited. Then, the fan will return home. Create a Java program that will compute the minimum cost of the trip. Your cost will be the cost of transportation (fuel cost per gallon/ miles per gallon * number of miles between ballparks), cost of tickets, cost of lodging, and cost of food. Ask the user his home city, which cities he wants to visit, the price of fuel, the fuel economy of his vehicle, the cost of lodging per day and the cost of food per day.  Your program will compute the costs of all 24 possible routings and choose the minimum cost route. Mark up the minimum cost by 20% to arrive at the cost that will be quoted to the customer.
    For this week, you need only to create the GUI using Java Swing and create the basic classes that will accept the inputs from the user. We will create the functionality of these classes in the second assignment.
    We will discuss strategies for preparing this program in the first week of class and you can create the program in the second week of class. That is done and I have a program with no function so here is the second part: Expand the model classes you created in the first assignment. Implement the functionality that will use the inputs offered by the user and prepare a quote for the customer according to the requirements specified in the first assignment. Upon clicking a Quote button on the GUI, the program should post a dialog box with the quote. Upon clicking the Print Quote button, write the quote out to a text file. This program was built on NETBEANS

    Learn More
  4. Game of Guessing Numbers Java Program

    Game of Guessing Numbers Java Program

    $5.00

    Game of Guessing Numbers Java Program

    In a game of guessing numbers, one person says "I am thinking of a number between 1 and 100". The second person guesses "50". The first person says "No it is less". The second person guesses "20". The first person says "No it is greater". This continues until the second person guesses the number. Write a program that plays this game. The computer knows the number (a random number between 1 and 100). The user (the second person) is the guesser. At the end of the program, the computer must displays the number of guesses it took the user to guess the number.
    The program must include:
    A main class
    A loop (for, while or do-while)
    An if or if – else statement
    Must accept input from the keyboard
    Must have a prompting statement
    A separate class with a constructor
    At least one method that performs an operation required by the main program

    HERE IS AN ALGORITHM, PLEASE MAKE IT AS SIMPLE AS YOU CAN AND STILL INCLUDE THE NECESSARY RULES.
    • Prompt
    • Generate a random number (1-100)
    Computer = gen random # (1-100)
    Do (input number (kb Reader)
    Stop = false;
    {
    If (myNum = computeNum
    Stop = true
    {
    (System.out.println(“You win!”);
    }
    Else
    If (myNum>computeNum)
    {
    System.out.println(“Your number is too high);
    }
    Else
    If (myNum<computeNum)
    {
    System.out.println(“Your number is too low”);
    }
    }

    Learn More
  5. Penn Foster Exam 40254500 Construction Company Java Program

    Penn Foster Exam 40254500 Construction Company Java Program

    $15.00

    Penn Foster Exam 40254500 Construction Company Java Program

    Write an application for a construction company to handle a customer's order to build a new home. Use separate ButtonGroups to allow the customer to select one of four models, the number of bedrooms, and a garage type. Assume that the models are the Aspen, $100,000; the Brittany, $120,000; the Colonial, $180,000; or the Dartmoor, $250,000. Assume that any model can have two, three, or four bedrooms and that each bedroom adds $10,500 to the base price. Assume that the garage type can be zero-, one-, two-, or three-car, and that each car adds $7,725 to the price. Save the file as JMyNewHome.java.

    Learn More
  6. ITS 320 Java Program 1 Compiled

    ITS 320 Java Program 1 Verify Java and IDE Setup

    $12.00

    ITS 320 Java Program 1 Verify Java and IDE Setup

    This simple exercise is meant to verify that you’ve properly installed Java SE and an IDE on your computer so that you are ready for the later programming assignments in this class.

    Type in the following program source code from Joyce Farrell’s 4th Edition Java textbook to your IDE. Then modify the comments for your name and the current date, and change the class file name to reflect your first name. Then compile your code.

    /**
    Program #1
    Function: Simple Java application to demonstrate the behavior of
    different data types, arithmetic, concatenation, and
    output of results.
    Programmed By: Reggie Haseltine, instructor (July 18, 2009)
    Code Taken From: "Java Programming (Fourth Edition" by Joyce Farrell,
    Figure 2-26, page 61
    */

    public class P1_Reggie {
    public static void main(String[] args) {
    int oneInt = 315;
    short oneShort = 23;
    long oneLong = 1234567876543L;
    int value1 = 43, value2 = 10, sum, difference, product, quotient, modulus;
    boolean isProgrammingFun = true;
    double doubNum1 = 2.3, doubNum2 = 14.8, doubResult
    char myGrade = 'A', myFriendsGrade = 'C';
    System.out.println("Our grades are " + myGrade + " and "
    + myFriendsGrade);
    doubResult = doubNum1 + doubNum2;
    System.out.println("The sum of the doubles is " + doubResult);
    doubResult = doubNum1 * doubNum2;
    System.out.println("The product of the doubles is " + doubResult);
    System.out.println("The value of isProgrammingFun is "
    + isProgrammingFun);
    System.out.println("The value of isProgrammingHard is "
    + isProgrammingFun);
    System.out.println("The int is " + oneInt);
    System.out.println("The short is " + oneShort);
    System.out.println("The long is " + oneLong);
    sum = value1 + value2;
    difference = value1 - value2;
    product = value1 * value2;
    quotient = value1 / value2;
    modulus = value1 % value2;
    System.out.println("Sum is " + sum);
    System.out.println("Difference is " + difference);
    System.out.println("Product is " + product);
    System.out.println("Quotient is " + quotient);
    System.out.println("Modulus is " + modulus);
    System.out.println("\nThis is on one line\nThis on another");
    System.out.println("This shows\thow\ttabs\twork");
    }
    // end method main
    }

    Then execute the .class file and verify that you get the following output.

    Learn More
  7. Flower Pack Java Assignment 1

    CSC 275 Flower Pack Java Assignment 1

    $12.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
  8. 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
  9. CIS355A Week 4 Course Project Flooring Application Analysis and Design

    CIS355A Week 4 Course Project Flooring Application Analysis and Design

    Regular Price: $20.00

    Special Price $15.00

    CIS355A Week 4 Course Project Flooring Application Analysis and Design

    Developing a graphical user interface in programming is paramount to being successful in the business industry. This project incorporates GUI techniques with other tools that you have learned about in this class.
    Here is your assignment: You work for a flooring company. They have asked you to be a part of their team because they need a computer programmer, analyst, and designer to aid them in tracking customer orders. Your skills will be needed in creating a GUI program that calculates the flooring cost and stores the order in the database.
    The project has three components: an analysis and design document, the project code, and a user manual. The analysis and design document is due Week 4. The code and user manual are due in Week 7. It is suggested that you begin working on the code in Week 5, which should give you ample time to complete the project. You will find that the lectures and lab assignments will prepare you for the Course Project.

    Guidelines
    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.

    Analysis and Design (Due Week 4)
    In Week 4, you will complete the analysis and design for the project. You will use the guidelines described above and the grading rubric below to complete this document. You will create the following items.
    1. Request for new application
    2. Problem analysis
    3. List and description of the requirements
    4. Interface storyboard or drawing
    5. Design flowchart or pseudocode
    The analysis and design document will be a single MS Word document, which contains all descriptions and drawings. See the grading rubric below for the analysis and design document, due in Week 4.
    Item Points Description
    Request for New Application 2.5 A table containing: date of the request, name of the requester (your professor), the purpose of the request, the title of the application (create your own title), and brief description of the algorithms used in the application
    Problem Analysis 2.5 Analyze the problem to be solved, and write in a few words what is the problem and what is being proposed to solve the problem
    List and Description of Requirements 5 A description of the items that will be implemented in order to construct the proposed solution
    Interface Storyboard or Drawing 5 A picture or drawing of what the application will look like; must include the image of each section of the application in detail
    Design Flowchart or Pseudocode 5 A sketch of the flow of the application or the pseudocode of the application

    Learn More
  10. CIS355A Week 6 iLab 6 Java Pizza Swing

    CIS355A Week 6 iLab Swing and Database Connection

    Regular Price: $25.00

    Special Price $20.00

    CIS355A Week 6 iLab Swing and Database Connection

    iLAB OVERVIEW
    Scenario/Summary
    Develop one application using JTabbedPanes and JFrames and another application that connects to a MySQL database.
    Deliverables
    1. JavaPizza
    2. ContactList

    iLAB STEPS
    Step 1: JavaPizza
    Develop an application using a JTabbedPane to order a pizza. You will need to ask the customer for their name and phone number. You will ask for the size (choose one) and toppings (choose many) and compute the total. After computing the total, provide a button to display the order summary, which includes the name, phone number, size, toppings, and total. The prices are listed below. Screenshots of a possible solution are included. Your application must include four tabs and open a new window when the button is clicked.
    • Small:  8.00
    • Medium: 10.00
    • Large: 12.00
    Each topping is 2.00 extra.
     
    JavaPizza    Points    Description
    Standard header included    1    Must contain program's name, student name, and description of the program
    Program compiles    1    Program does not have any error
    Program executes    1    Program runs without any error
    Created the JTabbedPane with four tabs    4    The JTabbedPane is displayed with the four required tabs and components on each tab
    Total is calculated correctly    5    The total on the last tab is calculated correctly based on information supplied.
    Order summary window displayed correctly    8    The order summary window is displayed with a JTextArea, including all information from the four tabs.
    Subtotal    20      
     
    Step 2: Contact List
    Develop a Java application to add a contact into the contact table, and display all contacts in the contact table. The contact table contains two columns, FullName, and PhoneNumber. Both values are text data. Use JOptionPanes to ask for the contact data, and display a confirmation message when the contact is added. Display the list of contacts in the console. Screenshots of a possible solution are included.
     
    ContactList    Points    Description
    Standard header included    1    Must contain program's name, student name, and description of the program
    Program compiles    1    Program does not have any error
    Program executes    1    Program runs without any error
    Created the JOptionPanes for input    6    Two JOptionPanes are displayed to retrieve input
    JOptionPane displayed upon insert    4    A JOptionPane is display to confirm the contact was added
    ContactList shown in console    7    The list of contacts is displayed in the console under a heading contact list .
    Subtotal    20

    Learn More

Items 1 to 10 of 26 total

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

Grid  List 

Set Descending Direction
[profiler]
Memory usage: real: 14417920, emalloc: 14269816
Code ProfilerTimeCntEmallocRealMem