Questions
Write a C++ program, all the answers so far on this site have been wrong when...

Write a C++ program, all the answers so far on this site have been wrong when I compiled them.. Desired outputs at the end.

--In this exercise, you are to modify the Classified Numbers programming example in this chapter. As written, the program inputs the data from the standard input device (keyboard) and outputs the results on the standard output device (terminal screen). The program can process only 20 numbers. Rewrite the program to incorporate the following requirements:

a) Data to the program is input from a file of an unspecified length named Ch06_Ex20Data.txt; that is , the program does not know in advance how many numbers are in the file.

b) Save the output of the program in a file named Ch06_Ex20Out.txt.

c) Modify the void function getNumber so that it reads a number from the input file (opened in the function main), outputs the number to the output file (opened in the function main), and sends the number read to the function main. Print only 10 numbers per line. Assume all numbers are between -9999 and 9999.

d) Have the program find the sum and average of the numbers.

e) Modify the function printResult so that it outputs the final results to the output file (opened in the function main). Other than outputting the appropriate counts, this new definition of the function printResult should also output the sum of the numbers

Outputs in the program should look like this:

Processing Data

There are 27 evens, which includes 12 zeros

Total number of odds are: 16

The sum of numbers = 558

The average is 12

press any key to exit.

The OutFile should look like this

E:\FolderName\Lab\Ch06_Ex20> type Ch06_Ex20Out.txt

43 67 82 0 35 28 -64 7 -87 0

0 0 0 12 23 45 7 -2 -8 -3

-9 4  0 1 0  -7 23 -24 0 0

12 62 100 101 -203 -340 500 0 23 0

54 0 76

There are 27 evens, which includes 12 zeros

Total number of odds are: 16

The sum of numbers = 558

The average is 12

E:\FolderName\Lab\Ch06_Ex20>

In: Computer Science

Japan and Germany are two success stories of economic growth. Although today they are economic superpowers,...

Japan and Germany are two success stories of economic growth. Although today they are economic superpowers, in 1945 the economies of both countries were in shambles. World

War II had destroyed much of their capital stocks. In the decades after the war, however, these two countries experienced some of the most rapid growth rates on record. Between

1948 and 1972, output per person grew at 8.2 percent per year in Japan and 5.7 percent per year in Germany, compared to only 2.2 percent per year in the United States. Are the

postwar experiences of Japan and Germany so surprising from the standpoint of the Solow growth model? Consider an economy in steady state. Now suppose that a war

destroys some of the capital stock. (That is, suppose the capital stock drops from k* to k1).

Not surprisingly, the level of output falls immediately. But if the saving rate the fraction of output devoted to saving and investment is unchanged, the economy will then

experience a period of high growth. Output grows because, at the lower capital stock, more capital is added by investment than is removed by depreciation. This high growth

continues until the economy approaches its former steady state. Hence, although destroying part of the capital stock immediately reduces output, it is followed by higher than

normal growth. The “miracle’’ of rapid growth in Japan and Germany, as it is often described in the business press, is what the Solow model predicts for countries in which

war has greatly reduced the capital stock. In this discussion of German and Japanese postwar growth, capital stock is destroyed in a war. By contrast, suppose that a war does not affect

the capital stock, but that casualties reduce the labor force.

a) What is the immediate impact on total output and on output per person? Compare how the effect would be different from the above case.

b) Assuming that the savings rate is unchanged, and that the economy was in a steady state before the war, what happens subsequently to output per worker in the postwar

economy? Is the growth rate of output per worker after the war smaller or greater than normal?

no

rmal?

In: Economics

package edu.depaul.triangle; import java.util.Scanner; /** * A class to classify a set of side lengths as...

package edu.depaul.triangle;

import java.util.Scanner;

/**

* A class to classify a set of side lengths as one of the 3 types

* of triangle: equilateral, isosceles, or scalene.

* If classification is not possible it emits an error message

*/

