Q1) A(n) 6.1% bond with 10 years left to maturity has a YTM of 9.1%. The bond's price should be $__________. You should assume that the coupon payments occur semiannually.
Q2) A 10-year 4.8% coupon bond was issued 2 years ago. Similarly risky bonds are yielding 6%. Assume semi-annual coupon payments. The bond's price should be $___________.
If you can, please complete both! Thank you so much.
In: Finance
define and compare errors of omission and errors of commission. discuss these terms in the light of geoengineering.
In: Other
I have this C program that has two functions to solve this Blackjack Solution. But i need to use only function (not including main of course).
Is it possible to get to just one function outside of Main? #include<stdio.h> int isvalid(char card1, char card2); int sum(char card1, char card2); int sum(char card1, char card2) { int result=0; if(card1=='A' && card2=='A') return 12; if(card1<='9' && card1>='2') result+=card1-'0'; if(card1=='T' || card1 == 'J' || card1=='Q' || card1=='K') result+=10; if(card1=='A') result+=11; if(card2<='9' && card2>='2') result+=card2-'0'; if(card2=='T' || card2 == 'J' || card2=='Q' || card2=='K') result+=10; if(card2=='A') result+=11; return result; } int isvalid(char card1, char card2) { int i,cnt=0; char a[]="23456789ATJQK"; for(i=0;a[i];i++) { if(card1==a[i]) cnt++; if(card2==a[i]) cnt++; } if(cnt==2) return 1; return 0; } int main() { char c1, c2; scanf("%c %c",&c1,&c2); if(isvalid(c1,c2)) printf("%d\n",sum(c1,c2)); else printf("Invalid input"); return 0; }
In: Computer Science
In moving away from Planet Z, a spacecraft fires a probe with a
speed of 0.19 c, relative to the spacecraft, back toward
Z.
If the speed of the spacecraft is 0.50 c relative to Z,
what is the velocity of the probe as seen by an observer on
Z?
c,samedirectionasspacecraft
In: Physics
What are the consequences of deficiencies of the acyl-CoA dehydrogenase enzyme? Discuss the normal role of the enzyme, and how reduced activity impacts fatty acid metabolism. What metabolites used for fuel do you expect to be higher in the blood? What metabolites used for fuel do you expect to be much lower in the blood? How do the excess or lack of these metabolites influence the function of the organs that deal with these metabolites?
In: Chemistry
By holding a bike wheel (mass m, radius r, so that it rotates freely about its vertical center axis) and standing on a circular platform (a disk of mass M and radius R, free to rotate about its vertical center axis), describe a method to measure your mass using a stopwatch (an interesting balance!). Explain your method using physics equations and manipulations to prove that your method will work
In: Physics
a) What are the justification for public intervention when one of the hypothesis of the first theorem of welfare is violated?
b) Outline the major limits and shortcomings of economic policy coordination.
c) Write short notes on each of the following.
i) Actual (financial) or cyclically adjusted (structural) deficit.
ii) Budgetary balance
In: Economics
Relational Database
You should understand that a relational database is a collection of tables that are related to one another based on a common field. The tables within the database contain a collection of records. The records within the table contain a collection of fields. Each field in the table represents a particular characteristic of the data.
A field, or a collection of fields, is designated as the primary key. The primary key uniquely identifies a record in the table. When the primary key of one table is represented in a second table to form a relationship, it is called a foreign key.
Think about creating a database that will store information about students. Design a table that will contain information about students. You should decide on all the fields (characteristics) they would need to maintain student records. Select a field that would uniquely identify a student (usually a student ID). Explain why the student’s name would not be a good choice for the primary key Next, “fill in” the data for a particular student
Create another table that will store information about the student organizations students participate in (or extracurricular activities, sports, etc.).When you decided what the second table will be, determine the required fields. Most importantly, decide on the common field that will link these tables in a relational database.
In: Computer Science
Skills needed to complete this assignment: linked lists, stacks
PROMPT (In C++)
|
Postfix notation is a mathematical notation in which operators follow their operands; for instance, to add 3 and 4 one would write 3 4 + rather than 3 + 4. If there are multiple operations, operators are given immediately after their second operands; so, the expression written 3-4+5 in conventional notation would be written as 3 4 - 5 + in postfix notation: 4 is first subtracted from 3 and then 5 is added to it. An advantage of postfix notation is that it removes the need for parentheses that are required by infix notation. While 3-4*5 can also be written 3-(4*5), which is difficult from (3-4) * 5. In post fix notation, the former could be written 3 4 5 * -, while the latter could be written 3 4 - 5 * or 5 3 4 - *. |
|
Stacks can be used to evaluate expressions in postfix notations by following these steps: 1. If a number is typed, push it on the stack 2. If an operation is typed, depending on the operation, pop off two numbers from the stack, perform the operation, and push the result back on the stack. |
| You should complete the Stack class and other functions in the template file so that when the user enters an expression in postfix notation, the program calculates and shows the result. In this assignment the user enters one digit positive numbers only, but the result can be any integer. Only basic operations (+, -, /, *) are entered by the user and integer division is used in calculations. User input ends with a semicolon. |
|
Class Stack uses a linked list to implement a stack, it has five public member functions: 1. Default constructor: initializes the stack to an empty stack 2. isEmpty: returns true if the stack is empty and false otherwise 3. push: pushes a new number to the top of stack 4. pop: removes the top of the stack 5. top: returns the value at the top of the stack, does not remove it from the stack. |
TEMPLATE CODE (MUST USE THIS CODE)
DO NOT edit any other code, only write your code in the sections that say /*your code here*/
|
#include <iostream> #include <cstdlib> using namespace std; const char SENTINEL = ';'; |
|
struct Node { int data; Node *link; }; |
|
//precondition: c is initialized //precondition: returns true if c is '+', '-', '*' or '/' bool isOperator(char c); //precondition: o1 and o2 are initialized and op is an operator //precondition: returns op(o1, o2), e.g. if op is '-' then returns o1-o2 int calculate(int o1, in o2, char op); //precondition: c is a digit //precondition: returns the integer value of c int charToInt(char c); |
|
class Stack { public: //default constructor //initializes the stack to an empty stack Stack(); //this is a const function, meaning it cannot change any of the member variables //returns true if the stack is empty, false otherwise bool isEmpty() const; //returns the value at the top of the stack, does not modify the stack, does not check if the stack is empty or not int top() const; //adds data to the top of the stack void push(int data); //removes the top value of stack, does not return it, does nothing if the stack is empty void pop(); private: Note *listHead; //pointer to the head of a linked list }; |
|
int main() { char in; Stack operandStack; cout << "Enter a postfix expression (ending with " << SENTINEL << " and press Enter):\n"; cin >> in; while(in != SENTINEL) { if(isOperator(in)) { //pop two numbers from stack int n1, n2; if(operandStack.isEmpty()) { //print error message /*your code here*/ exit(1); } n2 = operandStack.top(); operandStack.pop(); if(operandStack.isEmpty()) { //print error message /*your code here*/ exit(1); } n1 = operandStack.top(); operandStack.pop(); //push the result of calculation to the top of operandStack /*your code here*/ } else { //push the number to the top of operandStack /*your code here*/ } cin >> in; } //pop a number from the top of stack int result; result = operandStack.top(); operandStack.pop(); if(operandStack.isEmpty()) //nothing left in the stack cout << "\nThe result is: " << result << endl; else // there is still numbers in the stack { //print an error message /*your code here*/ } return 0; } |
|
Stack::Stack() { /*your code here*/ } |
|
bool Stack::isEmpty() const { /*your code here*/ } |
|
int Stack::top() const { /*your code here*/ } |
|
void Stack::pop() { /*your code here*/ } |
|
void Stack::push(int data) { /*your code here*/ } |
|
int calculate(int o1, o2, char op) { /*your code here*/ } |
|
bool isOperator(char c) { return c == '+' || c == '-' || c == '*' || c == '/'; } |
|
int charToInt(char c) { return(static_cast(c) - static_cast('0'));} |
Input/Output Example
|
Example #1: Enter a postfix expression (ending with ; and press Enter): 3 4 - 5 +; The result is: 4 |
|
Example #2 Enter a postfix expression (ending with ; and press Enter): 3 4 - 5; Not enough operators entered! |
|
Example #3 Enter a postfix expression (ending with ; and press Enter): 3 4 - 5 + *; Not enough operands entered for operator: * |
In: Computer Science
In: Accounting
In: Economics
Read the following description and then answer items 12 to 16: Researchers are interested in determining if there is a difference between two exercise regimens (A and B). The researchers think that the regimens may have differential effects on a treadmill test where the participants run to exhaustion.
12.Write the appropriate null hypothesis.
14. What is the dependent variable in this study?
16. Describe what happens if the researchers make a type II error.
In: Math
Explain the need and rationale for a Satellite Control
Network. Then explain its key
functions via its generic block schematic.
In: Mechanical Engineering
Why will the number of suppliers in the tourism industry decrease, and how will this consolidation of suppliers take place?
In: Economics
True or False????
1) The Cp,m of He gas at 10K and 1 atm is larger than 5R/2.
2) ΔH does not depend on temperature.
3) Whether the equilibrium constant of an ideal-gas reaction increases or decreases, as T increases, is determined by the sign of ΔH.
4) Since the concentrations of reactants decreases with time, the rate, r, of a reaction always decreases as time increases.
Need help asap, please write a little explanation/reasoning as to why it is T/or F. Thank you.
In: Chemistry