Questions
My friend lost a bet with me and now owes me money. However, he is broke...

My friend lost a bet with me and now owes me money. However, he is broke and will pay me in increments. $500 in two years, $400 in 4 years, and finally, $1000 in ten years, with an interest rate 3.2%. How much money did he bet today (present value)?

If you could, please show the formula and how you got the answer. The answer we are given is $1,551.92 and I'm confused on how to get there. Thanks!

In: Finance

Write a simple Python program that will generate two random between 1 and 6 ( 1...

Write a simple Python program that will generate two random between 1 and 6 ( 1 and 6 are included). If the sum of the number is grader or equal to 10 programs will display “ YOU WON!!!”. if the sum is less than 10, it will display “YOU LOST”. After this massage program will ask users a question: “if you want to play again enter Y. if you want to exit enter ‘N’) If the user enters Y they will continue to play and if they enter N the program terminates.

In: Computer Science

Write a simple Python program that will generate two random between 1 and 6 ( 1...

Write a simple Python program that will generate two random between 1 and 6 ( 1 and 6 are included).

If the sum of the number is grader or equal to 10 programs will display “ YOU WON!!!”. if the sum is less than 10, it will display “YOU LOST”.

After this massage program will ask users a question: “if you want to play again enter Y. if you want to exit enter ‘N’)

If the user enters Y they will continue to play and if they enter N the program terminates.

In: Computer Science

You are the manager of a monopoly that sells a product to two groups of consumers...

You are the manager of a monopoly that sells a product to two groups of consumers in different parts of the country. Group 1’s elasticity of demand is -6, while group 2’s is -5. Your marginal cost of producing the product is $50. a. Determine your optimal markups and prices under third-degree price discrimination. Instructions: Enter your responses rounded to two decimal places.

Markup for group 1:

Price for group 1: $

Markup for group 2:

Price for group 2: $

b. Which of the following are necessary conditions for third-degree price discrimination to enhance profits. Instructions: In order to receive full credit, you must make a selection for each option. For correct answer(s), click the box once to place a check mark. For incorrect answer(s), click twice to empty the box.

We are able to prevent resale between the groups.

There are two different groups with different (and identifiable) elasticities of demand.

At least one group has elasticity of demand less than one in absolute value.

At least one group has elasticity of demand greater than 1 in absolute value.

In: Economics

What is the NPV of this project? (in 000s) Bogle is considering a two-year project to...

What is the NPV of this project? (in 000s)

Bogle is considering a two-year project to manufacture microchips. Bogle purchases equipment for $750K. This two-year project will require additional inventory of $125K and accounts payable of $150K, which reverse at the end of the project. Bogle’s tax rate is 50%, and its cost of capital is 12%.

Bogle estimates incremental revenue of $600K in years 1 and 2, and operating expenses equal to 15% of revenues. The machine is depreciated straight-line (i.e., 50% in year 1 and 50% in year 2).

What is the NPV of this project? (in 000s)

In: Finance

A medical statistician wanted to examine the relationship between the amount of sunshine (x) and incidence...

  1. A medical statistician wanted to examine the relationship between the amount of sunshine (x) and incidence of skin cancer (y). As an experiment he found the number of skin cancers detected per 100,000 of population and the average daily sunshine in eight counties around the country. These data are shown below.

Average Daily Sunshine

5

7

6

7

8

6

4

3

Skin Cancer per 100,000

7

11

9

12

15

10

7

5

  1. Find the least squares regression line.
  2. Draw a scatter diagram of the data and plot the least squares regression line on it.
  3. Calculate the coefficient of determination and interpret it.
  4. Calculate the coefficient of correlation and what does the coefficient of correlation calculated tell you about the direction and strength of the relationship between the two variables?

In: Statistics and Probability

use formulas to solve the problems 7. Your financial objective is to have $3,000,000 upon your...

use formulas to solve the problems

7. Your financial objective is to have $3,000,000 upon your retirement 40 years from now. If you have committed to make an equal annual deposit into an investment account that provides 9 percent annual return, how much will the annual deposit be?

8. If you invest $30,000 a year, every year in an account that earns 8 percent annual return, how long will it take for the balance in the account to reach $2,000,000?

In: Finance