public class Triangle {

/**

* Define as private so that it is not a valid

* choice.

*/

private Triangle() {}

public Triangle(String[] args) {

//

// TODO: keep this simple. Constructors should not do a lot of work

//

}

// TODO: Add methods to validate input, and classify the triangle (if possible) here

private static String[] getArgs(Scanner s) {

System.out.println("press Enter by itself to quit");

System.out.println("enter 3 integers separated by space.");

String args = s.nextLine();

return args.split(" ");

}

public static void main(String[] a) {

try (Scanner scanner = new Scanner(System.in)) {

String[] args = getArgs(scanner);

// Loop until the user enters an empty line

while(args[0].length() !=0) {

//

// TODO: create a new Triangle here and call it

//

args = getArgs(scanner);

}

System.out.println("Done");

}

}

Write a Java program to determine types of triangles. The program reads 3 values from the standard input. The values represent the lengths of the sides of a triangle. The program prints a message to the standard output that indicates whether the triangle represented by the input is • an equilateral (all 3 sides are equal), or • an isosceles (exactly 2 of the 3 sides are equal), or • a scalene (all 3 sides are of different lengths) Expected behavior: a. The user enters 3 values at a prompt and presses return b. The values must be converted to integers. If they cannot be converted, the system displays an error. c. The valid values for these integers are values from 1 to and including 300. Any other integers should cause an error to be shown to the user. d. The values are delimited with spaces e. The system evaluates the results, shows either a triangle type or an error, then prompts for input again. f. When the user enters a blank line followed by return, the program ends. g. An error is shown whenever the user’s input cannot be interpreted as a triangle or when the handling of the input results in exception.

In: Computer Science

#include <stdlib.h> #include <stdio.h> #include <string.h> void clrScreen(int lines){     int i = 0;     for( i =...

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

void clrScreen(int lines){

    int i = 0;

    for( i = 0; i < lines; ++i ){

        printf("\n");

    }

    return;

}

void printRules(void){

    printf("\t|*~*~*~*~*~*~*~*~*~ How to Play ~*~*~*~*~*~*~*~*~*~|\n");

    printf("\t|   This is a 2 player game. Player 1 enters the   |\n");

    printf("\t|   word player 2 has to guess. Player 2 gets a    |\n");

    printf("\t|   number of guesses equal to twice the number    |\n");

    printf("\t|   of characters. EX: If the word is 'example'    |\n");

    printf("\t|   player 2 gets 14 guesses.                      |\n");

    printf("\t|*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~|\n");

    clrScreen(10);

    return;

}

//------------------------------------------------------------------------------------------------------------

/* /\DO NOT MODIFY ABOVE THIS LINE /\*/

void playGame(){

int correctGuess = 1;

    char garbage;

clrScreen(40);

    printRules();

    printf("Player 1: Enter a word smaller than 50 characters: ");

    clrScreen(40);

    if( -1 == correctGuess ){

        printf("CoNgRaTuLaTiOnS!!!!!! You figured out the word!!!\n");

        printf("\t\t%s\n");

    } else {

        printf("You didn't figure out the word.....it was %s\n");

        printf("Better luck next time!\n");

    }

    printf("Press 'enter' to continue to main menu.\n");

    scanf("%c", &garbage);

}

int menu(void){

    int loop = 1;

    while( loop ){

        clrScreen(40);

        printf("*~*~*~*~*~*~*~*~*~*~Welcome to Hangman!*~*~*~*~*~*~*~*~*~*~\n");

        printf("\t1.) Play the game\n");

        printf("\t2.) Quit\n");

        printf("Please make a selection: ");

    }

}

/*

    hangman game RULES:

    2 player game

        player 1

            enter a word for player 2 to guess

            enter a number of guesses player 2 gets to have. It must be at least 2x as big

                as the number of letters in the word.

            For example, if you enter the word 'sky' you must give the player at least 6 guesses.

        player 2

            try to guess the word player 1 has entered.

            you get X number of guesses

*/

int main(void){

    return 0;

}

//In c programming language

//please help me finish this hangman program. Thank you.

In: Computer Science

In which society/societies does the balance of power between men and women shift to men? Select...

In which society/societies does the balance of power between men and women shift to men? Select one:

A. Hunting and Gathering B. Industrial C. Postindustrial D. Horticultural and Agricultural

Which of the following family names is a member of the lower-upper class or the "nouveau riche"? Select one:

A. Bill and Melinda Gates, who founded Microsoft B. the DuPont family, who arrived in America in the 18th century C. the Carnegie family, who built America's steel empire D. the Rockefeller family, who became the oil barons of the 19th century

When it comes to race relations this is an important principle to understand: Select one:

A. People act on perceptions and beliefs, not facts. B. There are only four pure races. C. Interracial marriage, the superior race gets inferior traits. D. Race is one of the most important reasons that people do what they do.

Policies set by the federal government largely determined the fate of ______. These policies evolved through several stages which includes separation, extermination, and forced assimilation. Select one:

A. Native Americans B. Mexican Americans C. Japanese Americans D. African Americans

According to this perspective, children must first learn the meaning of "girl" and "boy" and then place themselves in the appropriate category. Select one:

A. Gender equity B. Symbolic Interactionist C. Conflict D. Functionalist

Within a _____ system, a fixed social position is determined at birth; within a _____ system, a person's social position can change over time. Select one:

A. Caste; Class B. Party; Status C. Educational; Income D. Class; Caste

_____ are one of the most disadvantaged groups in the United States. Anywhere from 50 to 80 percent are unemployed and their suicide rate is twice the national average. Select one:

A. African Americans B. Cuban Americans C. Puerto Rican Americans D. Native Americans

According to this ideology, all causes of inequality are related to each other. Thus, the inequality women experience because of their gender may be reinforced by their social class or race. Select one:

a. libertarian b. gender equity c. women's movement d. inclusive feminism

In the winter of 1838-1839, the U.S. Army rounded up 15,000 Cherokees and forced them to walk 1,000 miles from the Carolinas and Georgia to Oklahoma. This event is called: Select one:

A. Trail of Tears B. Native Assimilation C. The Cherokee Roundup D. The Warning Shot

According to this view, the inequality that women experience because of their gender may be reinforced by their social class and racial characteristics. Select one:

A. Inclusive feminism B. Glass ceiling C. Gender equality D. Feminism

In: Economics

1) Describe what happens to the number of chromosomes during the two divisions of meiosis. a)The...

