Welcome to AssignmentCache!

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

Items 31 to 40 of 126 total

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

Grid  List 

Set Descending Direction
  1. 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
  2. ITS 320 Java Program 2 BankAccount Class Output

    ITS 320 Java Program 2 Custom BankAccount Class with a Modified Constructor

    $15.00

    ITS 320 Java Program 2 Custom BankAccount Class with a Modified Constructor

    1) Enter the code for the two classes "BankAccount.java" and "Program2.java" shown below. The Program2 class is a driver for the BankAccount class. Note that this version of the BankAccount class accepts a monthly interest rate in decimal format which must be calculated by the user.
    /**
    * BankAccount class
    * This class simulates a bank account.
    *
    * (Taken from "Starting Out with Java - Early Objects
    * (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.)
    *
    */
    public class BankAccount
    {
    private double balance; // Account balance
    private double interestRate; // Interest rate
    private double interest; // Interest earned

    /**
    * The constructor initializes the balance
    * and interestRate fields with the values
    * passed to startBalance and intRate. The
    * interest field is assigned to 0.0.
    */
    public BankAccount(double startBalance,
    double intRate)
    {
    balance = startBalance;
    interestRate = intRate;
    interest = 0.0;
    }

    /**
    * The deposit method adds the parameter
    * amount to the balance field.
    */
    public void deposit(double amount)
    {
    balance += amount;
    }

    /**
    * The withdraw method subtracts the
    * parameter amount from the balance
    * field.
    */
    public void withdraw(double amount)
    {
    balance -= amount;
    }

    /**
    * The addInterest method adds the interest
    * for the month to the balance field.
    */
    public void addInterest()
    {
    interest = balance * interestRate;
    balance += interest;
    }

    /**
    * The getBalance method returns the
    * value in the balance field.
    */
    public double getBalance()
    {
    return balance;
    }

    /**
    * The getInterest method returns the
    * value in the interest field.
    */
    public double getInterest()
    {
    return interest;
    }
    }

    /**
    *
    * Colorado State University – ITS-320 – Basic Programming
    *
    * This program demonstrates the BankAccount class.
    *
    * (Taken from "Starting Out with Java - Early Objects
    * (Third Edition) by Tony Gaddis, 2008 by Pearson Educ.)
    *
    * Programmed by: Reggie Haseltine, instructor
    *
    * Date: June 19, 2010
    *
    */
    import java.util.Scanner; // Needed for the Scanner class
    import java.text.DecimalFormat; // Needed for 2 decimal place amounts
    public class Program2 {
    public static void main(String[] args)
    {
    BankAccount account; // To reference a BankAccount object
    double balance, // The account's starting balance
    interestRate, // The annual interest rate
    pay, // The user's pay
    cashNeeded; // The amount of cash to withdraw

    // Create a Scanner object for keyboard input.
    Scanner keyboard = new Scanner(System.in);

    // Create an object for dollars and cents
    DecimalFormat formatter = new DecimalFormat ("#0.00");

    // Get the starting balance.
    System.out.print("What is your account's " + "starting balance? ");
    balance = keyboard.nextDouble();

    // Get the monthly interest rate.
    System.out.print("What is your monthly interest rate? ");
    interestRate = keyboard.nextDouble();

    // Create a BankAccount object.
    account = new BankAccount(balance, interestRate);

    // Get the amount of pay for the month.
    System.out.print("How much were you paid this month? ");
    pay = keyboard.nextDouble();

    // Deposit the user's pay into the account.
    System.out.println("We will deposit your pay " + "into your account.");
    account.deposit(pay);
    System.out.println("Your current balance is $" + formatter.format( account.getBalance() ));

    // Withdraw some cash from the account.
    System.out.print("How much would you like " + "to withdraw? ");
    cashNeeded = keyboard.nextDouble();
    account.withdraw(cashNeeded);

    // Add the monthly interest to the account.
    account.addInterest();

    // Display the interest earned and the balance.
    System.out.println("This month you have earned $" + formatter.format( account.getInterest() ) + " in interest.");
    System.out.println("Now your balance is $" + formatter.format( account.getBalance() ) );
    }
    }

    Compile the two test files (BankAccount.java first and then Program2.java second). Execute Program2 with the following inputs:
    starting balance - $500 (don't enter the dollar sign)
    monthly interest rate - 0.00125 (this is a 1.5% annual rate)
    monthly pay - $1000 (don't enter the dollar sign)
    withdrawal amount - $900 (don't enter the dollar sign)
    Verify that you earn $0.75 in interest and have an ending balance at the end of the month of $600.75.

    Then modify the BankAccount class's constructor method to create a BankAccount object which stores a monthly interest when the user inputs an annual interest rate of the format "nnn.nn" (i.e. 1.5). Note that the BankAccount constructor stored a monthly interest rate for the BankAccount object's instance field originally, but the user had to convert the annual rate to a monthly rate (i.e. 1.5 to 0.00125). Then modify the Program2 driver class to prompt the user for an annual interest rate. Recompile both classes and execute the modified Program2 driver class again, this time with following inputs:
    starting balance - $500 (don't enter the dollar sign)
    annual interest rate - 1.5
    monthly pay - $1000 (don't enter the dollar sign)
    withdrawal amount - $900 (don't enter the dollar sign)
    Verify that you still earn $0.75 in interest and still have an ending balance at the end of the month of $600.75 as you did with the original code.

    Submit only the modified source code files, final user inputs, and final output. Do not submit the original source code, inputs, and output.

    Be sure that you include the course, the program number, your name, and the date in your program header. Also include this information at the top of your Microsoft Word file. Include additional comments as necessary and maintain consistent indentation for good programming style as shown and discussed in our text.

    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 Dropbox:
    a) A single Microsoft Word file containing a screen snapshot of your Java source code for both Program2.java and BankAccount.java (just the beginnings of the source code is OK) as it appears in your IDE (e.g. jGRASP, Net Beans, JDeveloper, etc.) or editor (e.g. a DOS "more" of the .java file's first screen).
    b) A listing of your entire modified version of the Java source code for Program2.java and BankAccount.java 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. Do not submit the original source code files! c) A screen snapshot showing all of your program’s inputs and output in the same Microsoft Word file, and following item b) above.

    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):
    a) Inclusion of all deliverables in Step #3 in a single Word file.
    b) Correct execution of your program. This includes getting the correct results with the modified class files!
    c) Adequate commenting of your code.
    d) Good programming style (as shown and discussed in the textbook's examples).
    e) Neatness in packaging and labeling of your deliverables.

    6) You must put all your screen snapshots and source code to a single Microsoft Word file.

    Learn More
  3. Study Guide 1

    VB Study Guide Questions

    $50.00

    VB Study Guide Questions

    1. Write a statement that would fill a DataTable object named datCoins if an instance of the OleDbDataAdapter is named odaCollection.

    2. Write a Try-Catch structure to test a list box, lstTours has something selected and the selected item index can be converted into an Integer variable intTourNumber. If exception is detected, a message box saying "Select a Tour" should be displayed.

    3. Write a data validation to check that the variable intAge entered from an input box (and already converted to an integer) is between 0 and 120 inclusive.

    4. Write a statement that displays an input box, which should have a title of "Highland Heights Pay Roll" and a message of "Enter the hourly rate of pay" along with the default buttons of "OK" and "Cancel."

    5. Write a Public Function called "CylinderVolume" to convert the radius and height input to cylinder volume (height * π * radius ^ 2) and returns the result (use System.Math.PI for π).

    6. List and describe types of input that can be validated.

    7. Describe the different types of sequential files. Specifically, describe the characteristics of freeform files, delimited files, and fixed-field files; and what methods can be used to read those files.

    8. Describe the steps performed by ADO.NET to retrieve data from a database and optionally make changes to that data.

    9. Discuss the purpose of having user-defined (custom) classes.

    10. What is a constructor? How are an object's instance variables initialized if a class has only a constructor which does not accept any arguments?


    Multiple Choice
    Identify the choice that best completes the statement or answers the question.

    1. Which of the following sections are part of a UML class diagram?
    a. The class name
    c. The operations (methods)
    b. The attributes (data)
    d. All of the above

    2. When does the code in the Catch block of a structured exception handler execute?
    a. At run-time, when the main form loads.
    b. This code typically generates an exception so it can execute at any time while the program runs.
    c. The code always executes whether an exception occurs or not.
    d. This code executes when an exception occurs.


    3. In organizing namespaces, classes, and methods hierarchically, what character separates a namespace and class name?
    a. .
    c. _
    b. &
    d. ^


    5. The ____ of a variable specifies where a variable can be referenced within a program.
    a. range
    c. scope
    b. lifetime
    d. scale


    6. When an argument is passed ____, the Sub procedure code can change the value in the temporary variable and use it in any manner required, but the original value is not changed.
    a. byPal
    b. byRef
    c. byVal
    d. bySub


    7. In a database table, one ____ represents one record.
    a. row
    b. field
    c. key
    d. Column

    8. Which of the following statements is correct of applications with multiple modules?
    a. The Form window displays all of an application's forms in a columnar list.
    b. In an application with multiple forms, all forms are stored in the same physical file.
    c. An application can contain multiple forms but it can only contain a single Module block.
    d. An application can contain multiple forms, multiple Class blocks, and multiple Module blocks.


    9. Which of the following statements is true of UML class diagrams?
    a. Like flowcharts, they model the activities performed by the class.
    b. They describe each of the members (properties and methods) of the class.
    c. They describe the relationships between the methods of a class.
    d. They describe the purpose of each property and method in the class.

    10. Which of the following statements correctly calls the constructor for the class named Demo. Assume that the constructor accepts one argument having a data type of Double.
    a. Dim objDemoInstnace = New Demo(123.45)
    b. Dim objDemoInstance As Demo(123.45)
    c. Dim objDemoInstance As New Demo(123.45)
    d. Dim objDemoInstance As Demo = Create Demo(123.45)

    Learn More
  4. Student Oracle Database Part1 Create Table

    Student Database Oracle DDL and Queries

    $40.00

    Student Database Oracle DDL and Queries

    Create the following tables.
    STUDENT
    Student Number (PK)
    Student Last Name
    Student Major
    Department ID (FK)
    Student GPA
    Student Hours
    Student Class
    Advisor ID (FK)

    ADVISOR
    Advisor ID (PK)
    Advisor Last Name
    Advisor Office
    Advisor Building
    Advisor Phone

    DEPARTMENT
    Department ID (PK)
    Department Code
    Department Name
    Department Phone

    *NOTE* You will have to decide on how to handle the Department and Advisor ID foreign keys in terms of a numbering system as well as appropriate field widths and types for the fields.
    The business rules which govern this database are: A student may have one advisor while an advisor may advise multiple students. A student belongs to only one department but each department can have many students.
    Populate the table with data from Table P6.4 (p. 217).

    There is an error in the book! Change Ortiz’s student number to be 200888. In addition, add these three students to your database.
    STU_NUM 123984 995133 367181
    STU_LNAME Freeman Wilder Green
    STU_MAJOR CIT CIT BIS
    DEPT_CODE CS CS IS
    DEPT_NAME Computer Science Computer Science Business Informatics
    DEPT_PHONE 5234 3951 3951
    COLLEGE_NAME Informatics Informatics Informatics
    ADVISOR_LNAME Strand Zhang Goh
    ADVISOR_BLDG Griffin Griffin Griffin
    ADVISOR_OFFICE 5132 3451 5612
    ADVISOR_PHONE 1603 3512 7922
    STU_GPA 2.5 3.9 2.3
    STU_HOURS 97 58 63
    STU_CLASS Senior Junior Junior

    Part 1
    Provide all DDL-related code. This includes table definition and creation, fk/pk creation, and populating the tables with data. Please include the output from Oracle that shows that everything was created correctly.

    Part 2
    Queries – For each query provide 1) What the output, specifically, should be based upon eyeballing the data 2) the SQL code used to generate the query, and 3) the output from Oracle. Please include any relevant fields you think the user of the query would need to interpret the output.
    1. Advisors need the capability to generate a query that returns *all* student information based upon a student number. This will help them in the advisement process. Create a query that returns all information for student Freeman from each table.
    2. Each year, college administrators need to know how many students are in each major. Create a query that counts the number of students in each major while displaying the major name.
    3. Kroger has approached NKU with an internship opportunity! The business department chair needs to generate a mailing list to inform great students about a job opportunity. Create a query that shows all the student numbers, last names, majors, department names, and advisor’s last name for students in Business Admin. Students should have a minimum GPA of 2.5 or greater to be on this mailing list. List in ascending order of GPA.
    4. To get an idea of the adequacy of admission standards, NKU needs to have an idea of the breakdown of students. By each college, show the number of students in each classification (freshmen, sophomore, junior, senior).
    5. Due to a fire, Griffin Hall has burnt down. Write a SQL statement that updates all faculty who had offices in Griffin Hall to now be housed in the University Center.
    6. New funding may be able to pay for an advising center. The dean would like to get an idea of how many students each faculty member currently advises. Create a query that shows the names and majors of students for each advisor along with the advisor’s name.
    7. (Extra credit) Create a query that counts the number of students who are eligible for the Dean’s list (GPA >= 3.5) in each department.

    Learn More
  5. Microsoft Access 2010 CHAPTER 3 Lab 2 Reorder Filter

    Microsoft Access 2010 Chapter 3 Lab 2 Maintaining the Walburg Energy Alternatives Database

    $20.00

    Microsoft Access 2010 Chapter 3 Lab 2 Maintaining the Walburg Energy Alternatives Database

    Problem: The management of the Walburg Energy Alternatives recently acquired some items from a store that is going out of business. You now need to append these new items to the current item table. You also need to change the database structure and add some validation rules to the database.
    Use the database modified in the In the Lab 2 of Chapter 2 on page AC 134 for this assignment. You also will use the More Items database from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the required files.

    Perform the following tasks:
    1. Open the More Items database from the Data Files for Students.
    2. Create a new query for the Item table and add all fields to the query.
    3. Using an append query, append all records in the More Items database to the Item table in the Walburg Energy Alternatives database, as shown in Figure 3 – 87.
    4. Save the append query as Walburg Append Query and close the More Items database.
    5. Open the Walburg Energy Alternatives database and then open the Item table in Datasheet view. There should be 20 records in the table.
    6. The items added from the More Items database do not have a vendor assigned to them. Assign items 1234 and 2234 to vendor JM. Assign item 2216 to vendor AS. Assign items 2310 and 2789 to vendor SD.
    7. Create an advanced filter for the Item table. The filter should display records with fewer than 10 items on hand and be sorted in ascending order by Description. Save the filter settings as a query and name the filter Reorder Filter.
    8. Make the following changes to the Item table:
    a. Change the field size for the On Hand field to Integer. The Format should be fixed and the decimal places should be 0.
    b. Make Description a required field.
    c. Specify that the number on hand must be between 0 and 50. Include validation text.
    d. Add a calculated field Inventory Value (On Hand*Cost) following the Cost field. Format the field as currency.
    9. Save the changes to the table design. If a dialog box appears indicating that some data may be lost, click the Yes button.
    10. Add the Inventory Value field to the Inventory Status Report. Place the field after the Cost field. Save the changes to the report.
    11. Specify referential integrity between the Vendor table (the one table) and the Item table (the many table). Cascade the update but not the delete.
    12. Submit the revised More Items database and the Walburg Energy Alternatives database in the format specified by your instructor.

    Learn More
  6. MSCD610 Exam SQL

    MSCD610 Oracle Database Exam Oracle 11g SQL 2nd Casteel

    $30.00

    MSCD610 Oracle Database Exam Oracle 11g SQL 2nd Casteel

    True/False (2 points each)
    Indicate whether the sentence or statement is true or false.
    1. A one-to-many relationship means that an occurrence of a specific entity can only exist once in each table.
    2. A table name can consist of numbers, letters, and blank spaces.
    3. A constraint can only be created as part of the CREATE TABLE command.
    4. The MODIFY clause is used with the ALTER TABLE command to add a PRIMARY KEY constraint to an existing table.
    5. If a FOREIGN KEY constraint exists, then a record cannot be deleted from the parent table if that row is referenced by an entry in the child table.
    6. By default, the lowest value that can be generated by a sequence is 0.
    7. Search conditions for data contained in non-numeric columns must be enclosed in double quotation marks.
    8. Data stored in multiple tables can be reconstructed through the use of an ORDER BY clause.
    9. Rows can be updated through a simple view as long as the operation does not violate existing constraints and the view was created with the WITH READ ONLY option.
    10. By default, the column headings displayed in a report are in upper-case characters.

    Multiple Choice (3 points each)
    Identify the letter of the choice that best completes the statement or answers the question.
    11. Suppose that a patient in a hospital can only be assigned to one room. However, the room may be assigned to more than one patient at a time. This is an example of what type of relationship?
    a. one-to-many c. one-to-all
    b. many-to-many d. one-to-one

    Contents of the BOOKS table
    12. Which of the following will display the new retail price of each book as 20 percent more than it originally cost?
    a. SELECT title, cost+.20 "New Retail Price" FROM books;
    b. SELECT title, cost*.20 "New Retail Price" FROM books;
    c. SELECT title, cost*1.20 "New Retail Price" FROM books;
    d. none of the above

    Structure of the CUSTOMERS table
    13. Which of the following commands will increase the size of the CITY column in the CUSTOMERS table from 12 to 20 and increase size of the LASTNAME column from 10 to 14?
    a. ALTER TABLE customers
    MODIFY (city VARCHAR2(+8), lastname VARCHAR2(+4));
    b. ALTER TABLE customers
    MODIFY (city VARCHAR2(20), lastname VARCHAR2(14));
    c. ALTER TABLE customers
    MODIFY (city (+8), lastname (+4));
    d. ALTER TABLE customers
    MODIFY (city (20), lastname (14));

    14. Which of the following statements about the FOREIGN KEY constraint is incorrect?
    a. The constraint exists between two tables, called the parent table and the child table.
    b. When the constraint exists, by default a record cannot be deleted from the parent table if matching entries exist in the child table.
    c. The constraint can reference any column in another table, even a column that has not been designated as the primary key for the referenced table.
    d. When the keywords ON DELETE CASCADE are included in the constraint definition, a corresponding child record will automatically be deleted when the parent record is deleted.

    15. Which of the following SQL commands will require the user RTHOMAS to change the account password the next time the database is accessed?
    a. ALTER USER rthomas PASSWORD EXPIRE ;
    b. ALTER USER rthomas CHANGE PASSWORD;
    c. ALTER USER rthomas UPDATE PASSWORD;
    d. ALTER USER rthomas EXPIRE PASSWORD;

    16. To instruct Oracle to sort data in ascending order, enter ____ after the column name in the ORDER BY clause.
    a. Asc c. ascending
    b. A d. either a or c

    17. Which of the following is an accurate statement?
    a. When the LOWER function is used in a SELECT clause, it will automatically store the data in lower-case letters in the database table.
    b. When the LOWER function is used in a SELECT clause, the function stays in affect for the remainder of that user's session.
    c. When the LOWER function is used in a SELECT clause, the function only stays in affect for the duration of that SQL statement.
    d. none of the above

    18. Which of the following functions allows for different options, depending upon whether a NULL value exists?
    a. NVL c. IFNVL
    b. IFNL d. NVL2

    Contents of the ORDERS table
    19. Based on the contents of the ORDERS table, which of the following SQL statements will display the number of orders that have not been shipped?
    a. SELECT order#, COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL;
    b. SELECT order#, COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL
    GROUP BY order#;
    c. SELECT COUNT(shipdate)
    FROM orders
    WHERE shipdate IS NULL;
    d. SELECT COUNT(*)
    FROM orders
    WHERE shipdate IS NULL;

    20. Which of the following is not an example of formatting code available with the FORMAT option of the COLUMN command?
    a. Z
    b. 9
    c. ,
    d. .


    Completion (4 points each)
    Complete each sentence or statement.
    21. A(n) ____________________ is a group of interrelated files.
    22. In an arithmetic expression, multiplication and ____________________ are always solved first in Oracle.
    23. If a constraint applies to more than one column, the constraint must be created at the ______Table______________ level.
    24. After a value is generated, it is stored in the ____________________ pseudocolumn so it can be referenced again by a user.
    25. The ____________________ function is used to round numeric fields to a stated position.


    SQL
    26. (5 points) Consider an employee database with relations where the primary keys are underlined defined as:
    EMPLOYEE (employee name, street, city)
    WORKS (employee name, company_name, salary)
    A – Using sql functions as appropriate, write a query to find companies whose employees earn a higher salary, on average, than the average salary at ABC Corporation

    27. (7 points) Write a SQL script to create this relational schema. Execute the script against the ORACLE database to implement physical database tables. Integrity constraints are listed below.
    EMPLOYEE (name, SSN, BDate, Sex, Salary, SuperSSN, DNO)
    DEPARTMENT (DName, DNumber, MGRSSN, MGRStartDate)
    DEPTLOCATION (DNumber, DLocation)
    PROJECT (PName, PNumber, PLocation, DNum)
    WORKSON (ESSN, PNO, Hours)
    DEPENDENT (ESSN, DEPENDENT_NAME, Sex, BDate, Relationship)

    Integrity Constraints:
    Primary key = Foreign Key
    EMPLOYEE.SSN = DEPENDENT.ESSN
    EMPLOYEE.SSN = WORKSON.ESSN
    EMPLOYEE.SSN = DEPARTMENT.MGRSSN
    EMPLOYEE.SSN = EMPLOYEE.SuperSSN
    DEPARTMENT.DNumber = EMPLOYEE.DNO
    DEPARTMENT.DNumber = DEPTLOCATION.DNumber
    DEPARTMENT.DNumber = PROJECT.DNum
    PROJECT.PNumber = WORKSON.PNO

    28. (18 points) Write SQL syntax to resolve the following queries.
    - Find the names of all employees who are directly supervised by the employee named “John Doe”
    - List the name of employees whose salary is greater than the average salary of his or her corresponding department
    - For each department, retrieve the department name and the average salary of all employees working in that department.

    Learn More
  7. Joan Casteel Oracle 11g SQL Chapters 10 Multiple Choice Questions

    Joan Casteel Oracle 11g SQL Chapters 10 Multiple Choice Questions Solution

    $12.00

    Joan Casteel Oracle 11g SQL Chapters 10 Multiple Choice Questions Solution

    To answer the following questions, refer to the tables in the JustLee Books database.
    1. Which of the following is a valid SQL statement?
    a. SELECT SYSDATE;
    b. SELECT UPPER(Hello) FROM dual;
    c. SELECT TO_CHAR(SYSDATE, 'Month DD, YYYY') FROM dual;
    d. all of the above
    e. none of the above

    2. Which of the following functions can be used to extract a portion of a character string?
    a. EXTRACT
    b. TRUNC
    c. SUBSTR
    d. INITCAP

    3. Which of the following determines how long ago orders that haven’t shipped were received?
    a. SELECT order#, shipdate-orderdate delay FROM orders;
    b. SELECT order#, SYSDATE – orderdate FROM orders WHERE shipdate IS NULL;
    c. SELECT order#, NVL(shipdate, 0) FROM orders WHERE orderdate is NULL;
    d. SELECT order#, NULL(shipdate) FROM orders;

    4. Which of the following SQL statements produces “Hello World” as the output?
    a. SELECT "Hello World" FROM dual;
    b. SELECT INITCAP('HELLO WORLD') FROM dual;
    c. SELECT LOWER('HELLO WORLD') FROM dual;
    d. both a and b
    e. none of the above

    5. Which of the following functions can be used to substitute a value for a NULL value?
    a. NVL
    b. TRUNC
    c. NVL2
    d. SUBSTR
    e. both a and d
    f. both a and c

    6. Which of the following is not a valid format argument for displaying the current time?
    a. 'HH:MM:SS'
    b. 'HH24:SS'
    c. 'HH12:MI:SS'
    d. All of the above are valid.

    7. Which of the following lists only the last four digits of the contact person’s phone number at American Publishing?
    a. SELECT EXTRACT(phone, -4, 1) FROM publisher WHERE name ¼ 'AMERICAN PUBLISHING';
    b. SELECT SUBSTR(phone, -4, 1) FROM publisher WHERE name = 'AMERICAN PUBLISHING';
    c. SELECT EXTRACT(phone, -1, 4) FROM publisher WHERE name = 'AMERICAN PUBLISHING';
    d. SELECT SUBSTR(phone, -4, 4) FROM publisher WHERE name = 'AMERICAN PUBLISHING';

    8. Which of the following functions can be used to determine how many months a book has been available?
    a. MONTH
    b. MON
    c. MONTH_BETWEEN
    d. none of the above

    9. Which of the following displays the order date for order 1000 as 03/31?
    a. SELECT TO_CHAR(orderdate, 'MM/DD') FROM orders WHERE order# = 1000;
    b. SELECT TO_CHAR(orderdate, 'Mth/DD') FROM orders WHERE order# = 1000;
    c. SELECT TO_CHAR(orderdate, 'MONTH/YY') FROM orders WHERE order# = 1000;
    d. both a and b
    e. none of the above

    10. Which of the following functions can produce different results, depending on the value of a specified column?
    a. NVL
    b. DECODE
    c. UPPER
    d. SUBSTR

    11. Which of the following SQL statements is not valid?
    a. SELECT TO_CHAR(orderdate, '99/9999') FROM orders;
    b. SELECT INITCAP(firstname), UPPER(lastname) FROM customers;
    c. SELECT cost, retail, TO_CHAR(retail-cost, '$999.99') profit FROM books;
    d. all of the above

    12. Which function can be used to add spaces to a column until it’s a specific width?
    a. TRIML
    b. PADL
    c. LWIDTH
    d. none of the above

    13. Which of the following SELECT statements returns 30 as the result?
    a. SELECT ROUND(24.37, 2) FROM dual;
    b. SELECT TRUNC(29.99, 2) FROM dual;
    c. SELECT ROUND(29.01, -1) FROM dual;
    d. SELECT TRUNC(29.99, -1) FROM dual;

    14. Which of the following is a valid SQL statement?
    a. SELECT TRUNC(ROUND(125.38, 1), 0) FROM dual;
    b. SELECT ROUND(TRUNC(125.38, 0) FROM dual;
    c. SELECT LTRIM(LPAD(state, 5, ' '), 4, -3, "*") FROM dual;
    d. SELECT SUBSTR(ROUND(14.87, 2, 1), -4, 1) FROM dual;

    15. Which of the following functions can’t be used to convert the letter case of a character string?
    a. UPPER
    b. LOWER
    c. INITIALCAP
    d. All of the above can be used for case conversion.

    16. Which of the following format elements causes months to be displayed as a three-letter abbreviation?
    a. MMM
    b. MONTH
    c. MON
    d. none of the above

    17. Which of the following SQL statements displays a customer’s name in all uppercase
    characters?
    a. SELECT UPPER('firstname', 'lastname') FROM customers;
    b. SELECT UPPER(firstname, lastname) FROM customers;
    c. SELECT UPPER(lastname, ',' firstname) FROM customers;
    d. none of the above

    18. Which of the following functions can be used to display the character string FLORIDA in the query results whenever FL is entered in the State field?
    a. SUBSTR
    b. NVL2
    c. REPLACE
    d. TRUNC
    e. none of the above

    19. What’s the name of the table provided by Oracle 11g for completing queries that don’t involve a table?
    a. DUMDUM
    b. DUAL
    c. ORAC
    d. SYS

    20. If an integer is multiplied by a NULL value, the result is:
    a. an integer
    b. a whole number
    c. a NULL value
    d. None of the above—a syntax error message is returned.

    Learn More
  8. Joan Casteel Oracle 11g SQL Chapters 11 Multiple Choice Solution

    Joan Casteel Oracle 11g SQL Chapters 11 Multiple Choice Questions Solution

    $12.00

    Joan Casteel Oracle 11g SQL Chapters 11 Multiple Choice Questions Solution

    To answer these questions, refer to the tables in the JustLee Books database.
    1. Which of the following statements is true?
    a. The MIN function can be used only with numeric data.
    b. The MAX function can be used only with date values.
    c. The AVG function can be used only with numeric data.
    d. The SUM function can’t be part of a nested function.

    2. Which of the following is a valid SELECT statement?
    a. SELECT AVG(retail-cost) FROM books GROUP BY category;
    b. SELECT category, AVG(retail-cost) FROM books;
    c. SELECT category, AVG(retail-cost) FROM books WHERE AVG(retail-cost) > 8.56 GROUP BY category;
    d. SELECT category, AVG(retail-cost) Profit FROM books GROUP BY category HAVING profit > 8.56;

    3. Which of the following statements is correct?
    a. The WHERE clause can contain a group function only if the function isn’t also listed in the SELECT clause.
    b. Group functions can’t be used in the SELECT, FROM, or WHERE clauses.
    c. The HAVING clause is always processed before the WHERE clause.
    d. The GROUP BY clause is always processed before the HAVING clause.

    4. Which of the following is not a valid SQL statement?
    a. SELECT MIN(pubdate) FROM books GROUP BY category HAVING pubid = 4;
    b. SELECT MIN(pubdate) FROM books WHERE category = 'COOKING';
    c. SELECT COUNT(*) FROM orders WHERE customer# = 1005;
    d. SELECT MAX(COUNT(customer#)) FROM orders GROUP BY customer#;

    5. Which of the following statements is correct?
    a. The COUNT function can be used to determine how many rows contain a NULL value.
    b. Only distinct values are included in group functions, unless the ALL keyword is included in the SELECT clause.
    c. The HAVING clause restricts which rows are processed.
    d. The WHERE clause determines which groups are displayed in the query results.
    e. none of the above

    6. Which of the following is a valid SQL statement?
    a. SELECT customer#, order#, MAX(shipdate-orderdate) FROM orders GROUP BY customer# WHERE customer# = 1001;
    b. SELECT customer#, COUNT(order#) FROM orders GROUP BY customer#;
    c. SELECT customer#, COUNT(order#) FROM orders GROUP BY COUNT(order#);
    d. SELECT customer#, COUNT(order#) FROM orders GROUP BY order#;

    7. Which of the following SELECT statements lists only the book with the largest profit?
    a. SELECT title, MAX(retail-cost) FROM books GROUP BY title;
    b. SELECT title, MAX(retail-cost) FROM books GROUP BY title HAVING MAX(retail-cost);
    c. SELECT title, MAX(retail-cost) FROM books;
    d. none of the above

    8. Which of the following is correct?
    a. A group function can be nested inside a group function.
    b. A group function can be nested inside a single-row function.
    c. A single-row function can be nested inside a group function.
    d. a and b
    e. a, b, and c

    9. Which of the following functions is used to calculate the total value stored in a specified column?
    a. COUNT
    b. MIN
    c. TOTAL
    d. SUM
    e. ADD

    10. Which of the following SELECT statements lists the highest retail price of all books in the Family category?
    a. SELECT MAX(retail) FROM books WHERE category = 'FAMILY';
    b. SELECT MAX(retail) FROM books HAVING category = 'FAMILY';
    c. SELECT retail FROM books WHERE category = 'FAMILY' HAVING MAX(retail);
    d. none of the above

    11. Which of the following functions can be used to include NULL values in calculations?
    a. SUM
    b. NVL
    c. MAX
    d. MIN

    12. Which of the following is not a valid statement?
    a. You must enter the ALL keyword in a group function to include all duplicate values.
    b. The AVG function can be used to find the average calculated difference between two dates.
    c. The MIN and MAX functions can be used on any type of data.
    d. all of the above
    e. none of the above

    13. Which of the following SQL statements determines how many total customers were referred by other customers?
    a. SELECT customer#, SUM(referred) FROM customers GROUP BY customer#;
    b. SELECT COUNT(referred) FROM customers;
    c. SELECT COUNT(*) FROM customers;
    d. SELECT COUNT(*) FROM customers WHERE referred IS NULL;

    Use the following SELECT statement to answer questions 14–18:
    1 SELECT customer#, COUNT(*)
    2 FROM customers JOIN orders USING (customer#)
    3 WHERE orderdate > '02-APR-09'
    4 GROUP BY customer#
    5 HAVING COUNT(*) > 2;

    14. Which line of the SELECT statement is used to restrict the number of records the query processes?
    a. 1
    b. 3
    c. 4
    d. 5

    15. Which line of the SELECT statement is used to restrict groups displayed in the query results?
    a. 1
    b. 3
    c. 4
    d. 5

    16. Which line of the SELECT statement is used to group data stored in the database?
    a. 1
    b. 3
    c. 4
    d. 5

    17. Because the SELECT clause contains the Customer# column, which clause must be included for the query to execute successfully?
    a. 1
    b. 3
    c. 4
    d. 5

    18. The COUNT(*) function in the SELECT clause is used to return:
    a. the number of records in the specified tables
    b. the number of orders placed by each customer
    c. the number of NULL values in the specified tables
    d. the number of customers who have placed an order

    19. Which of the following functions can be used to determine the earliest ship date for all orders recently processed by JustLee Books?
    a. COUNT function
    b. MAX function
    c. MIN function
    d. STDDEV function
    e. VARIANCE function

    20. Which of the following is not a valid SELECT statement?
    a. SELECT STDDEV(retail) FROM books;
    b. SELECT AVG(SUM(retail)) FROM orders NATURAL JOIN orderitems NATURAL JOIN books GROUP BY customer#;
    c. SELECT order#, TO_CHAR(SUM(retail),'999.99') FROM orderitems JOIN books USING (isbn) GROUP BY order#;
    d. SELECT title, VARIANCE(retail-cost) FROM books GROUP BY pubid;

    Learn More
  9. CIS 170 iLab 1 Part A Getting Started

    CIS 170 Week 1 iLab 1 of 7 Getting Started Your First C# Programs

    $15.00

    CIS 170 iLab 1 of 7 Getting Started Your First C# Programs

    Week 1 Your First Program Data Types and Expressions

    Scenario/Summary
    Welcome to Programming with C#. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C# program.

    iLab Steps
    Part A: Getting Started
    Step 1: Start the Application
    Locate the Visual Studio 2010 icon and double click to open. Under Applications, click on the Microsoft Visual Studio.NET 2010 icon to open the C# software.
    Step 2: Create a C# Console Project
    Choose File->New Project, and click Console Application. In the project name box, enter LAB1A. Your screen should look like the screen below. If so, press the OK button.
    Step 3: Delete All Code in Program.cs
    Your screen should now look like what you see below. Now, highlight all of the code that you see [Ctrl + A] and press the Delete key. You will not need this code because you will now be getting experience writing every line of a new program.
    Step 4: Type in Program
    Now enter the following C# program exactly as you see it. Use the tab where appropriate. (Note: C# is case sensitive.) Instead of John Doe, type your name.
    class Hello
    {
    static void Main()
    {
    // display output
    System.Console.WriteLine("John Doe");
    System.Console.WriteLine("CIS170B – Programming using C#");
    System.Console.WriteLine("\n\n\nHello, world!\n\n");
    System.Console.WriteLine("EOJ");
    System.Console.ReadLine();
    }
    }
    Step 5: Save Program
    Save your program by clicking File on the menu bar and then clicking Save Program.cs, or by clicking the Savebutton on the toolbar or Ctrl + S.
    Step 6: Build Solution
    To compile the program, click Debug on the menu bar and then click the Build Solution or Build LabAoption. You should receive no error messages in the Error List window below the program. If you see some error messages, check the code above to make sure you didn't key in something wrong. You can double click on each error message to better navigate to the area where the problem might be. Once you make your corrections to the code, go ahead and build the solution again.
    Step 7: Execute the Program
    Once you have no compile errors, to execute or run your program, either:
    click Debug on the menu bar, and then Start Debugging;
    click the right arrow icon on the menu bar; or press the F5 key.
    Step 8: Capture the Output
    Print a picture of your screen output. (Do a print screen and paste this into your MS Word document.)
    Step 9: Print the Source Code
    Copy your source code and paste it into your Word document.
    End of Part A

    Part B: Calculate Total Tickets
    Step 1: Create New Project
    Make sure you close your previous program by clicking File >> Close Solution. Now, create a new project and name it LAB1B.
    Step 2: Type in Program
    Like before, delete the code that is automatically created and enter the following program. Type in your name for Developer and current date for Date Written.
    // ---------------------------------------------------------------
    // Programming Assignment: LAB1B
    // Developer: ______________________
    // Date Written: ______________________
    // Purpose: Ticket Calculation Program
    // ---------------------------------------------------------------
    using System;
    class FirstOutputWithUsing
    {
    static void Main()
    {
    // create variables and load values
    int childTkts, adultTkts, totalTkts;
    childTkts = 3;
    adultTkts = 2;
    // process (calculation)
    totalTkts = childTkts + adultTkts;
    // display output
    Console.WriteLine(totalTkts);
    // pause
    Console.Write("\nPress Enter to continue...");
    Console.ReadLine();
    }
    }
    Step 3: Save Program
    Save your program by clicking File on the menu bar and then clicking Save Program.cs, or by clicking the Savebutton on the toolbar or Ctrl + S.
    Step 4: Build Solution
    To compile the program, click Build on the menu bar and then click the Build Solution or Build LabB option. You should receive no error messages. If you see some error messages, check the code above to make sure you didn't key in something wrong. Once you make your corrections to the code, go ahead and click Build >> Build Solution again.
    Step 5: Execute the Program
    Once you have no syntax errors, to execute or run your program, click Debug on the menu bar and then clickStart Debugging.
    Step 6: Comment the Program
    Go back to the editor and insert meaningful comments that show that you understand what each line of code does.
    Step 7: Capture the Output
    1. Run the program again.
    2. Capture a screen print of your output. (Do a PRINT SCREEN and paste into your MS Word document.)
    3. Copy your commented code and paste it into your document
    End of Part B

    Part C: Payroll Program
    Step 1: Create a New Project
    1. Make sure you close your previous program by clicking File >> Close Solution.
    2. Create a new project and name it LAB1C.
    3. This time, do not delete the code that gets automatically created. Instead, insert your code right between the curly braces, as illustrated below.
    static void Main(string [] Args)
    {
    // your code goes here!
    }
    Include a comment box like what you coded in Part B at the very top of your program.
    Step 1a: Write Your Own Program
    Write a program that calculates and displays the take-home pay for a commissioned sales employee after deductions are taken. The employee receives 7% of his or her total sales as his or her gross pay. His or her federal tax rate is 18%. He or she contributes 10% to his or her retirement program and 6% to Social Security. Use the Processing Logic provided in Step 2 below as a guide. The program's output should look something like this:
    Enter weekly sales: 28,000
    Total sales: $28,000.00
    Gross pay (7%): $1,960.00
    Federal tax paid: $352.80
    Social security paid: $117.60
    Retirement contribution: $196.00
    Total deductions: $666.40

    Take home pay: $1,293.60
    Press any key to continue.

    Step 2: Processing Logic
    Basic Logic and Flowchart
    Input: Prompt the user for the weekly sales.
    Process: Perform the calculations. The employee receives 7% of his or her total sales as his or her gross pay. His or her federal tax rate is 18%. He or she contributes 10% to his or her retirement program and 6% to Social Security.
    Output: Display the results.
    Pseudocode:
    1. Declare variables
    2. Accept Input – weeklySales
    3. Calculate Gross Pay = Weekly Sales * .07
    4. Calculate Federal Tax = Gross Pay * .18
    5. Calculate Social Security = Gross Pay * .06
    6. Calculate Retirement = Gross Pay * .10
    7. Calculate Total Deductions = Federal Tax + Social Security + Retirement
    8. Calculate Total Take Home Pay = Gross Pay – Total Deductions
    9. Display the following on separate lines and format variables with $ and decimal
    1. Total Sales Amount: value of weekly sales
    2. Gross Pay (.07): value of gross pay
    3. Federal Tax paid (.18): value of federal tax
    4. Social Security paid (.06): value of social security
    5. Retirement contribution (.10): value of retirement
    6. Total Deductions: value of total deductions
    7. Take Home Pay: value of take home pay

    Step 3: Save Program
    Save your program by clicking File on the menu bar and then clicking Save Program.cs, or by clicking the Savebutton on the toolbar or Ctrl + S.

    Step 4: Build Solution
    To compile the program, click Debug on the menu bar and then click the Build Solution or Build LabCoption. You should receive no error messages. If you see some error messages, check the code above to make sure you didn't key in something wrong. Double-click on an error to navigate to its location in the code. Once you make your corrections to the code, go ahead and click Debug >> Build Solution again.

    Step 5: Execute the Program
    Once you have no syntax errors, to execute or run your program, click Debug on the menu bar and then clickStart Debugging, or press the right arrow icon or the F5 key.

    Step 6: Capture the Output
    1. Capture a screen print of your output. (Do a PRINT SCREEN and paste into your MS Word document.)
    2. Copy your commented code and paste it into the Word document.
    End of Part C
    END OF LAB

    After you have completed your lab, complete the following for each part of the lab (if there are multiple parts).
    1. Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.)
    2. Copy your code and paste it into the same MS Word document that contains the screen print of your output.
    3. Save the Word document as CIS170B_Lab01_B_LastName_FirstInitial.docx.
    4. Upload all three projects folder and save the compressed file as CIS170B_Lab01_B_LastName_FirstInitial.Zip.
    5. Submit both the compressed project file and the Word document to the weekly Dropbox for this lab.
    Zipping and Submitting Your Project Files
    When you submit your project files, you will want to send the entire project folder that is created by MS Visual Studio when you create the project, along with your MS Word file. Use your favorite compression tool to zip the full contents of both projects, zip the single zip file, and submit the zip file to your Dropbox.

    Learn More
  10. CIS 170 Week 4 iLab 4 Phone Dialing Program

    CIS 170 Week 4 iLab 4 of 7 Methods Phone Dialing Program

    $15.00

    CIS 170 Week 4 iLab 4 of 7 Methods Phone Dialing Program

    Scenario/Summary
    You will code, build, and execute a program that simulates the dialing of a phone using methods.

    Phone Dialing Program
    Your mission: A prepaid phone service needs a program that converts alphanumeric keyboard input into a phone number. The user will input eight characters and the program will output either an error message or the translated seven-digit phone number. The input may contain digits, letters, or both. Letters can be uppercase or lowercase.
    The program will perform the conversion per a standard telephone keypad layout.
    0
    1
    2
    A B C
    3
    D E F
    4
    G H I
    5
    J K L
    6
    M N O
    7
    P Q R S
    8
    T U V
    9
    W X Y Z

    The program implements the following methods.
    Main(): Declares seven character variables and passes these to the following methods by reference:
    ProcessInput(): gets user input and performs the conversion
    ShowResults(): displays the results
    GetInput(): Gets seven characters from the user and stores them into the seven variables Main() has passed by reference.
    ProcessInput(): Calls ToDigit() for each, passing each character variable by reference, and returns one of these codes to Main() by value:
    0 if there were no input errors
    -1 if there were input errors

    Input errors include the following:
    The first character is 0 (seven-digit phone numbers can't start with 0).
    The first three characters are "555" (no phone numbers start with 555).
    Any character is not a digit or an uppercase or lowercase letter.
    ToDigit(): Converts a character (passed by reference) to its corresponding digit per the table above, and returns one of these codes to ProcessInput() by value:
    0 if the character is valid (a digit or uppercase or lowercase letter)
    -1 if the character is not valid
    ShowResults(): Writes converted telephone number to the screen, inserting a dash (-) between the third and fourth digits, and accepts the seven character variables from Main() by reference.

    Sample Output:
    Enter a 7 character phone number: 2132121
    The converted phone number is: 213-2121
    Enter a 7 character phone number: 2scdfER
    The converted phone number is: 272-3337
    Enter a 7 character phone number: 555resw
    Invalid input, please try again.
    Enter a 7 character phone number: 0988765
    Invalid input, please try again.
    Enter a 7 character phone number: 12345678
    Invalid input, please try again.
    Enter a 7 character phone number: @34*uy
    Invalid input, please try again.

    Tips
    Best practice: Don't try to write too much at a time! First, write an outline in comments based on the requirements and the pseudocode. Then, implement declaring seven char variables. Make sure to fix any compiler errors before implementing more. Then, write and call an empty GetInput() method that accepts parameters, but does nothing but return a dummy value. Make sure you can pass the seven character variables by reference without compiler errors before implementing any of the GetInput() logic. Keep working incrementally like this, testing as you go. Set breakpoints and use the debugger at each phase to make sure your logic is working correctly. Then, use the same approach to implement the other methods. Test each phase with valid input before handling any invalid conditions.

    Pseudocode
    ProcessInput( ) Method
    Get 7 characters from the user and store them in the 7 variables that Main() has passed by reference
    Call ToDigit() for each of the 7 characters
    If toDigit returns an error code (-1), return an error code (-1)
    If the first character is 0, return an error code (-1) to Main()
    If the first three characters are 555, return an error code (-1)
    If there are no errors, return 0
    ToDigit ( ) Method
    Convert the characters (passed from ProcessInput() by reference) to upper case
    Use a switch statement to translate characters into their corresponding digits.
    Write a case statement for each digit and for each valid uppercase letter
    Write a default case that returns an error code (-1) for invalid letters
    If there are no invalid letters, return 0
    ShowResults ( ) Method
    Display the Phone Number using the character variables Main() has passed by reference
    Main() Method
    Declare 7 char variables
    Get user input by calling the GetInput() method, passing it the 7 variables by reference
    Perform the conversion by calling the ProcessInput( ) method, passing it the 7 variables by reference
    Display an error message or call ShowResults(), depending on the code ProcessInput() returns

    END OF LAB

    Learn More

Items 31 to 40 of 126 total

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

Grid  List 

Set Descending Direction
[profiler]
Memory usage: real: 15466496, emalloc: 14776256
Code ProfilerTimeCntEmallocRealMem