Question 110 pts
All life on earth shares a common genetic history.
Group of answer choices
True
False
Flag this Question
Question 210 pts
__________ is the movement of gene sets in and out of a population due to death, immigration, emigration, etc. smoothing out the variations in characteristics over time.
Group of answer choices
Gene Flow
Protein Flow
Lipid Flow
Gene Growth
Gene Transfer
Flag this Question
Question 310 pts
By selecting for or against certain Genes (or traits), natural forces shape evolution at the population level for a species.
Group of answer choices
True
False
Flag this Question
Question 410 pts
The Bottleneck Effect occurs when ___________.
Group of answer choices
large groups of individuals leave their home population and establish new settlements, mating only among themselves
many members of a population die, resulting in a great loss of genetic diversity
small groups of individuals leave their home population and establish new settlements, mating only among themselves
many members of a population reproduce causing too much genetic diversity within the population
Flag this Question
Question 510 pts
Which one of the following would a Biologist describe as Microevolution?
Group of answer choices
dramatic biological changes, such as the origin of wings on a bird which leads to a new novel characteristic and true flight
a change in the gene pool of a population from one generation to the next but no new species are formed
the extinction of species
the formation of new species
Flag this Question
Question 610 pts
____________ is the change in large characteristics of a group of organisms leading to novel traits, new species, and unique new groups of organisms.
Group of answer choices
Microevolution
Macroevolution
Flag this Question
Question 710 pts
Blue-footed booby birds have blue, webbed feet and are comically clumsy when they walk on land. Evolutionary scientists view these feet as
Group of answer choices
a curiosity that has little to teach us regarding evolution.
an example of a trait that has not evolved.
an example of a trait that is poorly adapted.
the outcome of a trade-off: Webbed feet perform poorly on land, but are very helpful in diving for food.
Flag this Question
Question 810 pts
An elk herd is observed over many generations. Most of the full-grown bull elk have antlers of nearly the same size, although a few have antlers that are significantly larger or smaller than this average size. The average antler size remains constant over the generations. Which of the following effects probably accounts for this situation?
Group of answer choices
Diversifying Selection
Stabilizing Selection
Directional Selection
Flag this Question
Question 910 pts
The mode of Natural Selection in which one extreme phenotype is fittest and the environment selects against the others is called ________.
Group of answer choices
Directional Selection
Diversifying Selection
Concert Ticket Selection at Ticketmaster
Stabilizing Selection
Flag this Question
Question 1010 pts
A female peacock choosing the most colorful male peacock would be a good example of _______ Selection.
Group of answer choices
Homosexual
Intrasexual
Heterosexual
Bisexual
Intersexual
In: Biology
This program (in python) will display a set of authors and the number of novels written by each author in both a table and a histogram. You will ask the user for all of the information. Using what you learned about incremental development, use the following approach to create your program:
Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored
Enter the column 1 header: Author name You entered: Author name Enter the column 2 header: Number of novels You entered: Number of novels
Enter a data point (-1 to stop input): Jane Austen, 6 Author: Jane Austen Number of Novel(s): 6
If the error occurs, output the appropriate error message and
prompt again for a valid data point. You can assume that if a comma
is present, then the data point is entered correctly.
Ex:
Enter a data point (-1 to stop input): Ernest Hemingway 9 Error: No comma in string. Enter a data point (-1 to stop input): Ernest Hemingway, 9 Author: Ernest Hemingway Number of Novel(s): 9
Number of Novels Authored Author name | Number of novels -------------------------------------------- Jane Austen | 6 Charles Dickens | 20 Ernest Hemingway | 9 Jack Kerouac | 22 F. Scott Fitzgerald | 8 Mary Shelley | 7 Charlotte Bronte | 5 Mark Twain | 11 Agatha Christie | 73 Ian Flemming | 14 J.K. Rowling | 14 Stephen King | 54 Oscar Wilde | 1
Jane Austen ******
Charles Dickens ********************
Ernest Hemingway *********
Jack Kerouac **********************
F. Scott Fitzgerald ********
Mary Shelley *******
Charlotte Bronte *****
Mark Twain ***********
Agatha Christie *************************************************************************
Ian Flemming **************
J.K. Rowling **************
Stephen King ******************************************************
Oscar Wilde *
For this program, you can assume that the user will not enter duplicate author names
In: Computer Science
23.2 PROJECT 2 : Data Visualization using LOOPS (python)
This program will display a set of authors and the number of novels written by each author in both a table and a histogram. You will ask the user for all of the information. Using what you learned about incremental development, use the following approach to create your program:
Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored
Enter the column 1 header: Author name You entered: Author name Enter the column 2 header: Number of novels You entered: Number of novels
Enter a data point (-1 to stop input): Jane Austen, 6 Author: Jane Austen Number of Novel(s): 6
If the error occurs, output the appropriate error message and
prompt again for a valid data point. You can assume that if a comma
is present, then the data point is entered correctly.
Ex:
Enter a data point (-1 to stop input): Ernest Hemingway 9 Error: No comma in string. Enter a data point (-1 to stop input): Ernest Hemingway, 9 Author: Ernest Hemingway Number of Novel(s): 9
Number of Novels Authored Author name | Number of novels -------------------------------------------- Jane Austen | 6 Charles Dickens | 20 Ernest Hemingway | 9 Jack Kerouac | 22 F. Scott Fitzgerald | 8 Mary Shelley | 7 Charlotte Bronte | 5 Mark Twain | 11 Agatha Christie | 73 Ian Flemming | 14 J.K. Rowling | 14 Stephen King | 54 Oscar Wilde | 1
Jane Austen ******
Charles Dickens ********************
Ernest Hemingway *********
Jack Kerouac **********************
F. Scott Fitzgerald ********
Mary Shelley *******
Charlotte Bronte *****
Mark Twain ***********
Agatha Christie *************************************************************************
Ian Flemming **************
J.K. Rowling **************
Stephen King ******************************************************
Oscar Wilde *
For this project, you can assume that the user will not enter duplicate author names.
In: Computer Science
Summarize two topics you found to be most noteworthy in this reading. Must be in own word(200words).
Buffet Essays I. Preferred Stock
When Richard Branson, the wealthy owner of Virgin Atlantic Airways, was asked how to become a millionaire, he had a quick answer: "There's really nothing to it. Start as a billionaire and then buy an airline." Unwilling to accept Branson's proposition on faith, your Chairman decided in 1989 to test it by investing $358 million in a 91/4% preferred stock of USAir. I liked and admired Ed Colodny, the company's then-CEO, and I still do. But my analysis of USAir's business was both superficial and wrong. I was so beguiled by the company's long history of profitable operations, and by the protection that ownership of a senior security seemingly offered me, that I overlooked the crucial point: USAir's revenues would increasingly feel the effects of an unregulated, fiercely competitive market whereas its cost structure was a holdover from the days when regulation protected profits. These costs, if left unchecked, portended disaster, however reassuring the airline's past record might be. ([Again, if] history supplied all of the answers, the Forbes 400 would consist of librarians.) To rationalize its costs, however, USAir needed major improvements in its labor contracts-and that's something most airlines have found it extraordinarily difficult to get, short of credibly threatening, or actually entering, bankruptcy. USAir was to be no exception. Immediately after we purchased our preferred stock, the imbalance between the company's costs and revenues began to grow explosively. In the 1990-1994 period, USAir lost an aggregate of $2.4 billion, a performance that totally wiped out the book equity of its common stock. For much of this period, the company paid us our preferred dividends, but in 1994 payment was suspended. A bit later, with the situation looking particularly gloomy, we wrote down our investment by 75%, to $89.5 million. Thereafter, during much of 1995, I offered to sell our shares at 50% of face value. Fortunately, I was unsuccessful. Mixed in with my many mistakes at USAir was one thing I got right: Making our investment, we wrote into the preferred contract a somewhat unusual provision stipulating that "penalty dividends"- to run five percentage points over the prime rate-would be accrued on any arrearages. This meant that when our 91/4% dividend was omitted for two years, the unpaid amounts compounded at rates ranging between 131/4% and 14%. Facing this penalty provision, USAir had every incentive to pay arrearages just as promptly as it could. And in the second half of 1996, when USAir turned profitable, it indeed began to pay, giving us $47.9 million. We owe Stephen Wolf, the company's CEO, a huge thank-you for extracting a performance from the airline that permitted this payment. Even so, USAir's performance has recently been helped significantly by an industry tailwind that may be cyclical in nature. The company still has basic cost problems that must be solved. In any event, the prices of USAir's publicly-traded securities tell us that our preferred stock is now probably worth its par value of $358 million, give or take a little. In addition, we have over the years collected an aggregate of $240.5 million in dividends (including $30 million received in 1997). Early in 1996, before any accrued dividends had been paid, I tried once more to unload our holdings-this time for about $335 million. You're lucky: I again failed in my attempt to snatch defeat from the jaws of victory. In another context, a friend once asked me: "If you're so rich, why aren't you smart?" After reviewing my sorry performance with USAir, you may conclude he had a point. We continue to hold the convertible preferred stocks described in earlier reports: $700 million of Salomon Inc., $600 million of The Gillette Company, $358 million of USAir Group, Inc., and $300 million of Champion International Corp. Our Gillette holdings will be converted into 12 million shares of common stock on April 1. Weighing interest rates, credit quality and prices of the related common stocks, we can assess our holdings in Salomon and Champion at yearend 1990 as worth about what we paid, Gillette as worth somewhat more, and USAir as worth substantially less. In making the USAir purchase, your Chairman displayed exquisite timing: I plunged into the business at almost the exact moment that it ran into severe problems. (No one pushed me; in tennis parlance, I committed an "unforced error.") The company's troubles were brought on both by industry conditions and by the post-merger difficulties it encountered in integrating Piedmont, an affliction I should have expected since almost all airline mergers have been followed by operational turmoil. In short order, Ed Colodny and Seth Schofield resolved the second problem: The airline now gets excellent marks for service. Industry-wide problems have proved to be far more serious. Since our purchase, the economics of the airline industry have deteriorated at an alarming pace, accelerated by the kamikaze pricing tactics of certain carriers. The trouble this pricing has produced for all carriers illustrates an important truth: In a business selling a commodity- type product, it's impossible to be a lot smarter than your dumbest competitor. However, unless the industry is decimated during the next few years, our USAir investment should work out all right. Ed and Seth decisively addressed the current turbulence by making major changes in operations. Even so, our investment is now less secure than at the time I made it. Our convertible preferred stocks are relatively simple securities, yet I should warn you that, if the past is any guide, you may from time to time read inaccurate or misleading statements about them. Last year, for example, several members of the press calculated the value of all our preferreds as equal to that of the common stock into which they are convertible. By their logic, that is, our Salomon preferred, convertible into common at $38, would be worth 60% of face value if Salomon common were selling at $22.80. But there is a small problem with this line of reasoning: Using it, one must conclude that all of a value of a convertible preferred resides in the conversion privilege and that value of a nonconvertible preferred of Salomon would be zero, no matter what its coupon or terms for redemption. The point you should keep in mind is that most of the value of our convertible preferreds is derived from their fixed-income characteristics. That means the securities cannot be worth less than the value they would possess as non-convertible preferreds and may be worth more because of their conversion options. Berkshire made five private purchases of convertible preferred stocks during the 1987-91 period and the time seems right to discuss their status. In each case we had the option of sticking with these preferreds as fixed-income securities or converting them into common stock. Initially, their value to us came primarily from their fixedincome characteristics. The option we had to convert was a kicker. Our $300 million private purchase of American Express "Peres" . . . was a modified form of common stock whose fixedincome characteristics contributed only a minor portion of its initial value. Three years after we bought them, the Peres automatically were converted to common stock. In contrast, [our other convertible preferred stocks] were set to become common stocks only if we wished them to-a crucial difference. When we purchased our convertible securities, I told you that we expected to earn after-tax returns from them that "moderately" exceeded what we could earn from the medium-term fixed-income securities they replaced. We beat this expectation-but only because of the performance of a single issue. I also told you that these securities, as a group, would "not produce the returns we can achieve when we find a business with wonderful economic prospects." Unfortunately, that prediction was fulfilled. Finally, I said that "under almost any conditions, we expect these preferreds to return us our money plus dividends." That's one I would like to have back. Winston Churchill once said that "eating my words has never given me indigestion." My assertion, however, that it was almost impossible for us to lose money on our preferreds has caused me some well-deserved heartburn. Our best holding has been Gillette, which we told you from the start was a superior business. Ironically, though, this is also the purchase in which I made my biggest mistake-of a kind, however, never recognized on financial statements. We paid $600 million in 1989 for Gillette preferred shares that were convertible into 48 million (split-adjusted) common shares. Taking an alternative route with the $600 million, I probably could have purchased 60 million shares of common from the company. The market on the common was then about $10.50, and given that this would have been a huge private placement carrying important restrictions, I probably could have bought the stock at a discount of at least 5%. I can't be sure about this, but it's likely that Gillette's management would have been just as happy to have Berkshire opt for common. But I was far too clever to do that. Instead, for less than two years, we received some extra dividend income (the difference between the preferred's yield and that of the common), at which point the company-quite properly-called the issue, moving to do that as quickly as was possible. If I had negotiated for common rather than preferred, we would have been better off at yearend 1995 by $625 million, minus the "excess" dividends of about $70 million. In the case of Champion, the ability of the company to call our preferred at 115% of cost forced a move out of us last August that we would rather have delayed. In this instance, we converted our shares just prior to the pending call and offered them to the company at a modest discount. Charlie and I have never had a conviction about the paper industry-actually, I can't remember ever owning the common stock of a paper producer in my 54 years of investing-so our choice in August was whether to sell in the market or to the company..., Our Champion capital gain was moderate-about 19% after tax from a six-year investment-but the preferred delivered us a good after-tax dividend yield throughout our holding period. (That said, many press accounts have overstated the after-tax yields earned by property-casualty insurance companies on dividends paid to them. What the press has failed to take into account is a change in the tax law that took effect in 1987 and that significantly reduced the dividends received credit applicable to insurers. For details, see [Part V.H.].) Our First Empire preferred [was to] be called on March 31, 1996, the earliest date allowable. We are comfortable owning stock in well-run banks, and we will convert and keep our First Empire common shares. Bob Wilmers, CEO of the company, is an outstanding banker, and we love being associated with him. Our other two preferreds have been disappointing, though the Salomon preferred has modestly outperformed the fixed-income securities for which it was a substitute. However, the amount of management time Charlie and I have devoted to this holding has been vastly greater than its economic significance to Berkshire. Certainly I never dreamed I would take a new job at age 60-Salomon interim chairman, that is-because of an earlier purchase of a fixed-income security. Soon after our purchase of the Salomon preferred in 1987, I wrote that I had "no special insights regarding the direction or future profitability of investment banking." Even the most charitable commentator would conclude that I have since proved my point. To date, our option to convert into Salomon common has not proven of value. Furthermore, the Dow Industrials have doubled since I committed to buy the preferred, and the brokerage group has performed equally as well. That means my decision to go with Salomon because I saw value in the conversion option must be graded as very poor. Even so, the preferred has continued under some trying conditions to deliver as a fixed-income security, and the 9% dividend is currently quite attractive. Unless the preferred is converted, its terms require redemption of 20% of the issue on October 31 of each year, 1995-99, and $140 million of our original $700 million was taken on schedule last year. (Some press reports labeled this a sale, but a senior security that matures is not "sold.") Though we did not elect to convert the preferred that matured last year, we have four more bites at the conversion apple, and I believe it quite likely that we will yet find value in our right to convert.
In: Finance
In 1997, 35 countries signed the convention of the Organization for Economic Cooperation and Development (OECD) to make it a crime to bribe foreign officials. In May 1999, the OECD issued a series of six principles (updated in 2004) that have since become the basis of the corporate governance position of the World Bank and the International Monetary Fund (IMF). However, in 2015 alone:
In February 2015, Goodyear Tire and Rubber Co. agreed to pay $16.2 million to settle charges from the SEC under FCPA for the payment of bribes in Kenya and Angola to increase tire sales. Goodyear subsidiaries were accused of paying more than $3.2 million in bribes to employees of state-owned and private companies between 2007 and 2011.
In May 2015, BHP Billiton paid $25 million to settle SEC charges in relation to FCPA offenses. BHP had been accused of improperly sponsoring foreign government officials as guests at the 2008 Summer Olympics in Beijing, China. The case was settled through an internal administrative order without going to court.
In July 2015, New Jersey-based construction management company Louis Berger International paid $17.1 million to resolve FCPA criminal offenses. In the resolution, the company admitted paying bribes to foreign officials in India, Indonesia, Kuwait, and Vietnam in order to win contracts. The settlement included a deferred prosecution agreement that will require a compliance monitor for at least three years.
In September 2015, Hitachi Ltd. paid $19 million to resolve SEC charges. The case was brought in relation to payments made to South Africa’s ruling page 123political party in connection with contracts to build two multimillion-dollar power plants.
American companies operating under increasing federal and regulatory scrutiny face real consequences from trying to do business in a global business environment in which foreign business seems to function on the basis of “gifts” at every stage of the transaction.
In December 2012, the SEC charged Eli Lilly and Co. with violations of the FCPA for improper payments made by subsidiaries to foreign government officials in Russia, Brazil, China, and Poland; and accepted a settlement in the amount of $29 million for offenses including the following:
The SEC alleged that the Indianapolis-based pharmaceutical company’s subsidiary in Russia used offshore ‘marketing agreements’ to pay millions of dollars to third parties chosen by government customers or distributors, despite knowing little or nothing about the third parties beyond their offshore address and bank account information.
Employees at Lilly’s subsidiary in China falsified expense reports in order to provide spa treatments, jewelry, and other improper gifts and cash payments to government-employed physicians.
Lilly’s subsidiary in Poland made eight improper payments totaling $39,000 to a small charitable foundation that was founded and administered by the head of one of the regional government health authorities in exchange for the official’s support for placing Lilly drugs on the government reimbursement list.
In November 2012, the Department of Justice issued a 120-page “Resource Guide” to the FCPA, including numerous case studies designed to clarify what actions would and would not be considered to be violations of the law. The guide was written as a resource for DOJ attorneys, but attorneys in private practice are encouraging their clients to become familiar with it.
QUESTIONS
Answer in your own words
In: Economics
Ask the user for the name of a car maker. Display the oldest and newest car from that maker. Modify your display to include the VIN of the car. Format the output in columns of 15, 25, 5, and 18.
| Standard Input | Files in the same directory |
|---|---|
Toyota |
|
Required Output
What car make are you looking for?\n
Oldest Toyota\n
Toyota MR2 1985 WAUFFAFL2CN997894\n
Newest Toyota\n
Toyota Venza 2013 WAUEH54B01N735764\n
| Standard Input | Files in the same directory |
|---|---|
Chevrolet |
|
Required Output
What car make are you looking for?\n
Oldest Chevrolet\n
Chevrolet Corvair 1960 1N6BF0KM1FN003702\n
Newest Chevrolet\n
Chevrolet Colorado 2012 WVWAA7AJ4BW878497\n
| Standard Input | Files in the same directory |
|---|---|
Lamborghini |
|
Required Output
What car make are you looking for?\n
Oldest Lamborghini\n
Lamborghini Murciélago 2002 3GYFK66N43G898137\n
Newest Lamborghini\n
Lamborghini Reventón 2008 ZHWGU5BR6EL542311\n
| Standard Input | Files in the same directory |
|---|---|
Kia |
|
Required Output
What car make are you looking for?\n
Oldest Kia\n
Kia Sephia 1996 1N6AA0CC7CN222465\n
Newest Kia\n
Kia Forte 2012 2V4RW3D14AR530852\n
| Standard Input | Files in the same directory |
|---|---|
GMC |
|
Required Output
What car make are you looking for?\n
Oldest GMC\n
GMC Jimmy 1992 1YVHZ8BA1A5450350\n
Newest GMC\n
GMC Yukon 2013 1FTFW1E82AK523715\n
| Standard Input | Files in the same directory |
|---|---|
Volvo |
|
Required Output
What car make are you looking for?\n
Oldest Volvo\n
Volvo 850 1995 JH4KC1F95FC996591\n
Newest Volvo\n
Volvo S60 2011 WA1DGAFE7ED674601\n
Heres cars.txt that you wanted:
make model year Ford Expedition 2003 Mazda B-Series 1989 Ford Freestar 2003 Hyundai Elantra 2001 Hyundai Entourage 2008 Chevrolet Camaro 2011 Chevrolet Monte Carlo 2006 Chevrolet Blazer 1996 Chevrolet Aveo 2005 Chevrolet Corvette 1999 Mercedes-Benz E-Class 2006 Dodge Avenger 1995 Pontiac Grand Prix 1973 Mitsubishi Outlander 2011 MINI Clubman 2011 Suzuki Aerio 2007 Dodge Dakota Club 1992 Chevrolet Astro 2002 Chevrolet Tahoe 1996 Mitsubishi Mirage 1994 Porsche 944 1991 Hyundai Elantra 1994 Mercury Grand Marquis 1998 Volkswagen Golf 2001 Jaguar XJ Series 2005 Toyota Echo 2005 GMC Safari 2002 GMC Sierra 1500 2000 Chevrolet Cobalt 2005 Jeep Patriot 2008 Mazda Navajo 1991 Chevrolet Malibu 2001 Saab 900 1990 Mercury Grand Marquis 1998 Hummer H1 2004 Subaru Loyale 1993 Jeep Wrangler 1999 Ford Mustang 1994 Austin Mini Cooper S 1963 Mercedes-Benz M-Class 1998 Jeep Wrangler 2006 Honda Civic 1997 Plymouth Voyager 1994 Ford Club Wagon 1997 Audi 5000S 1984 Saturn VUE 2003 Oldsmobile Achieva 1994 Mercedes-Benz G55 AMG 2006 Chevrolet Express 3500 1997 Lexus ES 1992 Cadillac Allante 1992 Hyundai Tiburon 1997 Pontiac Grand Prix 1965 Ford Focus 2000 Mitsubishi Chariot 1987 Chrysler Prowler 2001 Land Rover Discovery 2012 Volkswagen Scirocco 1984 Ford Bronco 1984 Hyundai Accent 1996 Volkswagen Routan 2012 Volkswagen Golf 2003 GMC Terrain 2010 Ford F150 2009 GMC Sierra 2011 Dodge Ram Van 1500 2000 Chrysler 300 2009 Oldsmobile Achieva 1997 Land Rover Discovery 2008 Toyota 4Runner 2002 Porsche 911 1995 Toyota Land Cruiser 2002 Land Rover Defender 1994 Chevrolet Lumina 1997 Audi TT 2002 Chrysler Town & Country 2009 Nissan Frontier 2000 Toyota Tercel 1997 Buick Riviera 1997
I would prefer the sorting algorithm types like Bubble and Selection searches if you can. If you want car-list.txt, I can't put it in the question because it was too long. Make sure this in Java and also have notes on the program and the right formatting, thank you.
In: Computer Science
insert code in all TODO part, it's about pointer. atmel studio 7.0. this should be able to run without utilities.h
// includes
#include <asf.h>
// function prototypes
// these are necessary if you are going to call a function before
it is declared
// without these, we would have to put all of our functions above
main
static void configure_console(void);
void get_matrix(int *matrix);
int calc_det(int *matrix);
void get_matrix_global(void);
// declare global variables
int matrix_global[9];
int main (void)
{
// configure system
board_init();
sysclk_init();
configure_console();
printf("\nStarting Determinant Calculator\r\n\n");
// declare constants
const int NUM_METHODS = 3;
// declare button variables
bool prev_button_state = BUTTON_0_INACTIVE;
bool current_button_state = BUTTON_0_INACTIVE;
// create a fixed-sized int array with 9 elements and
initialize elements to 0
// name = matrix_array
/***TODO - 1 line***/
// create an int pointer and point it to NULL
// name = matrix_dynamic
/***TODO - 1 line***/
// create an int pointer and point it to NULL
// name = matrix
/***TODO - 1 line***/
// create a variable to keep up with what method to
run
int method = 0;
// create a variable for the determinant that you
calculate
int det = 0;
while (1)
{
// typical edge detection for
button
current_button_state =
ioport_get_pin_level(BUTTON_0_PIN);
if ( (current_button_state ==
BUTTON_0_ACTIVE) && (prev_button_state ==
BUTTON_0_INACTIVE))
{
// Method 0:
Pass matrix_array into get_matrix
if((method %
NUM_METHODS) == 0)
{
printf("Method 0: Pass matrix_array into
get_matrix\r\n");
// use get_matrix to get a 3x3 matrix from the
user
// pass in matrix_array so that it can be
updated with user data
/***TODO - 1 line***/
// point matrix to matrix_array
/***TODO - 1 line***/
}
// Method 1:
Update a global array with user input
else if((method
% NUM_METHODS) == 1)
{
printf("Method 1: Update a global array with
user input\r\n");
// use get_matrix_global to get a 3x3 matrix
from the user
// no arguments are passed in, as this function
just updates
// the global matrix, matrix_global
/***TODO - 1 line***/
// point matrix to matrix_global
/***TODO - 1 line***/
}
// Method 2:
Dynamically allocate an array using malloc
else if((method
% NUM_METHODS) == 2)
{
printf("Method 2: Dynamically allocate an array
using malloc\r\n");
// use malloc to dynamically allocate an array
that can hold 9 integer values
// this allocates the array on the heap, and it
must be freed once we are done
// with it, or else we will have a memory
leak
/***TODO - 1 line***/
// pass in matrix_dynamic to get_matrix so that
it can be updated with user data
/***TODO - 1 line ***/
// point matrix to matrix_dynamic
/***TODO - 1 line ***/
}
// calculate the
determinant of the matrix
/***TODO - 1
line***/
// print
calculated determinant value
printf("\r\n ***
Determinant = %d\r\n\r\n", det);
// free
matrix_dynamic if necessary
/***TODO -
multiple lines ***/
// increment
method so that it uses the next method
method++;
}
}
}
// typical configure_console
static void configure_console(void)
{
const usart_serial_options_t uart_serial_options
=
{
.baudrate =
CONF_UART_BAUDRATE,
.charlength =
CONF_UART_CHAR_LENGTH,
.paritytype =
CONF_UART_PARITY,
.stopbits =
CONF_UART_STOP_BITS,
};
/* Configure console. */
stdio_serial_init(CONF_UART,
&uart_serial_options);
}
// get a 3x3 matrix from user input and store it in the
// matrix that was passed into the function
// note that I could've made the parameter be
// int matrix[9] and it would do the same thing
void get_matrix(int *matrix)
{
unsigned char n;
printf("Please press any key, then enter a 3x3
matrix\r\n");
// press any key to start
// usart_serial_getchar waits for one character from
Putty
usart_serial_getchar((Usart *)CONF_UART,
&n);
// now get the 9 elements of the matrix
for(int i=0; i<9; ++i)
{
printf("Element %d: ", i);
usart_serial_getchar((Usart
*)CONF_UART, &n);
// convert the ascii character from
Putty to an integer
matrix[i] = (int) n - '0';
// reflect the value back to
Putty
printf("%d\r\n", matrix[i]);
}
printf("Matrix entry complete\r\n");
}
// get a 3x3 matrix from user input and store it in the
// global matrix that was declare in the global namespace
void get_matrix_global(void)
{
unsigned char n;
printf("Please press any key, then enter a 3x3
matrix\r\n");
// press any key to start
// usart_serial_getchar waits for one character from
Putty
usart_serial_getchar((Usart *)CONF_UART,
&n);
// now get the 9 elements of the matrix
for(int i=0; i<9; ++i)
{
printf("Element %d: ", i);
usart_serial_getchar((Usart
*)CONF_UART, &n);
// convert the ascii character from
Putty to an integer
matrix_global[i] = (int) n -
'0';
// reflect the value back to
Putty
printf("%d\r\n",
matrix_global[i]);
}
printf("Matrix entry complete\r\n");
}
// calculate the determinant of a 3x3 matrix and return the
value
int calc_det(int matrix[9])
{
int cof1 =
matrix[0]*(matrix[4]*matrix[8]-matrix[5]*matrix[7]);
int cof2 =
matrix[1]*(matrix[3]*matrix[8]-matrix[5]*matrix[6]);
int cof3 =
matrix[2]*(matrix[3]*matrix[7]-matrix[4]*matrix[6]);
int det = cof1 - cof2 + cof3;
return det;
}
In: Computer Science
For the case study section only: Please only provide short answers for the case study No more than 2 sentence response. Answer all the questions in all case study scenarios.
Mason is a 7-year-old boy who is at his primary care physician for a routine physical examination. Mason’s mother expresses concern about childhood obesity and is worried that he sleeps too much.
Subjective Data: Mason has been eating more than usual. Mason sleeps between 11 and 12 hours a day. Mason plays team soccer.
Objective Data
Height: 121 cm
Weight: 23 kg
Vital signs: temp, 37º C; pulse, 78 bpm; resp, 22 breaths/min; blood pressure, 102/62 mm Hg
Height: 90 cm
Mason has a normal physical examination for his age.
Questions:
Caroline is an 11-year-old girl who has an inoperable brain tumor. Caroline has been admitted for palliative care. Her mother, father, and two siblings are with her.
Subjective Data: Caroline complains of a severe headache. She states that she is “afraid to be alone.”
Objective Data
Vital signs: temp, 37.8º C; pulse, 120 bpm; resp, 24 breaths/min; blood pressure, 110/60 mm Hg
Caroline is unable to walk unassisted.
Her pupils are unequal 4 mm right and 6 mm left.
Questions:
3. Case Study: Hyphema
Johnny is a 10-year-old boy who seeks care after being hit in the right eye with a stuffed snake by his brother 15 minutes before arrival.
Subjective Data: Johnny complains of light sensitivity. Vision in the right eye is blurred.
Objective Data
Vital signs: temp, 36.8º C; pulse, 90 bpm; resp, 18 breaths/min; blood pressure, 110/60 mm Hg
Pupils: Left, 3 mm briskly reactive to light. Right, 3 mm and sluggishly reactive to light
Visual acuity: Right eye unable to see chart; left eye 20/15
Approximately a 30% hemorrhage is noted to the anterior chamber of the right eye with an intact globe.
Questions:
In: Nursing
For the case study section only: Please only provide short answers for the case study No more than 2 sentence response. Answer all the questions in all case study scenarios.
Mason is a 7-year-old boy who is at his primary care physician for a routine physical examination. Mason’s mother expresses concern about childhood obesity and is worried that he sleeps too much.
Subjective Data: Mason has been eating more than usual. Mason sleeps between 11 and 12 hours a day. Mason plays team soccer.
Objective Data
Height: 121 cm
Weight: 23 kg
Vital signs: temp, 37º C; pulse, 78 bpm; resp, 22 breaths/min; blood pressure, 102/62 mm Hg
Height: 90 cm
Mason has a normal physical examination for his age.
Questions:
Caroline is an 11-year-old girl who has an inoperable brain tumor. Caroline has been admitted for palliative care. Her mother, father, and two siblings are with her.
Subjective Data: Caroline complains of a severe headache. She states that she is “afraid to be alone.”
Objective Data
Vital signs: temp, 37.8º C; pulse, 120 bpm; resp, 24 breaths/min; blood pressure, 110/60 mm Hg
Caroline is unable to walk unassisted.
Her pupils are unequal 4 mm right and 6 mm left.
Questions:
3. Case Study: Hyphema
Johnny is a 10-year-old boy who seeks care after being hit in the right eye with a stuffed snake by his brother 15 minutes before arrival.
Subjective Data: Johnny complains of light sensitivity. Vision in the right eye is blurred.
Objective Data
Vital signs: temp, 36.8º C; pulse, 90 bpm; resp, 18 breaths/min; blood pressure, 110/60 mm Hg
Pupils: Left, 3 mm briskly reactive to light. Right, 3 mm and sluggishly reactive to light
Visual acuity: Right eye unable to see chart; left eye 20/15
Approximately a 30% hemorrhage is noted to the anterior chamber of the right eye with an intact globe.
Questions:
In: Nursing
Write a program that displays all the cars in the given file (no sorting). Each car property is separated by a tab character: \t
Given file:
cars.txt
make model year Ford Expedition 2003 Mazda B-Series 1989 Ford Freestar 2003 Hyundai Elantra 2001 Hyundai Entourage 2008 Chevrolet Camaro 2011 Chevrolet Monte Carlo 2006 Chevrolet Blazer 1996 Chevrolet Aveo 2005 Chevrolet Corvette 1999 Mercedes-Benz E-Class 2006 Dodge Avenger 1995 Pontiac Grand Prix 1973 Mitsubishi Outlander 2011 MINI Clubman 2011 Suzuki Aerio 2007 Dodge Dakota Club 1992 Chevrolet Astro 2002 Chevrolet Tahoe 1996 Mitsubishi Mirage 1994 Porsche 944 1991 Hyundai Elantra 1994 Mercury Grand Marquis 1998 Volkswagen Golf 2001 Jaguar XJ Series 2005 Toyota Echo 2005 GMC Safari 2002 GMC Sierra 1500 2000 Chevrolet Cobalt 2005 Jeep Patriot 2008 Mazda Navajo 1991 Chevrolet Malibu 2001 Saab 900 1990 Mercury Grand Marquis 1998 Hummer H1 2004 Subaru Loyale 1993 Jeep Wrangler 1999 Ford Mustang 1994 Austin Mini Cooper S 1963 Mercedes-Benz M-Class 1998 Jeep Wrangler 2006 Honda Civic 1997 Plymouth Voyager 1994 Ford Club Wagon 1997 Audi 5000S 1984 Saturn VUE 2003 Oldsmobile Achieva 1994 Mercedes-Benz G55 AMG 2006 Chevrolet Express 3500 1997 Lexus ES 1992 Cadillac Allante 1992 Hyundai Tiburon 1997 Pontiac Grand Prix 1965 Ford Focus 2000 Mitsubishi Chariot 1987 Chrysler Prowler 2001 Land Rover Discovery 2012 Volkswagen Scirocco 1984 Ford Bronco 1984 Hyundai Accent 1996 Volkswagen Routan 2012 Volkswagen Golf 2003 GMC Terrain 2010 Ford F150 2009 GMC Sierra 2011 Dodge Ram Van 1500 2000 Chrysler 300 2009 Oldsmobile Achieva 1997 Land Rover Discovery 2008 Toyota 4Runner 2002 Porsche 911 1995 Toyota Land Cruiser 2002 Land Rover Defender 1994 Chevrolet Lumina 1997 Audi TT 2002 Chrysler Town & Country 2009 Nissan Frontier 2000 Toyota Tercel 1997 Buick Riviera 1997
Output needed:
Required Output
Ford Expedition 2003\n
Mazda B-Series 1989\n
Ford Freestar 2003\n
Hyundai Elantra 2001\n
Hyundai Entourage 2008\n
Chevrolet Camaro 2011\n
Chevrolet Monte Carlo 2006\n
Chevrolet Blazer 1996\n
Chevrolet Aveo 2005\n
Chevrolet Corvette 1999\n
Mercedes-Benz E-Class 2006\n
Dodge Avenger 1995\n
Pontiac Grand Prix 1973\n
Mitsubishi Outlander 2011\n
MINI Clubman 2011\n
Suzuki Aerio 2007\n
Dodge Dakota Club 1992\n
Chevrolet Astro 2002\n
Chevrolet Tahoe 1996\n
Mitsubishi Mirage 1994\n
Porsche 944 1991\n
Hyundai Elantra 1994\n
Mercury Grand Marquis 1998\n
Volkswagen Golf 2001\n
Jaguar XJ Series 2005\n
Toyota Echo 2005\n
GMC Safari 2002\n
GMC Sierra 1500 2000\n
Chevrolet Cobalt 2005\n
Jeep Patriot 2008\n
Mazda Navajo 1991\n
Chevrolet Malibu 2001\n
Saab 900 1990\n
Mercury Grand Marquis 1998\n
Hummer H1 2004\n
Subaru Loyale 1993\n
Jeep Wrangler 1999\n
Ford Mustang 1994\n
Austin Mini Cooper S 1963\n
Mercedes-Benz M-Class 1998\n
Jeep Wrangler 2006\n
Honda Civic 1997\n
Plymouth Voyager 1994\n
Ford Club Wagon 1997\n
Audi 5000S 1984\n
Saturn VUE 2003\n
Oldsmobile Achieva 1994\n
Mercedes-Benz G55 AMG 2006\n
Chevrolet Express 3500 1997\n
Lexus ES 1992\n
Cadillac Allante 1992\n
Hyundai Tiburon 1997\n
Pontiac Grand Prix 1965\n
Ford Focus 2000\n
Mitsubishi Chariot 1987\n
Chrysler Prowler 2001\n
Land Rover Discovery 2012\n
Volkswagen Scirocco 1984\n
Ford Bronco 1984\n
Hyundai Accent 1996\n
Volkswagen Routan 2012\n
Volkswagen Golf 2003\n
GMC Terrain 2010\n
Ford F150 2009\n
GMC Sierra 2011\n
Dodge Ram Van 1500 2000\n
Chrysler 300 2009\n
Oldsmobile Achieva 1997\n
Land Rover Discovery 2008\n
Toyota 4Runner 2002\n
Porsche 911 1995\n
Toyota Land Cruiser 2002\n
Land Rover Defender 1994\n
Chevrolet Lumina 1997\n
Audi TT 2002\n
Chrysler Town & Country 2009\n
Nissan Frontier 2000\n
Toyota Tercel 1997\n
Buick Riviera 1997\n
My program so far:
import java.io.*;
import java.util.Scanner;
public class PS1{
public static void main(String[] args) {
try{
Scanner scnr = new Scanner(new File("cars.txt"));
String headings = scnr.nextLine();
String line;
String make;
StringBuilder model;
String temp;
int year=0;
while(scnr.hasNext()){
line = scnr.nextLine();
Scanner scnr2 = new Scanner(line);
make = scnr2.next();
model = new StringBuilder(scnr2.next());
while(scnr2.hasNext()){
temp = scnr2.next();
if(scnr2.hasNext())
model.append(" ").append(temp);
else
year = Integer.parseInt(temp);
}
System.out.printf("%15s%25s%5s\n", make, model.toString(), year);
}
scnr.close();
}catch(FileNotFoundException e){
System.out.println(e.getMessage());
}
}
}
My output:
Your Program's Output
Ford Expedition 2003\n
Mazda B-Series 1989\n
Ford Freestar 2003\n
Hyundai Elantra 2001\n
Hyundai Entourage 2008\n
Chevrolet Camaro 2011\n
Chevrolet Monte Carlo 2006\n
Chevrolet Blazer 1996\n
Chevrolet Aveo 2005\n
Chevrolet Corvette 1999\n
Mercedes-Benz E-Class 2006\n
Dodge Avenger 1995\n
Pontiac Grand Prix 1973\n
Mitsubishi Outlander 2011\n
MINI Clubman 2011\n
Suzuki Aerio 2007\n
Dodge Dakota Club 1992\n
Chevrolet Astro 2002\n
Chevrolet Tahoe 1996\n
Mitsubishi Mirage 1994\n
Porsche 944 1991\n
Hyundai Elantra 1994\n
Mercury Grand Marquis 1998\n
Volkswagen Golf 2001\n
Jaguar XJ Series 2005\n
Toyota Echo 2005\n
GMC Safari 2002\n
GMC Sierra 1500 2000\n
Chevrolet Cobalt 2005\n
Jeep Patriot 2008\n
Mazda Navajo 1991\n
Chevrolet Malibu 2001\n
Saab 900 1990\n
Mercury Grand Marquis 1998\n
Hummer H1 2004\n
Subaru Loyale 1993\n
Jeep Wrangler 1999\n
Ford Mustang 1994\n
Austin Mini Cooper S 1963\n
Mercedes-Benz M-Class 1998\n
Jeep Wrangler 2006\n
Honda Civic 1997\n
Plymouth Voyager 1994\n
Ford Club Wagon 1997\n
Audi 5000S 1984\n
Saturn VUE 2003\n
Oldsmobile Achieva 1994\n
Mercedes-Benz G55 AMG 2006\n
Chevrolet Express 3500 1997\n
Lexus ES 1992\n
Cadillac Allante 1992\n
Hyundai Tiburon 1997\n
Pontiac Grand Prix 1965\n
Ford Focus 2000\n
Mitsubishi Chariot 1987\n
Chrysler Prowler 2001\n
Land Rover Discovery 2012\n
Volkswagen Scirocco 1984\n
Ford Bronco 1984\n
Hyundai Accent 1996\n
Volkswagen Routan 2012\n
Volkswagen Golf 2003\n
GMC Terrain 2010\n
Ford F150 2009\n
GMC Sierra 2011\n
Dodge Ram Van 1500 2000\n
Chrysler 300 2009\n
Oldsmobile Achieva 1997\n
Land Rover Discovery 2008\n
Toyota 4Runner 2002\n
Porsche 911 1995\n
Toyota Land Cruiser 2002\n
Land Rover Defender 1994\n
Chevrolet Lumina 1997\n
Audi TT 2002\n
Chrysler Town & Country 2009\n
Nissan Frontier 2000\n
Toyota Tercel 1997\n
Buick Riviera 1997\n
When mine outputs Land Rover is separated and Rover is put with the model, can someone help me fix this, thank you. Keep this in Java.
In: Computer Science