1) Describe what happens to the number of chromosomes during the two divisions of meiosis.

a)The number of chromosomes is halved in the first division of meiosis. In the second division, the number of chromosomes remains the same.
b) The number of chromosomes is doubled in the first division of meiosis. In the second division, the number of chromosomes is halved.
c) The number of chromosomes is halved in the first division of meiosis. In the second division, the number of chromosomes doubles.
d) The number of chromosomes remains the same in the first division of meiosis. In the second division, the number of chromosomes is halved.

2) Why is it necessary that meiosis occurs in sexually reproducing organisms?

a) to maintain the viability of the gametes
b) to ensure that genetic variation is reduced
c) to maintain a constant chromosome number in each generation
d) to ensure evolutionary success

3) Explain how a boy could have his mother’s nose and his father’s ears.

a) independent assortment of chromosomes
b) the movement of homologous pairs during meiosis
c) by receiving his father’s Y chromosome
d) inheritance of intact chromosomes from parents

4) There are multiple ways that the diversity of offspring from the same parents is enhanced. What is the contribution of metaphase I to this diversity?

a) the random orientation of tetrads at the metaphase plate
b) the random alignment of homologous chromosomes when they cross over
c) the formation of chiasmata when the homologous chromosomes line up at the equator
d) the formation of a synaptonemal complex during chromosomal synapsis

5) You sequence a gene of interest and isolate the matching mRNA. You find that the mRNA is considerably shorter than the DNA sequence. Why is that?

