You are CEO of Rivet Networks, maker of ultra-high performance network cards for gaming computers, and you are considering whether to launch a new product. The product, the Killer X3000, will cost $ 903 comma 000 to develop up front (year 0), and you expect revenues the first year of $ 798 comma 000 , growing to $ 1.46 million the second year, and then declining by 45 % per year for the next 3 years before the product is fully obsolete. In years 1 through 5, you will have fixed costs associated with the product of $ 102 comma 000 per year, and variable costs equal to 45 % of revenues. a. What are the cash flows for the project in years 0 through 5? b. Plot the NPV profile for this investment using discount rates from 0% to 40% in 10% increments. c. What is the project's NPV if the project's cost of capital is 9 % ? d. Use the NPV profile to estimate the cost of capital at which the project would become unprofitable; that is, estimate the project's IRR.
In: Finance
Financial analysts recommend investing 15% to 20% of your annual income in your retirement fund to reach a replacement rate of 70% of your income by age 65. This recommendation increases to almost 30% if you start investing at 45 years old. Mallori Rouse is 28 years old and has started investing $5,100 at the end of each year in her retirement account. How much will her account be worth in 20 years at 10% interest compounded annually? How much will it be worth in 30 years? What about at 40 years? How much will it be worth in 50 years? (Please use the following provided Table 13.1.) (Do not round intermediate calculations. Round your answers to the nearest whole dollar amount.)
In: Finance
Write code for A counting sort is a technique to sort an array of n positive integers that lie between 0 and m, inclusive. You need m + 1 counters. Then, making only one pass through the array, you count the number of times each integer occurs in the array. For example, the figure below shows an array of integers that lie between 0 and 4 and the five counters after a counting sort has made its pass through the array. From the counters, you can see that the array contains one 0, three 1’s, two 2’s, one 3, and three 4’s. These counts enable you to determine that the sorted array should contain [0, 1, 1, 1, 2, 2, 3, 4, 4, 4].
import java.util.Arrays;
public class Question4
{
/** Sorts an array of postive integers that lie within the range 0 to max.
@param a The array.
@param max The largest value in the array. */
public static void question4(int[] a, int max)
{
}
/*
* Do not write any code inside the main method and expect it to get marked.
* Any code that you write inside the main method will be ignored. However,
* you are free to edit the main function in any way you like for
* your own testing purposes.
*/
public static void main(String[] args)
{
int[] array = {2, 8, 4, 10, 15, 0, 4, 8, 2, 2, 0, 15, 10};
System.out.println("The array before sorting:");
System.out.println(Arrays.toString(array)); //must print [2 8 4 10 15 0 4 8 2 2 0 15 10]
question4(array, 15);
System.out.println("\nThe array after sorting:");
System.out.println(Arrays.toString(array)); //must print [0 0 2 2 2 4 4 8 8 10 10 15 15]
}
}
In: Computer Science
what effect would each of the following have on the calculated molar mass of an unknown?
a) The balance was not zeroed before the three weighings of the test tube, sample, water were made. This caused each mass measurement to be 0.102 g greater than it should have been.
b) The thermometer consistently read 0.06 C lower than it should have, over the entire experimental range
c) The masses of the unknown and the solvent (water) were determinded, and the unknown completely dissolved in the water. Just before the jacketed test tube containing the unknown solution was placed in the ice-salt water bath, a small amount of the solution was spilled out of the tube.
d) The unknown contained a smal amount of an insoluble impurity
e) The unknown contained a small amount of a soluble impurity, which had a molar mass lower than that of the pure unknown.
f) A portion of the unknown did not dissolve.
In: Chemistry
Create a program called BubleSort.java that implements the Bubble Sort algorithm (The Art of Computer Programming - Donald Knuth). The algorithm is as follows: The program should be able to do the following: accepts one command line parameter. The parameter specifies the path to a text file containing the integers to be sorted. The structure of the file is as follows: There will be multiple lines in the file (number of lines unknown). Each line will contain multiple integers, separated by a single whitespace. reads the integers from the text file in part a into an array of integers. sort the integers in ascending order, and then prints out a sorted version of these integers, one per line. The implementation should follow the given the pseudo code/algorithm description. JAVA CODE
In: Computer Science
In: Nursing
This is your first experience with public speaking and you're very nervous. You're afraid you'll forget your speech and stumble. So you're wondering if it would be a good idea to alert your audience to your nervousness. If you decide to say something, what are some things you might say? Are there advantages and disadvantages to what you might say? What would you say? What good reasons can you give to say nothing?
In: Psychology
Discuss the possible solutions to “heal” the economy once the great recession was in full force.
In: Economics
c++
I cannot get my operator+ to pass my test, it is failing on the first test, how would i convert my operator+ to use pointers and dynamic memory?
Requirements:
============================================================================
string.hpp:
#ifndef CS23001_STRING_INTERFACE_HPP #define CS23001_STRING_INTERFACE_HPP #include <iostream> //////////////////////////////////////////////////// // CLASS INV: str[length()] == 0 && // length() == capacity() && // capacity() == stringSize - 1 // class String { public: String (); //Empty string String (char); //String('x') String (const char[]); //String("abc") String (const String&); //Copy Constructor ~String (); //Destructor void swap (String&); //Constant time swap String& operator= (String); //Assignment Copy char& operator[] (int); //Accessor/Modifier char operator[] (int) const; //Accessor int capacity () const; //Max chars that can be stored (not including null) int length () const; //Actual number of chars in string String operator+ (const String&) const; String& operator+= (const String&); bool operator== (const String&) const; bool operator< (const String&) const; String substr (int, int) const; //The sub-string from staring position to ending position int findch (int, char) const; //Find location of charater starting at a position int findstr (int, const String&) const; //Find location of str starting at a position void test_String (); friend std::ostream& operator<<(std::ostream&, const String&); friend std::istream& operator>>(std::istream&, String&); private: String (int n ); //String(10) - capacity 10, empty string String (int , const char []); //String(10, "abc") - capacity 10 with "abc" void resetCapacity (int); //Resets capacity to N, keeps string intact char *str; //Pointer to char[] int stringSize; //Size includes NULL terminator }; String operator+ (const char[], const String&); String operator+ (char, const String&); bool operator== (const char[], const String&); bool operator== (char, const String&); bool operator< (const char[], const String&); bool operator< (char, const String&); bool operator<= (const String&, const String&); bool operator!= (const String&, const String&); bool operator>= (const String&, const String&); bool operator> (const String&, const String&); #endif
============================================================================
string.cpp:
#include <iostream> #include "string.hpp" #include <cassert> String::String() { // default constructor - empty string stringSize = 1; str = new char [stringSize]; str[0] = 0; } String::String(char ch) { stringSize = 2; str = new char [stringSize]; str[0] = ch; str[1] = '\0'; } //REQUIRES: str.length() < capacity() //String a("abc") //Takes character array and turns into string array String::String(const char X[]) { int i = 0; while (X[i] != '\0') ++i; stringSize = i + 1; str = new char [stringSize]; for(int j = 0; j < capacity(); ++j) str[j] = X[j]; str[capacity()] = 0; } String::String(const String& rhs) { //copy constructor stringSize = rhs.stringSize; str = new char [stringSize]; for(int i = 0; i < capacity(); ++i) str[i] = rhs.str[i]; } String::~String() { //destructor delete[] str; } void String::swap (String& rhs) { //Constant time swap char * temporary = str; str = rhs.str; rhs.str = temporary; int hold = stringSize; stringSize = rhs.stringSize; rhs.stringSize = hold; } String& String::operator= ( String rhs) { // Assignment copy if (str == rhs.str) return *this; //check to see if they are already pointing to the same address delete [] str; stringSize = rhs.stringSize; str = new char [stringSize]; for (int i = 0; i < capacity(); ++i) str[i] = rhs.str[i]; return *this; } //REQUIRES: 0 <= i < length() // operator[] const --- allows access to const objects char String::operator[](int i) const { assert( (i > 0) && (i < length()) ); return str[i]; } //REQUIRES: 0 <= i < length() // operator[] --- allows access / modification to non-const objects char& String::operator[] (int i) { assert( (i >= 0) && (i < length() ) ); return str[i]; } int String::capacity() const { //capacity = stringSize -1; return (stringSize - 1); } //ENSURES: Retval == i where str[i] = 0 int String::length() const { int result = 0; while (str[result] != '\0') ++result; return result; } // retval == "xyzabc" where "xyx" + "abc" String String::operator+(const String& rhs) const { String result; int offset = length(); int i = 0; while(rhs.str[i] != 0) { result.str[offset + i] = rhs.str[i]; ++i; if (offset + i == capacity()) break; } return result; } String operator+(char lhs, const String& rhs) { return String(lhs) + rhs; } String operator+(const char lhs[], const String& rhs) { return String(lhs) + rhs; } String& String::operator+=(const String& rhs) { *this = operator+(rhs); return *this; } bool String::operator==(const String& rhs) const { int i = 0; while ((str[i] != '\0') && (str[i] == rhs.str[i])) ++i; return str[i] == rhs.str[i]; } bool operator==(char lhs, const String& rhs) { return String(lhs) == rhs; } bool operator==(char lhs[], const String& rhs) { return String(lhs) == rhs; } bool String::operator<(const String& rhs) const { int i = 0; while ((str[i] != 0) && (rhs.str[i] != 0) && (str[i] == rhs.str[i])) ++i; return str[i] < rhs.str[i]; } bool operator<(char lhs, const String& rhs) { return String(lhs) < rhs; } bool operator<(const char lhs[], const String& rhs) { return String(lhs) < rhs; } bool operator!=(const String& lhs, const String& rhs) { return !(lhs == rhs) || (lhs == rhs); } bool operator<=(const String& lhs, const String& rhs) { return (lhs < rhs) || (lhs == rhs); } bool operator>(const String& lhs, const String& rhs) { return (rhs < lhs); } bool operator>=(const String& lhs, const String& rhs) { return !(lhs < rhs); } std::ostream& operator<<(std::ostream& out, const String& rhs) { out << rhs.str; return out; } std::istream& operator>>(std::istream& in, String& rhs) { char placehold[540000]; in >> placehold; rhs = String(placehold); return in; } //REQUIRES: 0 <= start < length() //ENSURES: retval == i where str[i] == ch && i >= start // or retval == -1 if ch != s[start.length()-1] int String::findch(int start, char ch) const { if ( (start < 0) || (start >= length()) ) return -1; int i = start; while (str[i] != 0) { if (str[i] == ch) return i; ++i; } return -1; } int String::findstr(int pos, const String& rhs) const { int i = pos; if ((pos < 0) || (pos >= length() - rhs.length())) return -1; if (length() < rhs.length()) return -1; while ((str[pos] != 0) && (rhs.length() + pos - 1 <= length())) { if (rhs == substr(i, i + rhs.length() - 1)) return pos; ++i; } return -1; } //REQUIRES: 0 <= start <= end < length() //ENSURES: retval == s[start, ..., end] String String::substr(int start, int end) const { if (start < 0) return String(); if (start > end) return String(); if (end >= length()) return String(); String result; int i = start; while (i <= end) { result += str[i]; ++i; } return result; } String::String (int n) { //String(10) - capacity 10, empty string stringSize = n; str = new char [stringSize]; str[0] = 0; } String::String (int n, const char ch[]) { //String(10, "abc") - capacity 10 with "abc" stringSize = n; str = new char [n]; for (int i = 0; i < n; ++i) str[i] = ch[i]; } void String::resetCapacity (int n ) { //Resets capacity to N, keeps string intact int smaller = stringSize; if (smaller > n) smaller = n; stringSize = n; char * tmp = new char [stringSize]; for (int i = 0; i < smaller; ++i) tmp[i] = str[i]; delete [] str; str = tmp; } void String::test_String() { String testing(5); assert(testing.length() == 0); assert(testing.capacity() == 5); String test(15); assert(test.length() == 0); assert(test.capacity() == 15); String CharArray(10, "abc"); assert(CharArray.length() == 3); assert(CharArray.capacity() == 10); }
============================================================================
concat test .cpp:
#include "string.hpp" #include <cassert> #include <iostream> int main () { { // TEST String str = "x"; String str2 = "y"; String result; result = str+str2; std::cout<< str << " " << str2 << " " <<result<<std::endl; // VERIFY assert(result == "xy"); } { // TEST String str = "xyz"; String str2 = "abc"; String result; result = str+str2; // VERIFY assert(result == "xyzabc"); } { // TEST String str = "qlW3KSqbFk"; String str2 = "f6iSmJhRTl"; String result; result = str+str2; // VERIFY assert(result == "qlW3KSqbFkf6iSmJhRTl"); } { //------------------------------------------------------ // SETUP FIXTURE // TEST String str = "lZ8kmGDuKeqzqPOmvthx94jQQg46C8"; String str2 = "SgiwD"; String result; result = str+str2; // VERIFY assert(result == "lZ8kmGDuKeqzqPOmvthx94jQQg46C8SgiwD"); }
std::cout << "Done testing Concatination Constructor." << std::endl; }
In: Computer Science
Garcia's Truckin' Inc. is considering the purchase of a new production machine for $150,000. The purchase of this machine will result in an increase in earnings before interest and taxes of $40,000 per year. To operate the machine properly, workers would have to go through a brief training session that would cost $7,000 after taxes. It would cost $4,000 to install the machine properly. Also, because this machine is extremely efficient, its purchase would necessitate an increase in inventory of $15,000. This machine has an expected life of 10 years, after which it will have no salvage value. Finally, to purchase the new machine, it appears that the firm would have to borrow $100,000 at 12 percent interest from its local bank, resulting in additional interest payments of $12,000 per year. Assume simplified straight-line depreciation and that the machine is being depreciated down to zero, a 35 percent marginal tax rate, and a required rate of return of 15 percent.
a. What is the initial outlay associated with this project?
b. What are the annual after-tax cash flows associated with this project for years 1 through 9?
c. What is the terminal cash flow in year 10 (what is the annual after-tax cash flow in year 10 plus any additional cash flows associated with the termination of the project)?
d. Should the machine be purchased?
In: Finance
In: Operations Management
**Keil uVision5 - ARM Cortex M0+ - Embedded C programming
Modify the program below so that the Red, Green, and Blue LEDs are switched ON and OFF in a sequence with one second delay for Red and Green LEDs, and 0.5 second delay for the Blue LED.
#include "MKL25Z4.h" void delay(int n); int main (void) { SIM_SCGC5 |= SIM_SCGC5_PORTB(1); /* enable clock to Port B */ PORTB_PCR18 |=PORT_PCR_MUX(1); /* Configure PORTB ,pin 18 as GPIO ; set MUX*/ GPIOB_PDDR=(1UL << 18); /* make PORTB ,pin 18 as output pin */ while (1) { GPIOB_PCOR = (1UL << 18); /* turn ON Red LED for one sec */ delay(10); GPIOB_PSOR = (1UL << 18); /* turn OFF Red LED for one sec*/ delay(10); } } /* Delay function for 100 ms */ void delay(int n) { int i,j; for(i = 0 ; i < n; i++) for (j = 0; j < 349500; j++) {} }
In: Computer Science
why do forensic psychologists act as an expert witness?
In: Psychology
Derivatives are contracts enabling both buyers and sellers to execute a future transaction at a price determined at the outset of the derivatives contract. Please answer the following questions.
In: Finance
BOOK - CONTEMPORARY CANADIAN BUSINESS LAW
Chapter 14 - Breach of Contract and Remedies, Page 260, Case 3
Trebic was a skilled cabinetmaker of European ancestry. Moldeva, who had emigrated to Canada from the same country, requested him to build a set of kitchen cupboards “in the old-country style.” The two men discussed the general appearance desired, then Trebic drew up a list of materials that he required to construct the cupboards. Moldeva obtained the necessary lumber and supplies for Trebic, then took his family on a vacation. On his return, Moldeva found the work completed, and admired the craftsmanship and design that Trebic had exhibited in the making of the cabinets. Trebic had carefully carved the “old-country designs” on the trim boards. He had skillfully constructed the drawers and cabinets using wooden dowels, rather than nails, again in accordance with “old-country” tradition. In the execution of this skill he had used only hand tools, and then only the tools used by “old-country” craftsmen in the cabinet-making trade. In every detail, the cabinets were “old-country style.” When Moldeva indicated that he was completely satisfied with the cabinets, Trebic submitted his account in the amount of $4,800. The sum represented 120 hours work at $40 per hour, the normal rate charged by skilled cabinetmakers in the area. Moldeva, who was a building contractor himself, objected to the amount of Trebic’s account. He stated that carpenters in his shop could manufacture kitchen cabinets of the general size and shape of those made by Trebic in only a few days’ time. He offered Trebic $800 as payment in full. Trebic refused to accept the $800 offer and brought an action against Moldeva on the $4,800 account. Discuss the possible arguments of the parties. Render a decision.
In: Operations Management