Questions
Write a function void reverse(char * s) that reverses the string passed as an argument. Your...

Write a function 
               void reverse(char * s)
that reverses the string passed as an argument. Your code should use pointer arithmetic (it may increment and decrement pointers, but it may not use array indexing). 
 
Here is a piece of code that shows the behavior of reverse:
char buf[100];
strcpy(buf, “hello”);
reverse(buf);
printf(“%s\n”, buf);  // output should be olleh
 
 

In: Computer Science

Why is it important to remember that even the bad management that you experience can teach...

Why is it important to remember that even the bad management that you experience can teach you things, even if it's what not to do.

Please don't hand write.

Thank you.

In: Operations Management

Calculate A+B, A-B, AxB, and A/B for each of the following pairs of binary numbers. (Assume...

Calculate A+B, A-B, AxB, and A/B for each of the following pairs of binary numbers. (Assume the first number in each pair = A and the second number =B). Append all numbers to 8 bits. Subtraction is not2’s complement.

a.1010101, 011010

b.101101, 10101

c.11001, 1100

d.1010101, 1110

In: Computer Science

Describe the factors that influence pricing decisions in practice.

Describe the factors that influence pricing decisions in practice.

In: Accounting

Create a Java method that does the following: 1) Ask the user for a dividend and...

Create a Java method that does the following:

1) Ask the user for a dividend and a divisor both of "int" type.

2) Computes the remainder of the division. The quotient (answer) must be of the "int" type.

Do NOT use the method " % " provided in Java in your code. Remember that it gives wrong answers when some of the inputs are negative.

Here is the code that I have so far I can't seem to get it correct. Here is the feedback from the instructor: It appears you are computing the quotient here. This program is supposed to compute the remainder. This can be fixed easily with one line of code.

Which line of code needs to be corrected to determine the remainder?

import java.util.Scanner;

public class Main {

   //method to get the floor value

   static int floorDivide(int a, int b)

   {

   if(a % b != 0 && ((a < 0 && b > 0) || (a > 0 && b < 0)))

   {

   return (a / b - 1);

   }

   else

   {

   return (a / b);

   }

   }

public static void main(String args[]) {

int a,b, result;

Scanner sc=new Scanner(System.in);

System.out.println("Please Enter a Dividend: ");

a=sc.nextInt();

System.out.println("Please Enter a Divisor: ");

b=sc.nextInt();

result= floorDivide(a,b);

System.out.println("The Result is: "+result);

}

}

In: Computer Science

Java File I/O Assignment: 1. Write a generic LinkedList class referencing page 2 and page 3....

Java File I/O Assignment: 1. Write a generic LinkedList class referencing page 2 and page 3. a. The class must be named LinkedList. b. The class must provide the methods listed above for constructing, accessing, and manipulating LinkedList objects for a generic type. c. Other than for testing purposes, the LinkedList class should do no input or output. d. The package must enable the provided tests. 2. Test this class using JUnit. a. A suite of JUnit tests have been provided to allow you to insure that your LinkedList implementation is correct. b. Check your progress by noting the number of passing and failing tests. As you implement more of the class, more tests will pass, until all tests are passing. c. The provided tests are sufficient to show insure the LinkedList class is implemented correctly. d. You are free to add more tests as you feel are necessary; however, none of the existing tests should be modified or removed. here is the provided code class

class LinkedList<E> {

    private Node<E> head;

    // the constructor.


    public LinkedList(Node<E> head) {
        this.head = head;
    }

    /**
     * TODO Implement this method.
     * Add the given element, value, to the end of the list.
     * @param value The value to be added.
     */
    public void add(E value) {

    }

    /**
     * TODO Implement this method.
     * Add the given element, value, to the list at the given index.
     * After this operation is complete, get(index) will return value.
     * After this operation, all elements that had an index
     * greater than index (as determined by get()) will have their index increased by one.
     * This operation is only valid for 0 <= index <= size().
     * @param index The index at which to add value.
     * @param value The value to be added.
     * @throws IndexOutOfBoundsException when index is less than zero or greater than size.
     */
    public void add(int index, E value) {

    }

    /**
     * TODO Implement this method.
     * Determine if the LinkedList is empty or not.
     * @return true if this LinkedList has no items. (This is the same as the size equal to zero.)
     * false if the size is greater than zero.
     */
    public boolean isEmpty() {
        return false;
    }

