Welcome to AssignmentCache!

Search results for '/**/sElEcT * /**/fRoM MM_MOVIE;'

Items 1 to 10 of 36 total

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

Grid  List 

Set Descending Direction
  1. CIS355A Week 1 STEP 2 Circle Java Program

    CIS355A iLab 1 ShowEscapeSequences Circle and PracticeArithmeticOperators Programs

    $15.00

    CIS355A iLab 1 ShowEscapeSequences Circle and PracticeArithmeticOperators Programs

    In this lab you will learn how to use the Java Software Development Kit (SDK) with the Eclipse programming tool. In addition, you will create three simple Java programs.

    Deliverables
    Program files for each of the following three programs.
    1. ShowEscapeSequences.java
    2. Circle.java
    3. PracticeArithmeticOperators.java
    At the beginning of ALL your programs, put a comment box that includes the program name, your name, and a brief description of the program.

    iLAB STEPS
    STEP 1: ShowEscapeSequences (10 points)
    Write a Java program named ShowEscapeSequences.java that displays the following.
    I really like
    CIS355A
              "Business Application Programming with Lab using JAVA"

    STEP 2: Circle (15 points)
    Write an application called Circle.java that inputs from the user the radius of a circle as an integer and prints the circle’s diameter, circumference, and area. Use the example program and GUI technique message dialog box shown in the Week 1 Lecture.
    Use the following formulas.
    diameter = 2 * radius
    circumference = 2 * Math.PI * radius
    area = Math.PI * radius * radius
    Use the predefined constant Math.PI for your calculation. This constant is more precise than the value 3.14159. Class Math is defined in the java.lang package so you do not need to import it.

    STEP 3: PracticeArithmeticOperators (15 points)
    Write an application called PracticeArithmeticOperators.java that asks the user to enter two numbers. The program is to convert these numbers from String to type int and then print in a tabular format the sum, the difference, the product, and the quotient of the two numbers entered. Use the example program shown in the Week 1 Lecture. For example, if the user enters 25 and 5, the following should be displayed.
    Operation Result
    25 + 5 30
    25 – 5 20
    25 * 5 125
    25 / 5 5

    Learn More
  2. CIS355A Week 2 Step 3 Diamond  Java Programs

    CIS355A iLab 2 Largest Palindrome and Diamond Programs

    $15.00

    CIS355A iLab 2 Largest Palindrome and Diamond Programs

    In this lab you will create programs that use control structures and user-defined methods.

    Deliverables
    Program files for each of the following three programs.
    1. Largest
    2. Palindrome
    3. Diamond
    At the beginning of ALL your programs, put a comment box that includes the program name, your name, and a brief description of the program.

    iLAB STEPS
    STEP 1: Largest (10 points)
    Write a Java application program called Largest.java that inputs a series of 10 single-digit numbers and determines and prints the largest of the numbers. Except main() method, no other user-defined method is required. Your program should use at least the following three variables
    1. counter: A counter to count to 10 (that is, to keep track of how many numbers have been input and to determine when all 10 numbers have been processed);
    2. number: The current digit input to the program; and
    3. largest: The largest number found so far.
    When each number is entered, make sure it is a single digit number, that is 0 to 9.

    STEP 2: Palindrome (15 points)
    A palindrome is a sequence of characters that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554, and 11611. Write an application called Palindrome.java that asks the user to enter in a five-digit integer and determines whether it is a palindrome. If the number is not five digits long, display an error message dialog indicating the problem to the user. When the user dismisses the error dialog, allow the user to enter a new value.
    Your program will have the following four methods
    1. main() method, which controls the execution of the program;
    2. retrieveInput() method, which prompts and retrieves the input values;
    3. check() method, which determines whether it is a palindrome; and
    4. display() method, which displays the result.

    STEP 3: Diamond (15 points)
    Write a program called Diamond.java that uses a method diamondOfAsterisks() that displays a diamond (the row number of a diamond must be odd) of asterisks whose row is specified in an integer parameter row. For example, if the user enters a 7, then the diamond will have seven rows and the method will display the pattern of asterisks. Below is an example of the diamond displayed when 7 is entered.
       *
      ***
     *****
    *******
     *****
      ***
       *

    Learn More
  3. 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
  4. CIS355A iLab 6 Step 1 index Java Program

    CIS355A iLab 6 Index Index2 and ThreeArrayLists Java Programs

    $15.00

    CIS355A iLab 6 Index Index2 and ThreeArrayLists Java Programs

    In this lab you will create three programs
    Index.java
    Index2.java
    ThreeArrayLists.java

    Program files for each of the following three programs
    Index
    Index2
    ThreeArrayLists

    iLAB STEPS
    STEP 1: Index (10 points)
    Write a Java GUI application called Index.java that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text. This program is not case sensitive and both upper and lower case must be counted for.
    Sample Program output: View Output Description

    STEP 2: Index2 (10 points)
    Write a Java GUI application Index2.java based on the program in Step 1 that inputs several lines of text and uses String method indexOf to determine the total number of occurrences of each letter of the alphabet in the text. Uppercase and lowercase letters should be counted together. Store the totals for each letter in an array, and print the values in tabular format after the totals have been determined.
    Sample Program output: View Output Description

    STEP 3: ThreeArrayLists (20 points)
    Write a program called ThreeArrayLists.java that declares three ArrayList objects referenced by the objects named priceList, quantityList, and amountList. Each ArrayList should be declared in main() and should be capable of holding a minimum of 10 double-precision numbers.
    • The numbers that should be stored in priceList are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98.
    • The numbers that should be stored in quantityList are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9 4.8.
    Your program should pass object references to these three ArrayList objects to a method named extend(), which should calculate the elements in the amountList ArrayList as the product of the corresponding elements in the priceList and quantityList ArrayList, for example, amountList.add(priceList.get(i) * quantityList.get(i)).
    After extend() has put values into the amountList ArrayList object, create a method that displays the results of all three lists. Appropriate formatting techniques need to be used to produce a formatted output.
    Tip: It is a good idea to create two arrays of type double to store the values that correspond to the price and the values that correspond to the quantity, for example:
    double[] PRICE_ARRAY = { 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98 };
    double[] QUANTITY_ARRAY = { 4.0, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, 4.8 };
    Sample program output:
    1) 10.62 * 4.0 = 42.48
    2) 14.89 * 8.5 = 126.56
    3) 13.21 * 6.0 = 79.26
    4) 16.55 * 7.35 = 121.64
    5) 18.62 * 9.0 = 167.58
    6) 9.47 * 15.3 = 144.89
    7) 6.58 * 3.0 = 19.74
    8) 18.32 * 5.4 = 98.93
    9) 12.15 * 2.9 = 35.24
    10) 3.98 * 4.8 = 19.1

    Learn More
  5. 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
  6. Stack to print the Prime Factors Java Program

    Stack to print the Prime Factors Java Program

    $5.00

    Stack to print the Prime Factors Java Program

    For a given integer n > 1, the smallest integer d > 1 that divides n is a prime factor. We can find the prime factorization of n if we find d and then replace n by the quotient of n divided by d, repeating this until n becomes 1.

    Write a Java program that uses a stack (in Arrays) to print the prime factors of a positive integer in descending order.

    For example, for n = 3960, the program should produce:
    11*5*3*3*2*2*2

    Learn More
  7. Stack to print numbers in other bases Java Program

    Stack to print numbers in other bases Java Program

    $5.00

    Stack to print numbers in other bases Java Program

    A stack can be used to print numbers in other bases (multibase output).
    Example:
    (Base8) 2810 = 3 * 81Â + 4 * 80 = 348
    (Base4) 7210 = 1 * 43 + 0 * 42 + 2 * 41 + 0 * 4 = 10204
    (Base2) 5310 = 1 * 25 + 1*24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 1101012

    Write a Java program using stacks (linked lists) that takes 3 non-negative (base 10) long integer numbers and a base B (B is in the range 2-9) and writes the number to the screen as a base B number. The program prompts the user for 3 numbers and bases, and then outputs them.
    Use as input:
    7210 Base 4
    5310 Base 2
    355310 Base 8

    Learn More
  8. Infix to Postfix expression Java Program

    Infix to Postfix expression Java Program

    $15.00

    Infix to Postfix expression Java Program

    Write a java program that converts an infix expression into an equivalent postfix expression.

    The rules to covert an infix expression to postfix expression are:
    Scan the expression from left to right in only one pass.
    If the next symbol is an operand, append it to the postfix expression.
    If the next symbol is a ‘(‘, push it onto the stack.
    If the next symbol is a ‘)’, pop and append all the symbols from the stack until the first ‘(‘ is found. Discard the ‘(‘
    If the next symbol is an operator:

    a. Pop and append to the postfix expression every operator from the stack that is above the most recently scanned ‘(‘ and that has precedence greater than or equal to the new operator.

    b. Push the new operator onto the stack.
    After the infix expression is completely processed, pop and append to the postfix string everything from the stack.

    In this program, you are to consider the following arithmetic operators: +, -, * and /. You may assume that the expressions you process are error free.
    Please check your program using the following:
    1. A + B – C
    2. (A + B) / (C – D)
    3. A + ( (B + C) * ( E – F ) – G ) / (H – I )
    Hand in a hard copy of your source code. You may append your testing as part of your documentation.

    Learn More
  9. 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
  10. 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

Items 1 to 10 of 36 total

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

Grid  List 

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