The tertiary education advisory board is interested in current attitudes within society toward gaining a university...

The tertiary education advisory board is interested in current attitudes within society toward gaining a university qualification. The advisory board believes that a person’s attitude toward university qualifications will be influenced by their age. The variables to use in answering this question are Age (i.e. 18-38, 39-59 or 60+), and Attitude (i.e. a person’s attitude toward gaining a university qualification). Attitude was measured on a seven-point semantic differential scale that was anchored 1=not at all important to 7=very important. Is there a relationship between age and attitude toward gaining a university qualification? - Chi-square test for independence because we want to identify the relationship between two categorical variables row 1(going down): Age Row 2 (going down): Attitude
The tertiary education advisory board is interested in current
attitudes within society toward gaining a university qualification.
The advisory board believes that a person’s attitude toward
university qualifications will be influenced by their age. The
variables to use in answering this question are Age (i.e. 18-38,
39-59 or 60+), and Attitude (i.e. a person’s attitude toward
gaining a university qualification). Attitude was measured on a
seven-point semantic differential scale that was anchored 1=not at
all important to 7=very important. Is there a relationship between
age and attitude toward gaining a university qualification? -
Chi-square test for independence because we want to identify the
relationship between two categorical variables row 1(going down):
Age Row 2 (going down): Attitude
2   6
2   6
2   7
2   1
2   7
2   7
2   6
2   7
2   1
2   7
2   1
2   7
2   6
2   6
2   5
2   6
2   7
2   7
2   7
2   6
2   6
2   6
2   6
2   6
2   6
2   6
2   7
2   6
2   7
2   7
2   7
2   7
2   7
2   6
2   6
2   7
2   6
2   1
2   7
2   7
2   7
2   6
2   6
2   1
2   7
2   6
2   7
2   6
2   7
2   6
2   6
2   7
2   6
2   7
2   6
2   7
2   1
2   6
2   6
2   1
1   6
1   6
1   7
1   7
1   7
1   6
1   7
1   7
1   7
1   6
1   1
1   1
1   1
1   6
1   7
1   7
1   7
1   6
1   7
1   7
1   7
1   6
1   7
1   6
1   1
1   7
1   5
1   6
1   7
1   6
1   7
1   6
1   5
1   7
1   1
1   7
1   6
1   7
1   7
1   7
1   6
1   7
1   7
1   7
1   7
1   1
1   5
1   6
1   1
1   7
1   5
1   6
1   7
1   6
1   7
1   6
1   6
1   7
1   7
1   6
3   7
3   1
3   6
3   6
3   6
3   1
3   6
3   1
3   7
3   6
3   1
3   1
3   6
3   7
3   6
3   1
3   6
3   1
3   6
3   6
3   6
3   1
3   6
3   6
3   1
3   7
3   1
3   7
3   1
3   7
3   1
3   6
3   1
3   1
3   6
3   6
3   7
3   1
3   6
3   1
3   6
3   7
3   1
3   6
3   6
3   1
3   1
3   1
3   6
3   6
3   7
3   1
3   7
3   6
3   1
3   1
3   1
3   1
3   6
3   1

In: Statistics and Probability

1 Problem Description This lab will cover a new topic: linked lists. The basic idea of...

1 Problem Description

This lab will cover a new topic: linked lists. The basic idea of a linked list is that an address or a pointer value to one object is stored within another object. By following the address or pointer value (also called a link), we may go from one object to another object. Understanding the pointer concept (which has be emphasized in previous labs and assignments) is crucial in understanding how a linked list operates.

Your task will be to add some code to manipulate the list.

2 Purpose

Understand the concept of linked lists, links or pointers, and how to modify a linked list.

3 Design

A very simple design of a node structure and the associated linked list is provided lab7.cpp. Here is the declaration:

typedef int element_type; 

struct Node 

{ 

    element_type elem; 

    Node * next;

    Node * prev; // not used for this lab 

}; 

Node * head; 

NOTE: A struct is conceptually the same thing as a class. The only significant difference is that every item (each method and data field) is public. Structs are often used as simple storage containers, while classes encompass complex data and methods on that data. Nodes of a linked list are good examples of where a struct would be useful.