a) There was an experimental mistake. The mRNA should have the same length as the gene.
b) The mRNA should be longer than the DNA sequence because the promoter is also transcribed.
c) The processed mRNA is shorter because introns were removed.
d) The mRNA is shorter because the signal sequence to cross the nuclear membrane was removed.

6) Describe the general conditions that must be met at each of the three main cell cycle checkpoints.

a) G1 checkpoint - assessment of DNA damage, G2 - assessment of new DNA, M checkpoint - segregation of sister chromatids in anaphase.
b) G1 checkpoint - Energy reserves for s phase, G2 checkpoint - assessment of new DNA, M checkpoint- attachment of spindle to kinetochore.
c) G1 checkpoint - assessment of DNA damage, G2 checkpoint - energy reserves for duplication, M checkpoint - attachment of spindle to kinetochore
d) G1 checkpoint - Energy reserves for S-phase, S checkpoint - synthesis of DNA, G2 checkpoint - assessment of new DNA

In: Biology

Assume that a Parent company acquires a 75% interest in its Subsidiary on January 1, 2016....

Assume that a Parent company acquires a 75% interest in its Subsidiary on January 1, 2016. On the date of acquisition, the fair value of the 75% controlling interest was $1,800,000 and the fair value of the 25% noncontrolling interest was $600,000. On January 1, 2016, the book value of net assets equaled $2,400,000 and the fair value of the identifiable net assets equaled the book value of identifiable net assets (i.e. there was no AAP or Goodwill). The parent uses the equity method to account for its investment in the subsidiary.

On December 31, 2017, the Subsidiary company issued $1,500,000 (face) 6 percent, five-year bonds to an unaffiliated company for $1,380,218 (i.e. the bonds had an effective yield of 8 percent). The bonds pay interest annually on December 31, and the bond discount is amortized using the straight-line method. This results in annual bond-payable discount amortization equal to $23,956 per year.

On December 31, 2019, the Parent paid $1,540,849 to purchase all of the outstanding Subsidiary company bonds (i.e. the bonds had an effective yield of 5 percent). The bond premium is amortized using the straight-line method, which results in annual bond-investment premium amortization equal to $13,616 per year.

The Parent and the Subsidiary report the following financial statements for the year ended December 31, 2020:

Income Statement

Parent

Subsidiary

Sales

$12,100,000

$1,240,000

Cost of goods sold

(9,060,000)

   (710,000)

Gross Profit

3,040,000

530,000

Income (loss) from subsidiary

131,355

Bond interest income

76,384

Bond interest expense

(113,956)

Operating expenses

(2,030,000)

    (291,000)

Net income

$ 1,217,739

$   125,044

Statement of Retained Earnings

Parent

Subsidiary

BOY Retained Earnings

$8,036,000

$1,115,000

Net income

1,217,739

125,044

Dividends

   (170,000)

   (26,000)

EOY Retained Earnings

$9,083,739

$1,214,044

Balance Sheet

Parent

Subsidiary

Assets:

Cash

$ 1,559,000

$ 596,131

Accounts receivable

3,100,000

    760,000

Inventory

3,105,000

    520,000

Equity Investment

2,027,887

Investment in bonds

1,527,233

PPE, net

    9,700,000

4,450,000

$21,019,120

$6,326,131

Liabilities and Stockholders’ Equity:

Accounts payable

$ 1,650,000

$   620,000

Current Liabilities

1,700,000

       700,000

Bonds payable

    1,452,087

Long-term Liabilities

2,080,000

       750,000

Common Stock

1,020,000

       540,000

APIC

5,485,381

    1,050,000

Retained Earnings

    9,083,739

   1,214,044

$21,019,120

$6,326,131

Required:

Provide the consolidation entries and prepare a consolidation worksheet for the year ended December 31, 2018.

In: Accounting

Assume that a Parent company acquires a 90% interest in its Subsidiary on January 1, 2016....

