Welcome to AssignmentCache!

Search results for 'ITS'

Items 31 to 40 of 218 total

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

Grid  List 

Set Descending Direction
  1. CIS355A iLab 3 Step 1 Cylinder Java Programs

    CIS355A iLab 3 Cylinder and Date Java Programs

    $15.00

    CIS355A iLab 3 Cylinder and Date Java Programs

    In This lab you will create two programs that use classes and methods.

    Deliverables
    Program files for each of the following two programs
    1. Cylinder
    2. Date

    iLAB STEPS
    STEP 1: Cylinder
    Create a class called Cylinder.java that contains two double-precision instance variables named radius and height. The class should include a constructor that initializes the radius and height variables. Also, you need a class method named volume() that returns the volume of a Cylinder object. The volume of a cylinder is given by its radius squared times its height times Pi (radius * radius * height * Math.PI). You can either use the value 3.1416 for Pi or use the Java provided value named Math.PI.
    Write a class called CylinderTest.java and declare an array of three Cylinder objects to call the methods you declared in the Cylinder class. Make sure that all class methods are called from main(). Have main() display the value returned by volume() and verify the returned value by hand calculations (paper/pencil). Prompt the user to enter the values for the radius and height of each Cylinder object in the array.


    STEP 2: Date (20 points)
    Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.
    Write a program called DateTest.java that prompts the user to enter the month, day, and year as numeric values. This program then creates a Date object using the Date class you just created and tests the nextDay() method. This can be done in a loop of 40 iterations: the Date object calls the nextDay() method and prints the date during each iteration of the loop. This loop is to illustrate that the nextDay() method works correctly. Test the following cases:
    a. Incrementing into the next month, for example, use date: 02/28/2011
    b. Incrementing into the next year, for example, use date: 11/27/2011
    c. Incrementing into the next month in a leap year, for example, use date: 02/28/2012
    Sample Program Output:
    Checking increment
    Date object constructor for date 11/27/2011
    Incremented Date:11/28/2011
    Incremented Date:11/29/2011
    Incremented Date:11/30/2011
    Day 31 invalid. Set to day 1.
    Incremented Date:12/1/2011
    Incremented Date:12/2/2011
    ...
    Incremented Date:12/30/2011
    Incremented Date:12/31/2011
    Day 32 invalid. Set to day 1.
    Incremented Date:1/1/2012
    Incremented Date:1/2/2012
    Incremented Date:1/3/2012
    Incremented Date:1/4/2012
    Incremented Date:1/5/2012
    Incremented Date:1/6/2012

    Learn More
  2. LastWord Java Program

    LastWord Java Program

    $5.00

    LastWord Java Program

    1 LastWord.java
    You will write a Java program with the file name LastWord.java. The purpose of this program is to scan through a file and find in the file:
    1. The word that is closest to the beginning of the dictionary
    2. The word that is closest to the end of the dictionary
    3. The longest word
    For the purpose of this program, a word is defined as a string of characters delimited by whitespace that starts with a letter and ends with a letter. If a string of character delimited by whitespace that starts with one or more non-letters, they should be trimmed until the first character is a letter. Same should be done to the trailing non-letters. For example, the string of character “quote” should be trimmed to quote, --dash-- should be trimmed to dash. The non-letter enclosed by letters should be left alone. This definition of a word may make your English teachers cringe, but will be much easier to implement.
    The lexicographical order of the words can be determined simply by using the compareToIgnoreCase() method of String class.
    The input file name should be entered by a JOptionPane input dialog box.
    2 Suggested Procedure
    1. Start the program by popping up an input dialog box to ask user for a file name.
    2. Instantiate a FileReader using the file name wrapped in a BufferedReader.
    3. nstantiate a FileWriter wrapped in a BufferedWriter.  The output file name may be hardcoded.
    4. Test the program by reading the input file and write the input to the output file. Compare the input file and output file.
    5. Instantiate a Scanner that scans the BufferedReader. By default the Scanner delimits the tokens by whitespaces. Write the scanned tokens, one per line, to the output file. Exam the output file.
    6. Write a new public class named WordSmith.  Create a static method trim() to remove the non-letters around the words. Test WordSmith.trim() until you are satisfied.
    7. Back to LastWord, between Scanner output and write to output, insert a call to WordSmith.trim(). Create a test file with all the possible scenarios you can think of.  It will be more effective if you write out the word before and after trim() is called side-by-side on the same line.
    8. Consider sharing your test file at DocSharing.
    9. Add the code to LastWord to find the first word, last word, and the longest word.
    10. Use JOptionPane.showMessageDialog() to display the results. Show the file name used in the title of the dialog box.

    Deliverables
    Source file(s): LastWord.java and WordSmith.java

    Learn More
  3. Greatest Common Divisor GCD using euclidean algorithm Java Program

    Greatest Common Divisor GCD using euclidean algorithm Java Program

    $5.00

    Greatest Common Divisor GCD using euclidean algorithm Java Program

    This program will calculate the greatest common divisor of two positive integers using euclidean algorithm. in its simplest form, Euclid's algorithm starts with at pair of positive integers and forms a new pair that consists of the smaller number and the difference between the larger and smaller umbers. the process repeats until the numbers are equal. That number then is the greatest common divisor of the original pair. for example,to calculate the GCD of 49 and 35 the GCD of 49 and 35 is 7. Program input and output should use JOption. the validity of the inputs shall be checked and user error messages are displayed.

    Learn More
  4. Find and print out all the palindromes in a file Java Program

    Find and print out all the palindromes in a file Java Program

    $20.00

    Find and print out all the palindromes in a file Java Program

    Find and print out all the palindromes in a file, ignoring any strings with numbers in them, and printing them out in alphabetical order. Your program should:
    1. Open the file, dealing with possible exceptions
    If there is no file name given, print "insufficient arguments given"
    If there is no file, print "file not found"

    2. Read the file word by word, where words are any strings of characters separated by whitespace. For example "ghoud3421" is a word, but as it contains digits you would not test to see if it is a palindrome.

    3. For each word, use a separate method to see if it contains digits, and if it does not, check using another method whether it is a palindrome.

    4. Collect all the palindromes, including duplicates.

    5. Print out all the palindromes in alphabetical order.

    A palindrome is a word whose meaning may be interpreted the same way in either forward or reverse direction. e.g. dad, tattarrattat, abccba, abbba, aba.
    Learning Outcomes

    File I/O
    String manipulation
    Using the Java Collections

    Sample Input/Output
    Case A
    Input: java PalindromeCounter
    Output: insufficient arguments given

    Case B
    Input: java PalindromeCounter nofile
    Output: file not found

    Case C
    Input: java PalindromeCounter file1.txt
    file1.txt:
    abcd a1a aa1 a
    ccc
    a !#! z#z %1%
    haah Zaz

    Output:
    !#!
    a
    a
    ccc
    haah
    z#z

    Skeleton Code
    textpop-up
    public classPalindromeCounter {
    public static void main(String[] args) {
    // TODO fill in this method
    }
    protected static boolean isValidWord(Stringword) {
    // TODO fill in this method
    }
    protected static boolean isPalindrome(Stringword) {
    // TODO fill in this method
    }
    }

    Learn More
  5. COP3804 Assignment 4 Infix to Postfix

    COP3804 Assignment 4 Infix to Postfix

    $15.00

    COP3804 Assignment 4 Infix to Postfix

    The concept of stack is extremely important in computer science and is used in a wide variety of problems. This assignment requires you to write a program that can be used to evaluate ordinary arithmetic expressions that contains any of the five arithmetic operators (+, -, *, /, %).

    This exercise requires three distinct steps, namely:
    1. Verify that the infix arithmetic expression (the original expression), that may contain regular parentheses, is properly formed as far as parentheses are concerned.
    2. If the parenthesized expression is properly formed, convert the expression from an infix expression to its equivalent postfix expression, called Reverse Polish Notation (RPN) named after the Polish Mathematician J. Lukasiewics.
    3. Evaluate the postfix expression, and print the result.

    Step 1 - Verify that the expression
    Given an arithmetic expression, called an infixed expression, to verify that it is properly formed as far as parentheses are concerned, do the following:
    • Create an empty stack to hold left parenthesis ONLY.
    • Scanned the arithmetic expression from left to right, one character at a time.
    • While there are more characters in the arithmetic expression
    {
    If the character is a left parenthesis ‘(‘, push it on to the stack. However if the character is a right parenthesis, ‘)’, visit the stack and pop the top element from off the stack.
    }
    • If the stack contains any element at the end of reading the arithmetic expression, then the expression was not properly formed.

    Step 2 - Convert infixed expression to postfix
    Given that an arithmetic expression is properly form with respect to parentheses, do the following:
    • Create an empty stack to hold any arithmetic operators and left parenthesis, ONLY.
    • A string to contain the postfix expression – the output from this conversion.
    • Scan the arithmetic expression from left to right.
    • While the are more symbols in the arithmetic expression,
    {
    After a symbol is scanned, there are four (4) basic rules to observed and apply accordingly:
    1. If the symbol is an operand (a number), write it to the output string.
    2. If the symbol is an operator and if the stack is empty, push the symbol on the stack.
    Otherwise, if the symbol is either ‘(‘ or ‘)’, check for the following conditions:
    If the symbol is ‘(‘, push on to the stack,
    Otherwise
    If the symbol is ‘)’
    {
    Pop everything from the operator stack down to the first ‘(‘. Write each item
    popped from the stack to the output string. Do not write the item ‘)’. Discard it.
    }
    3. If the symbol scanned is an arithmetic operator, check for the following and apply accordingly:
    If the operator on the top of the stack has higher or equal precedence, that operator is popped from off the stack, and is written to the to the output string. This process is continues until one of two things happen:
    (a) Either the first ‘(‘ is encountered. When this occurs, the ‘(‘ is removed from the stack and is discarded, and the recently scanned symbol is placed on the stack
    OR
    (b) The operator on the stack has lower precedence than the one just scanned. When this situation arises, the recently scanned symbol is pushed onto the stack.
    }
    4. After the arithmetic expression is exhausted, any operator is remaining on the stack must be popped from off and is written to the output string.

    Step 3 - Evaluate the post fixed expression
    Initialize an empty stack.
    While there are more symbols in the postfix string
    {
    ? If the token is an operand, push it onto the stack.
    ? If the token is an operator
    {
    Pop the two topmost values from the stack, and store them in the order t1, the topmost, and t2 the second value.
    Calculate the partial result in the following order t2 operator t1
    Push the result of this calculation onto the stack.
    NOTE: If the stack does not have two operands, a malformed postfix expression has occurred, and evaluation should be terminated.
    }
    }
    When the end of the input string is encountered, the result of the expression is popped from the stack.
    NOTE: If the stack is empty or if it has more than one operand remaining, the result is unreliable.

    Extend this algorithm to include square brackets and curly braces. For example, expressions of the following kind should be considered
    2 + { 2 * ( 10 – 4 ) / [ { 4 * 2 / ( 3 + 4) } + 2 ] – 9 }
    2 + } 2 * ( 10 – 4 ) / [ { 4 * 2 / ( 3 + 4) } + 2 ] – 9 {

    Implement the above two algorithms for the following binary operators: addition +, subtraction -, multiplication *, division /, and modulus operation %. All operations are integer operations. To keep things simple, place at least one blank space between each token in the input string.

    Use the following code below as your Main Test class:
    class RPN
    {
    public static void main(String[] arg)
    {
    String s[] = {"5 + ) * ( 2",
    " ( { [ } ) ] ",
    " 2 + ] - 3 * 5 [ ",
    "[( 2 + 3 ) * 5] * 8 ",
    "5 * 10 + ( 15 - 20 ) ) - 25",
    "5 * { 10 + ( 15 - 20 ) } - 25",
    " 5 + [ 5 * { 10 + ( 15 - 20 ) } - 25 ] * 9"
    };
    for (int i = 0; i < s.length; i++)
    {

    Arithmetic a = new Arithmetic(s[i]);
    if (a.isBalance())
    {
    System.out.println("Expression " + s[i] + " is balanced\n");
    a.postfixExpression();
    System.out.println("The post fixed expression is " + a.getPostfix());
    a.evaluateRPN();
    System.out.println("The result is : " + a.getResult() + "\n" );
    }
    else
    System.out.println("Expression is not balanced\n");
    }
    }
    }

    Learn More
  6. ITS 320 Program 3 Exercise 5.17 Java

    ITS 320 Assignment 3 Decision Control and Loops with User Interaction

    $15.00

    ITS 320 Assignment 3 Decision Control and Loops with User Interaction

    1) Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (this is two separate prompts for input values). You must use a switch statement and a sentinel – controlled loop (i.e. a loop that stops execution when an out of range value, such as -1, is input). All 15 items below are for a single purchase. There are five sets of inputs as follows:
    Product 1 1 unit (cost is $2.98 per unit)
    Product 2 2 units (cost is $4.50 per unit)
    Product 3 3 units (cost is $9.98 per unit
    Product 4 4 units (cost is $4.49 per unit)
    Product 5 5 units (cost is $6.87 per unit)
    Your application must calculate and display the total retail value of all products sold, after all 5 pairs of inputs are completed. You must also display the total after each new pair of input values is entered. (This program was taken from Exercise 5.17 on page 228 of Deitel & Deitel's "Java How to Program (Sixth Edition)" (2005 by Pearson Publishing Co.))

    2) You may use the Windows Command Prompt command line interface or any Java IDE you choose to compile and execute your program.

    3) You are to submit the following deliverables to the Assignment Dropbox in a single Microsoft Word file:
    A screen snapshot of your Java source code (just the beginning is OK) as it appears in your IDE (e.g. jGRASP, Net Beans, Eclipse, etc.) or editor (e.g. a Windows Command Prompt DOS "more" of the .java file's first screen).
    A listing of your entire Java source code in the same Microsoft Word file as item a), and following item a). You can simply copy and paste the text from your IDE into Word. Be sure to maintain proper code alignment by using Courier font for this item.
    A screen snapshot of your program’s input and output in the same Microsoft Word file, and following item b). You must include screen snapshots of all inputs and all outputs,not just a sample.

    4) Your instructor may compile and run your program to verify that it compiles and executes properly.

    5) You will be evaluated on (in order of importance):
    Inclusion of all deliverables in Step #3.
    Correct execution of your program.
    Adequate commenting of your code.
    Good programming style (as specified in the textbook's examples).
    Neatness in packaging and labeling of your deliverables

    Learn More
  7. ITS 320 Assignment 4 Line Separator Java Program

    ITS 320 Assignment 4 Separate lines Java Program

    $15.00

    ITS 320 Assignment 4 Separate lines Java Program

    1. Write a program to assign the integer values 1 through 25 to a 25 element integer array. Then, print the array as five separate lines each containing five elements separated by commas. The last element on each line should be followed by a newline instead of a comma. The output of your program should appear exactly as follows:
    1,2,3,4,5
    6,7,8,9,10
    11,12,13,14,15
    16,17,18,19,20
    21,22,23,24,25

    Hints:
    One way to determine every 5th element is to use the modules operator (%). If you divide the subscript by 5 and the remainder is 0, it is the 5th number.
    You can use System.out.print() to print a value without a newline following it. This will allow you to print multiple things on the same line.
    You may use the Windows Command Prompt command line interface or any Java IDE you choose to compile and execute your program.

    Learn More
  8. ITS 320 Assignment 5 Phone subclass Java Program

    ITS 320 Assignment 5 Inheritance and Polymorphism Java Program

    $15.00

    ITS 320 Assignment 5 Inheritance and Polymorphism Java Program

    Key in the PolyMain, Book, Almanac, and Novel classes defined in this module of the course. Once you get each of these classes keyed in, make sure they compile and execute properly. Then create a third subclass called Phone that also extends the Book class. The Phone class should keep track of the number of yellow pages and the number of white pages in each phone book. Make sure the Phone subclass you create has a print method having the same signature as the print method in the Book class. The print method from the Phone class should print the title of the book, followed by the number of yellow pages and white pages contained within the phone book. Thus, the print method should have the following signature:
    public void print();

    The Phone class should also have a constructor having the following signature:

    public Phone(String title, int whitePages, int yellowPages);

    This constructor should sum up whitePages + yellowPages to get the total number of pages in the book. Remember the total pages in the book and the title of the book are set in the constructor for the Book class.

    Modify the PolyMain class to create at least one of your phone books and store it in the library. You should now be able to print the library without having to modify the print method defined within the PolyMain class.

    Learn More
  9. ITS320 Assignment 6 BadDataException Java Program

    ITS320 Assignment 6 BadDataException Java Program

    $15.00

    ITS320 Assignment 6 BadDataException Java Program

    Create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException. Both NumberHighException and NumberLowException should be directly subclassed from the Exception class, but NumberNegativeException should be subclassed from NumberLowException. You can use the BadDataException class that was defined in this module as the model for your exception classes.

    Next create a class called Verify that will be used to validate that a number is within a specified range. It should have one constructor that has 2 int parameters. The 1st parameter is the minimum number in the range, and the 2nd parameter is the maximum number in the range.

    In addition to the constructor, the Verify class should have one method that is named validate. The validate method will have a single parameter of data type int. The parameter contains the number that is being validated. If the value of the parameter is less than zero, the method should throw a NumberNegativeException. If the value is less than the minimum value of the range, it should throw a NumberLowException. If the value is greater than the maximum value of the range, it should throw a NumberHighException. If the value is within the specified range, no exception should be thrown.

    Once all of these classes are created, create the driver class called Program5. The driver class should instantiate a Verify object with a range of 10 to 100. It should then do the following:
    Prompt the user to input a number within the specified range.
    Use a Scanner to read the user input as an int. You can ensure that an int was entered because the nextInt method in the validate class throws an InputMismatchException if any non digits are entered.
    Call the validate method to validate that the number is within the range.
    Print an appropriate error message if the value is not within the range, or print the value if it is within the range.

    BadDataException class

    public class BadDataException extends Exception
    {
    // creates exception object with no message
    // null message in superclass
    public BadDataException()
    { }

    // str used for exception message
    // explicitly invokes superclass constructor
    public BadDataException(String str)
    {
    super(str);
    }

    public String toString()
    {
    return "BadDataException";
    }
    }

    Learn More
  10. Microsoft Access 2010 Chapter 4 Lab 1 Customer Balance Report

    Microsoft Access 2010 Chapter 4 Lab 1 Presenting Data in the ECO Clothesline Database

    $20.00

    Microsoft Access 2010 Chapter 4 Lab 1 Presenting Data in the ECO Clothesline Database

    Problem: The management of ECO Clothesline already has realized the benefits from the database of customers and sales reps that you created. The management now would like to prepare reports and forms for the database.

    Instructions: If you are using the Microsoft Access 2010 Complete or the Microsoft Access 2010 Comprehensive text, open the ECO Clothesline database that you used in Chapter 3. Otherwise, see your instructor for information on accessing the files required in this book.

    Perform the following tasks:
    1. Open in Layout view the Customer Balance Report you created in Chapter 1 and revised in Chapter 3. Modify the report to create the report shown in Figure 4–81. Group the report by Customer Type and sort by Customer Number within Customer Type. Add the Amount Paid field to the report and include totals for the Balance and Amount Paid fields.

    2. Create the Customers by Sales Rep report shown in Figure 4–82. Include a total for the Balance field. Change the orientation to landscape. Make sure the total control displays completely. (Hint: Use Layout view to make this adjustment.)

    3. Create the Customer Financial Form shown in Figure 4–83. The form includes the date.

    4. Create mailing labels for the Customer table. Use Avery labels C2163 and format the labels with customer name on the first line, street on the second line, and city, state, and postal code on the third line. Include a comma and a space after city and a space between state and postal code. Sort the labels by postal code.

    5. Submit the revised database in the format specified by your instructor.

    Learn More

Items 31 to 40 of 218 total

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

Grid  List 

Set Descending Direction
[profiler]
Memory usage: real: 14942208, emalloc: 14627352
Code ProfilerTimeCntEmallocRealMem