Since head is a pointer that points to an object of type Node, head->elem ( or (*head).elem ) refers to the elem field. Similarly, head->next refers to the next field, the value of which is a pointer and may point to another node. Thus, we are creating a chain of Nodes. Each node points to the next Node in the chain.

Note that in our program head should always points to the first node of the linked list. For a linked list that has no elements (an empty list), the value of head is NULL. When working with linked lists, it is usually helpful to draw them out in order to understand their operation.

4 Implementation

Note that this file contains a show() function that will display the contents of a linked list in order. As with previous labs, you must call show() after each of the following steps.

  1. Remove the first element from the linked list. Make sure to free the space for the Node correctly, and make sure that head is now pointing to the correct node in the list. When your code is working, you should see the node sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].
  2. Remove the last element from the list, assuming that we do not know how many nodes are in the linked list initially. Make sure to free the space and set the pointers correctly. Hint: we need to traverse the list to find the second to last Node. Once we have the pointer to that node we can safely remove the last node. One way to accomplish this is to store both a current pointer that points to the current node in the chain, and a previous pointer that points to the node containing the last element we saw. The previous pointer follows the current pointer through the list. When your code is working, you should see the node sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].
  3. Insert ten elements (0 to 9 for element values) to the beginning of the current linked list, each being placed at the beginning. You must use a loop here (so we can easily change the action to insert 1000 elements (0 to 999) for instance). When your code is working, you should see the node sequence [9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]. The basic procedure is to create a new node, set its next pointer to the head of the list, and then move the head to your new node.
  4. Insert ten elements (0 to 9 for element values) after the first node having value 7 in the current linked list. You will need to loop through the list to find the node that has 7 (again, do not assume you know where the 7 is. You should search for it.) Once you find the correct starting point, you will need to integrate your new nodes into the list one at a time. When your code is working, you should see the node sequence [9, 8, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]. One possible procedure will be to first get the node after 7 (e.g. the first node containing a 6, note that current points to the node of 7 in the search is assumed in the following), and make variable “end” points to the node. Create a new node with proper value, set this node's next to the end (node 6), set current's next to the new node. Depending on the order of inserting these values, we may either update end so that it points to the new node or move current so that it points to the new node. Then repeat creating a new node action.

Please write in C++

Basic Linked Lists Starter Code:

#include <cstdlib>
#include <iostream>

using namespace std;

// Data element type, for now it is int, but we could change it to anything else
// by just changing this line
typedef int element_type;

// Basic Node structure
struct Node
{
    element_type elem;  // Data
    Node * next;        // Pointer to the next node in the chain
    Node * prev;        // Pointer to the previous node in the chain, not used for lab 7
};

// Print details about the given list, one Node per line
void show(Node* head)
{
    Node* current = head;
    
    if (current == NULL)
        cout << "It is an empty list!" << endl;
    
    int i = 0;
    while (current != NULL) 
    {
        cout << "Node " << i << "\tElem: " << '\t' << current->elem << "\tAddress: " << current << "\tNext Address: " << current->next << endl;
        current = current->next;
        i++;
    }
    
    cout << "----------------------------------------------------------------------" << endl;
}

int main() 
{
    const int size = 15;

    Node* head    = new Node();
    Node* current = head;

    // Create a linked list from the nodes
    for (int i = 0; i < size; i++)
    {
        current->elem = i;
        current->next = new Node();
        current       = current->next;
    }
    
    // Set the properties of the last Node (including setting 'next' to NULL)
    current->elem = size;
    current->next = NULL;
    show(head);

    // TODO: Your Code Here Please use show(head); after completing each step.
STEP 1:


STEP 2:


STEP3:    


STEP 4:

    // Clean up
    current = head;
    while (current != NULL)
    {
        Node* next = current->next;
        delete current;
        current = next;
    }
    
    return 0;
}

In: Computer Science

A potato chip company claims that their chips have 130 calories per serving. We think this...

A potato chip company claims that their chips have 130 calories per serving. We think this claim is too low, so we buy 40 bags of chips and test the calories per stated serving size.  Our sample yields a mean of 132 calories per serving, with a standard deviation of 6 calories. Is the manufacturer's claim too low? \

Use alpha = 0.05.

In: Statistics and Probability