Assume that a Parent company acquires a 90% interest in its Subsidiary on January 1, 2016. On the date of acquisition, the fair value of the 90% controlling interest was $2,160,000 and the fair value of the 10% noncontrolling interest was $240,000. On January 1, 2016, the book value of net assets equaled $2,400,000 and the fair value of the identifiable net assets equaled the book value of identifiable net assets (i.e. there was no AAP or Goodwill). The subsidiary’s retained earnings balance was $452,000 on the date of acquisition. The parent uses the cost method to account for its investment in the subsidiary.

On December 31, 2017, the Subsidiary company issued $2,000,000 (face) 7 percent, five-year bonds to an unaffiliated company for $2,173,179 (i.e. the bonds had an effective yield of 5 percent). The bonds pay interest annually on December 31, and the bond premium is amortized using the straight-line method. This results in annual bond-payable premium amortization equal to $34,636 per year.

On December 31, 2019, the Parent paid $1,948,458 to purchase all of the outstanding Subsidiary company bonds (i.e. the bonds had an effective yield of 8 percent). The bond discount is amortized using the straight-line method, which results in annual bond-investment discount amortization equal to $17,181 per year.

The Parent and the Subsidiary report the following financial statements for the year ended December 31, 2020:

Income Statement

Parent

Subsidiary

Sales

$12,500,000

$1,700,000

Cost of goods sold

(9,200,000)

(990,000)

Gross Profit

3,300,000

710,000

Income (loss) from subsidiary

27,000

Bond interest income

157,181

Bond interest expense

(105,364)

Operating expenses

(2,500,000)

(410,000)

Net income

$    984,181

$ 194,636

Statement of Retained Earnings

Parent

Subsidiary

BOY Retained Earnings

$7,360,351

$   990,000

Net income

984,181

194,636

Dividends

    (200,000)

      (30,000)

EOY Retained Earnings

$8,144,532

$1,154,636

Balance Sheet

Parent

Subsidiary

Assets:

Cash

$   1,750,000

$1,020,000

Accounts receivable

2,300,000

1,150,000

Inventory

2,400,000

1,500,907

Investment in subsidiary

2,160,000

Investment in bonds

1,965,639

PPE, net

14,025,000

4,389,000

$24,600,639

$8,059,907

Liabilities and Stockholders’ Equity:

Accounts payable

$ 1,600,000

$   838,000

Current Liabilities

2,200,000

1,100,000

Bonds payable

2,069,271

Long-term Liabilities

2,226,100

950,000

Common Stock

1,162,000

398,000

APIC

9,268,007

1,550,000

Retained Earnings

  8,144,532

1,154,636

$24,600,639

$8,059,907

Required:

Provide the consolidation entries and prepare a consolidation worksheet for the year ended December 31, 2018.

In: Accounting

Assume that a Parent company acquires a 90% interest in its Subsidiary on January 1, 2016....

Assume that a Parent company acquires a 90% interest in its Subsidiary on January 1, 2016. On the date of acquisition, the fair value of the 90% controlling interest was $2,160,000 and the fair value of the 10% noncontrolling interest was $240,000. On January 1, 2016, the book value of net assets equaled $2,400,000 and the fair value of the identifiable net assets equaled the book value of identifiable net assets (i.e. there was no AAP or Goodwill). The subsidiary’s retained earnings balance was $452,000 on the date of acquisition. The parent uses the cost method to account for its investment in the subsidiary.

On December 31, 2017, the Subsidiary company issued $2,000,000 (face) 7 percent, five-year bonds to an unaffiliated company for $2,173,179 (i.e. the bonds had an effective yield of 5 percent). The bonds pay interest annually on December 31, and the bond premium is amortized using the straight-line method. This results in annual bond-payable premium amortization equal to $34,636 per year.

On December 31, 2019, the Parent paid $1,948,458 to purchase all of the outstanding Subsidiary company bonds (i.e. the bonds had an effective yield of 8 percent). The bond discount is amortized using the straight-line method, which results in annual bond-investment discount amortization equal to $17,181 per year.