    /**
     * TODO Implement this method.
     * Return the size (number of items) in this LinkedList.
     * @return the number of items in the list.
     */
    public int size() {
        return -1;
    }

    /**
     * TODO Implement this method.
     * Return the element of the list at the given index.
     * This operation is only valid for 0 <= index < size().
     * This operation does not modify the list.
     * @param index The index at which to retrieve an element.
     * @return The element of the list at the given index.
     * @throws IndexOutOfBoundsException when index is less than zero or greater than or equal to size.
     */
    public E get(int index) {
        return null;
    }

    /**
     * TODO Implement this method.
     * Remove and return the first element (element number zero) from the list.
     * This operation is only valid for non-empty (size() > 0) lists.
     * @return The removed element.
     * @throws IndexOutOfBoundsException When the list is empty.
     */
    public E remove() {
        return null;
    }

    /**
     * TODO Implement this method.
     * Remove and return the element with the given index from the list.
     * This operation is only valid for 0 <= index < size().
     * After this operation, all elements that had an index
     * greater than index (as determined by get()) will have their index reduced by one.
     * @param index The index to remove an element from.
     * @return The removed element.
     * @throws IndexOutOfBoundsException when removing from index less than zero or greater than or equal to size.
     */
    public E remove(int index) {
        return null;
    }
}

In: Computer Science

CalJuice Company has decided to introduce three fruit juices made from blending two or more concentrates....

CalJuice Company has decided to introduce three fruit juices made from blending two or more concentrates. These juices will be packaged in 2-qt (64-oz) cartons. One carton of pineapple-orange juice requires 8 oz each of pineapple and orange juice concentrates. One carton of orange-banana juice requires 12 oz of orange juice concentrate and 4 oz of banana pulp concentrate. Finally, one carton of pineapple-orange-banana juice requires 4 oz of pineapple juice concentrate, 8 oz of orange juice concentrate, and 4 oz of banana pulp concentrate. The company has decided to allot 16,000 oz of pineapple juice concentrate, 24,000 oz of orange juice concentrate, and 5000 oz of banana pulp concentrate for the initial production run. The company also stipulated that the production of pineapple-orange-banana juice should not exceed 680 cartons. Its profit on one carton of pineapple-orange juice is $1.00, its profit on one carton of orange-banana juice is $0.80, and its profit on one carton of pineapple-orange-banana juice is $0.90. To realize a maximum profit, how many cartons of each blend should the company produce?

pineapple-orange juice     cartons
orange-banana juice     cartons
pineapple-orange-banana juice     cartons


What is the largest profit it can realize?
$

Are there any concentrates left over? (If so, enter the amount remaining. If not, enter 0.)

pineapple concentrate     oz
orange concentrate     oz
banana pulp concentrate     oz

In: Advanced Math

Convert the following MIPS instructions into machine code. Directly write down the answer without justifying steps...

  1. Convert the following MIPS instructions into machine code. Directly write down the answer without justifying steps will result 0 credit. All steps must be typed in Word.
    1. add $s0, $s1, $s2
    1. 2. lw $s0, 15($s1)

3. beq $s0, $s1, LABEL   #consider LABEL represents the 16-bit value 0x00FF

In: Computer Science

USING JAVA A method that parses the valid word file to a list of Strings. You...

USING JAVA

  • A method that parses the valid word file to a list of Strings. You may use a loop in the parsing method.
  • A nonrecursive method that prints the input String, makes the first call to the recursive anagramizer method, sends the result to the filter method, and prints the filtered result. You may use this code:
  • private void anagramize(String inString) {
  •         System.out.println("input string: " + inString);
  •         List < String > l = filter(anagramizeRecursive(inString.toLowerCase()));
  •         System.out.println("Anagrams: " + l);
  • }

In: Computer Science

Why is this java code reaching a deadlock and how to I fix it without serializing...

