Imagine that you have just purchased a coffee in a cup, with a lid. You place your coffee cup on a table and it starts to cool down. We are going to model this cooling process. Choose whatever type of coffee cup you are most familiar with.
2. Do a Ninja Physics estimate of how long it will take for the sides of the cup to warm up.
The specific heat capacity of water (and coffee) is around 4200 J Kg-1 K-1. Cardboard has a thermal conductivity of around k ~ 0.025 W m-2 K-1 , a density of around 700 kg m-3 and a specific heat capacity of around 1400 J kg-1 K-1. Glass has a thermal conductivity of around k ~ 1 W m-2 K-1, a density of around 2500 kg m-3 and a specific heat capacity of around 700 J kg-1 K-1. Styrofoam (foamed plastic) has a thermal conductivity similar to air and a density of around 50 kg m-3, while hard plastics have thermal conductivities of k ~ 0.025 W m-2 K-1 and densities similar to water: both have specific heat capacities of around 1500 J Kg-1 K-1.
In: Physics
Main Program's grading:
Student's main program will be used to generate output files. These output files will be compared to the solution output files and also to output files generated through instructor code, i.e., C++ code that will call the appropriate members of the Board class with the appropriate command line arguments. Students are free to impliment their main program however they like but the output must be correct (according to the solution) and must match the output using student's Board class. Pseudocode for generating the output files from the instructor's end is shown below
#include "Cell.hpp"
#include "Board.hpp"
#include "Gary.hpp"
int main(int argc, char** argv){
unsigned int boardSize = (from command line arguments)
unsigned int numberSteps = (from command line arguments)
std::string outputFilename = (from optional command line argument)
Board B(boardSize);
if (an output filename is given){
B.setOutputFilename(outputFilename);
}
B.move_gary(numberSteps);
return 0;
}
and student code must be capable of generating the correct output in the correct location when calling these member functions of the Board class. Please note that the only "pseudo" above is the parsing of command line arguments and the if statement - the member functions and construction of variable B of type Board is valid C++ syntax that is used during testing.
Board Class:
Note that there are no structural requirements for the Board class beyond the member functions called via the above psuedo-main program. These include:
(1) The Board class shall be constructed given an unsigned integer parameter that defines the number of rows and columns, i.e., 'N' in the N by N board. Note that N must be odd. If N is given as even, students shall display a message stating "Board dimension must be an odd number!! Got {N} and adding 1 to equal {N+1}" (note that parameters within { } must be printed as their values) and shall add 1 to N to satisfy the requirement that N must be odd. Note that this message must be printed only to the console, i.e., should not be printed to the output file. (2) Gary shall move around the board when the move_gary(steps) function is called. Each step shall be one step of Langton's ant as defined above, i.e., change Gary's orientation based on the Cell input, change the cell color, and move Gary forward one unit. The board class shall print the state of the board at every step. See the below example with a boardSize input of 5 for 10 steps:
[Gary Location] {2, 2} [Gary Orientation] up [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 0 0 0 [Row 3] 0 0 0 0 0 [Row 4] 0 0 0 0 0
[Gary Location] {2, 3} [Gary Orientation] right [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 1 0 0 [Row 3] 0 0 0 0 0 [Row 4] 0 0 0 0 0
[Gary Location] {3, 3} [Gary Orientation] down [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 1 1 0 [Row 3] 0 0 0 0 0 [Row 4] 0 0 0 0 0
[Gary Location] {3, 2} [Gary Orientation] left [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 1 1 0 [Row 3] 0 0 0 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {2, 2} [Gary Orientation] up [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 1 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {2, 1} [Gary Orientation] left [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 0 0 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {1, 1} [Gary Orientation] up [Row 0] 0 0 0 0 0 [Row 1] 0 0 0 0 0 [Row 2] 0 1 0 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {1, 2} [Gary Orientation] right [Row 0] 0 0 0 0 0 [Row 1] 0 1 0 0 0 [Row 2] 0 1 0 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {2, 2} [Gary Orientation] down [Row 0] 0 0 0 0 0 [Row 1] 0 1 1 0 0 [Row 2] 0 1 0 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {2, 1} [Gary Orientation] left [Row 0] 0 0 0 0 0 [Row 1] 0 1 1 0 0 [Row 2] 0 1 1 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
[Gary Location] {3, 1} [Gary Orientation] down [Row 0] 0 0 0 0 0 [Row 1] 0 1 1 0 0 [Row 2] 0 0 1 1 0 [Row 3] 0 0 1 1 0 [Row 4] 0 0 0 0 0
the format is given by [Gary Location] {(row), (col)} (orientation) [Row 0] (col 0 color) (col 1 color) ... (col N-1 color) [Row 1] ... [Row (N-1)] ... (col N-1 color) where values within ( ) are to be filled in with program values. (col i color) shall be either "0" for "white" or "1" for "black". Note that students may want to call Cell::get_color_string( ) to print this value (or just Cell::get_color() as pointed out by a student in office hours!). This output will either be to standard output, i.e., std::cout, if a filename command line argument is not provided or will be printed to the filename given in the argument (students should use the ofstream object for file output. Note that C's fprintf will also be okay). The filename shall be set with the setOutputFilename member function.
Students are free to impliment the remaining functionality of the Board class as desired. The class should store a representation of the actual grid of cells which define the environment for Langon's ant, i.e., the Cell class created in Part A (Hint: I utilized a vector of vectors where each element of the outer vector stores a "row" or the grid represented by a vector of class Cell). The board class must also store a variable of type Gary that "walks" about the board. (More information on Gary is given below) At each step in the Gary::move_gary(Cell*) function the Board must pass a pointer to the Cell that Gary currently occupies so that Gary can alter his orientaiton, flip the color of that cell, i.e., call the change_color member function, and change his position, i.e., "walk" (find a tutorial for pointers to objects here).
The Gary class is subject to C++ unit testing and therefore has stricter requirements for composition. Each required member function will be denoted. (
1) Gary shall be constructed with a parameterized constructor accepting an unsigned integer input parameter representing the size of the board (denote here as BoardSize). Assume that BoardSize is odd! Gary shall initialize his position to be the middle cell of the board, e.g., if the BoardSize is given as 5 Gary would be initialized at index (2,2).
(2) Gary shall contain public member functions which return an unsigned integer type and accept no input named Gary::get_row() and Gary::get_col() which return Gary's row and column position on the board respectively.
(3) Gary shall contain a public member function which returns type void and accepts a Cell pointer called Gary::move(Cell*) which shall (a) alter Gary's orientation based on the Cell's color (b) change the Cell's color (c) move Gary one unit forward in the new orientation
(4) Gary shall contain a public member function which returns type orientation (defined as an enumeration enum orientation {up, right, down, left};) and accepts no input parameters called Gary::get_orientation()
In: Computer Science
Discuss and explain how important you think public relations are for each of the market segments. Provide specific examples.
Discuss and explain how important you think personal sales is for each of the market segments. Provide specific examples.
In: Operations Management
Evan Corporation’ charter authorized the following capital stock: Preferred stock: 8 percent, par $11, authorized 10,000 shares. Common stock: par $2.3, authorized 50,000 shares. Since inception, Skyhawk sold 6,058 shares of the common stock at $3.4per share and 1,845 shares of the preferred stock at $15. The ending retained earnings was $81,790 On the statement of stockholders' equity, the total stockholders' equity would be reported as $_____
In: Accounting
Dinitrogen pentoxide (N2O5) decomposes in chloroform as a solvent to yield NO2 and O2. The decomposition is first order with a rate constant at 45 ∘C of 1.0×10−5s−1.
Calculate the partial pressure, in atm, of O2 produced from 1.15 L of 0.592 M N2O5 solution at 45 ∘C over a period of 24.3 h if the gas is collected in a 12.1-L container. (Assume that the products do not dissolve in chloroform.)
In: Chemistry
If someone with a gun holds it up to your head and says “Your money or your life” then did you exercise free will when you gave her your money? What about if someone uses the threat of force against you? What if someone threatens to kill your family if you don’t cover for their crime? Are you responsible for covering for their crimes? Did you have the free will to do otherwise? What if they threatened to blackmail you at work if you didn’t cover up their stealing? Are you still responsible for your actions? Why or why not?
In: Psychology
2. In lieu of a risk assessment, what should a small company do to assess its security posture if a risk assessment is not financially practical?
In: Computer Science
A 420-N uniform rectangular sign 4.00 m wide and 3.00 m high is suspended from a horizontal, 6.00-m-long, uniform, 130-N rod as indicated in the figure below. The left end of the rod is supported by a hinge and the right end is supported by a thin cable making a 30.0
In: Physics
On January 1, 2011, Courier Inc. purchased new equipment that had a total cost (including shipping and installation) of $81,000. The equipment is expected to have a useful life of four years or produce a total of 121,000 units. At the end of its life, the equipment is expected to have a residual value of $4,600. The equipment is expected to produce 22,990 units in 2011; 32,670 units in 2012; and 35,090 units in 2013; and 30,250 units in 2014. Courier Inc.'s fiscal year ends on December 31.
In the table below, fill in the missing depreciation expense and accumulated depreciation amounts using the straight-line, double-declining-balance, and units-of-production methods. Do not round your intermediate calculation. When required, round your answers to the nearest dollar.
| Cost $81,000 |
Depreciation Expense |
Accumulated Depreciation |
||||
Year |
Straight-line Method |
Double- Declining- Balance Method |
Unit-of- Production Method |
Straight-line Method |
Double- Declining- Balance Method |
Unit-of- Production Method |
| 2011 | $ | $40,500 | $14,516 | $19,100 | $40,500 | $14,516 |
| 2012 | $19,100 | $ | $20,628 | $ | $60,750 | $35,144 |
| 2013 | $19,100 | $10,125 | $ | $57,300 | $ | $57,300 |
| 2014 | $19,100 | $5,525 | $19,100 | $76,400 | $76,400 | $ |
In: Accounting
7. A major airline keeps track of data on how their passengers redeem frequent flyer miles. They found that in the last year 58% of passengers redeemed them to purchase tickets for domestic travel, 44% redeemed them to purchase tickets for international travel, and that 16% redeemed them to purchase tickets for both domestic and international travel.
a. What is the probability that in the last year a passenger redeemed frequent flyer miles to purchase a ticket for domestic or international travel?
b. What is the probability that in the last year a passenger did not redeem frequent flyer miles to purchase a ticket for domestic or international travel?
c. Is redeeming frequent flyer miles to purchase a ticket for domestic and international travel mutually exclusive? Explain.
In: Math
The main participants/ competitors in food/groceries industry?
In: Economics
Company A offers you an initial salary of $150,000 with annual raises of 10% for the foreseeable future. Company B offers you $180,000 with annual raises of 8% for the foreseeable future.
A.) How many years will it take for the A salary to equal the B salary?
B.) How many years will it take for the total dollars received from A to equal the total dollars received from B?
In: Finance
In: Computer Science
If a centrral bank were required to target inflation at zero, then when there was a negative aggregate supply shock the central bank
a. would have to increase the money supply. This would move unemployment closer to the natural rate.
b. would have to increase the money supply. This would move unemployment further from the natural rate.
c. would have to decrease the money supply. This would move unemployment closer to the natural rate.
d. would have to decrease the money supply. This would move unemployment further from the natural rate.
In: Economics
As a technician in a large pharmaceutical research firm, you need to produce 400. mL of 1.00 M a phosphate buffer solution of pH = 7.36. The pKa of H2PO4− is 7.21. You have 2.00 L of 1.00 M KH2PO4 solution and 1.50 L of 1.00 M K2HPO4 solution, as well as a carboy of pure distilled H2O. How much 1.00 M KH2PO4 will you need to make this solution?
In: Chemistry