The Parent and the Subsidiary report the following financial statements for the year ended December 31, 2020:

Income Statement

Parent

Subsidiary

Sales

$12,500,000

$1,700,000

Cost of goods sold

(9,200,000)

(990,000)

Gross Profit

3,300,000

710,000

Income (loss) from subsidiary

27,000

Bond interest income

157,181

Bond interest expense

(105,364)

Operating expenses

(2,500,000)

(410,000)

Net income

$    984,181

$ 194,636

Statement of Retained Earnings

Parent

Subsidiary

BOY Retained Earnings

$7,360,351

$   990,000

Net income

984,181

194,636

Dividends

    (200,000)

      (30,000)

EOY Retained Earnings

$8,144,532

$1,154,636

Balance Sheet

Parent

Subsidiary

Assets:

Cash

$   1,750,000

$1,020,000

Accounts receivable

2,300,000

1,150,000

Inventory

2,400,000

1,500,907

Investment in subsidiary

2,160,000

Investment in bonds

1,965,639

PPE, net

14,025,000

4,389,000

$24,600,639

$8,059,907

Liabilities and Stockholders’ Equity:

Accounts payable

$ 1,600,000

$   838,000

Current Liabilities

2,200,000

1,100,000

Bonds payable

2,069,271

Long-term Liabilities

2,226,100

950,000

Common Stock

1,162,000

398,000

APIC

9,268,007

1,550,000

Retained Earnings

  8,144,532

1,154,636

$24,600,639

$8,059,907

Required:

Provide the consolidation entries and prepare a consolidation worksheet for the year ended December 31, 2018.  

In: Accounting

Post Partum Case Study Client Profile Roquanda is a 24-year-old G4P300. Her oldest child is 31/2...

Post Partum Case Study


Client Profile

Roquanda is a 24-year-old G4P300. Her oldest child is 31/2 years old. She delivered a 9-pound 12-ounce baby boy following an 18-hour Pitocin-augmented labor with epidural anesthesia this morning. Her second stage was two hours. She was given a medio lateral episiotomy, and the baby’s head was delivered by vacuum extractor after she experienced difficulty pushing. Her estimated blood loss (EBL) was 400 ml right after delivery. Immediately after delivery her VS were BP 110/70, temperature 98, pulse 68, and respirations 20. She plans to bottle-feed.

Case Study

Roquanda delivered two hours ago, and has just been transferred to the postpartum floor with an IV of lactated ringers, which is to be discontinued when it is finished. Upon assessing her, the postpartum nurse notes that Roquanda is trickling blood from the vagina and has soaked a pad about 30 to 40 minutes after she changes it. He vital signs are BP 90/68, pulse 100, and respiration 28. She appears restless.

Questions

1-   Name three common sources of postpartum hemorrhage. Compare and contrast them according to the signs and symptoms, precipitating factors, and treatment for each.

2-   What is the normal expected blood loss for a vaginal delivery?

3-   Was Roquanda’s blood loss normal?

4-   What factors increase the initial blood loss in delivery?

5-   List four history factors that increase Roquanda’s risk for postpartum hemorrhage.

6-   List four labor and delivery factors that increased her risk.

7-   Assess her vital signs. Are these normal for post partum?

8-   If not, what is the significance of them?

9-   List at least six other signs of shock related to hypovolemia.

10   -List at least two consequences of postpartum hemorrhage.


11-Why is Roquanda at an even higher risk for problems related to post partum hemorrhage?

12- When would you expect Roquanda’s hematocrit to be checked? If she had a post partum hemorrhage, how would you expect it to be reflected in the hematocrit?

13- Roquanda’s hematocrit is low, and the certified nurse midwife prescribes iron supplements. The nurse is discharging her on her third postpartum day. What information about taking iron supplements needs to be included in teaching Roquanda?

In: Nursing