Why is this java code reaching a deadlock and how to I fix it without serializing the code (i.e. I don't want to do not have the Girl authenticate the Boy then have the Boy authenticate the Girl)?


import java.applet.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

// Attempt at a simple handshake.  Girl pings Boy, gets confirmation.
// Then Boy pings girl, get confirmation.
class Monitor {
   String name;
        
   public Monitor (String name) { this.name = name; }
                   
   public String getName() {  return this.name; }
                                
   // Girl thread invokes ping, asks Boy to confirm.  But Boy invokes ping,
   // and asks Girl to confirm.  Neither Boy nor Girl can give time to their
   // confirm call because they are stuck in ping.  Hence the handshake 
   // cannot be completed.
   public synchronized void ping (Monitor p) {
      System.out.println(this.name + " (ping): pinging " + p.getName());
      p.confirm(this);
      System.out.println(this.name + " (ping): got confirmation");
   }
                                
   public synchronized void confirm (Monitor p) {
      System.out.println(this.name+" (confirm): confirm to "+p.getName());
   }
}

class Runner extends Thread {
   Monitor m1, m2;
                
   public Runner (Monitor m1, Monitor m2) { 
      this.m1 = m1; 
      this.m2 = m2; 
   }
                                                        
   public void run () {  m1.ping(m2);  }
}
                                                                        
public class DeadLock {
   public static void main (String args[]) {
      int i=1;
      System.out.println("Starting..."+(i++));
      Monitor a = new Monitor("Girl");
      Monitor b = new Monitor("Boy");
      (new Runner(a, b)).start();
      (new Runner(b, a)).start();
   }
}

In: Computer Science

Managers use the planning process to set objectives and identify how to achieve them. What are...

Managers use the planning process to set objectives and identify how to achieve them. What are good objectives in the first three years after graduation? How do you plan to achieve them?

Please don't hand write.

Thank you.

In: Operations Management

The following were selected from among the transactions completed by Babcock Company during November of the...

The following were selected from among the transactions completed by Babcock Company during November of the current year:

Nov. 3 Purchased merchandise on account from Moonlight Co., list price $88,000, trade discount 20%, terms FOB destination, 2/10, n/30.
4 Sold merchandise for cash, $41,250. The cost of the merchandise sold was $22,250.
5 Purchased merchandise on account from Papoose Creek Co., $43,700, terms FOB shipping point, 2/10, n/30, with prepaid freight of $840 added to the invoice.
6 Returned $13,600 ($17,000 list price less trade discount of 20%) of merchandise purchased on November 3 from Moonlight Co.
8 Sold merchandise on account to Quinn Co., $16,100 with terms n/15. The cost of the merchandise sold was $9,440.
13 Paid Moonlight Co. on account for purchase of November 3, less return of November 6.
14 Sold merchandise on VISA, $226,120. The cost of the merchandise sold was $135,430.
15 Paid Papoose Creek Co. on account for purchase of November 5.
23 Received cash on account from sale of November 8 to Quinn Co.
24 Sold merchandise on account to Rabel Co., $60,700, terms 1/10, n/30. The cost of the merchandise sold was $33,120.
28 Paid VISA service fee of $3,580.
30 Paid Quinn Co. a cash refund of $6,420 for returned merchandise from sale of November 8. The cost of the returned merchandise was $3,010.

Required:

Journalize the transactions. Refer to the Chart of Accounts for exact wording of account titles.

In: Accounting

Q 1 - The surface area of a square or rectangle can be determined by multiplying...

Q 1 - The surface area of a square or rectangle can be determined by multiplying the length by the breadth. In a method called GetArea(), write a Java program to determine the surface area of a given square or rectangle. Assume the measurements will be in metres. The program should prompt the user for length and breadth values. [15]

Input
None
Output
Given a rectangle with length 20 metres and breadth 15 metres, the output would be: 300 square metres

In: Computer Science

Task: there are mainly five types of system calls: Process Control, File Management, Device Management, Information...

Task: there are mainly five types of system calls: Process Control, File Management, Device
Management, Information Maintenance and Communication. Please write two python programs
to implement the above two types of system calls.

In: Computer Science

Robert and Rebecca Richardson have just signed a 30-year, 5% fixed-rate mortgage for $280,000 to buy...

Robert and Rebecca Richardson have just signed a 30-year, 5% fixed-rate mortgage for $280,000 to buy their house. Find out this couple's monthly mortgage payment by preparing a loan amortization schedule for the Richardson’s for the first 2 months; find out how much of their payments applied to interest; and after 2 payments, how much of their principal will be reduced.

(Please construct a loan amortization schedule and show your calculations).

In: Finance