Questions
In a Fermentation lab report using fruit juice, Briefly summarize the methods of this experiment. Remember...

In a Fermentation lab report using fruit juice, Briefly summarize the methods of this experiment. Remember the methods need to include important information so that another person can replicate the experiment.

In: Biology

1) Describe the experiment that tests the adaptive advantage of light vs. dark fur color in...

1) Describe the experiment that tests the adaptive advantage of light vs. dark fur color in Peromyscus polionotus. State the hypothesis correctly, describe the experiment, explain the results, and state the conclusion.

In: Biology

**a**s*****d**f***CEMENT EXPERIMENTS QUESTION 1: The strength class of the cement is determined by which experiment, how...

**a**s*****d**f***CEMENT EXPERIMENTS

QUESTION 1: The strength class of the cement is determined by which experiment, how is it
calculated ?
(Materials, experiment instruments, preparation and procedure, experiments and calculations)

In: Civil Engineering

Leave comments on code describing what does what Objectives: 1. To introduce pointer variables and their...

Leave comments on code describing what does what

Objectives:

1. To introduce pointer variables and their relationship with arrays

2. To introduce the dereferencing operator

3. To introduce the concept of dynamic memory allocation

A distinction must always be made between a memory location’s address and the data stored at that location. In this lab, we will look at addresses of variables and at special variables, called pointers, which hold these addresses.

The address of a variable is given by preceding the variable name with the C++ address operator (&). The & operator in front of the variable sum indicates that the address itself, and not the data stored in that location.

cout << &sum; // This outputs the address of the variable sum

To define a variable to be a pointer, we precede it with an asterisk (*). The asterisk in front of the variable indicates that ptr holds the address of a memory location.

int *ptr;

The int indicates that the memory location that ptr points to holds integer values. ptr is NOT an integer data type, but rather a pointer that holds the address of a location where an integer value is stored.

Explain the difference between the following two statements:

  

int sum; // ____________________________

int *sumPtr; // ___________________________

Using the symbols * and &:

  1. The & symbol is basically used on two occasions.

  • reference variable : The memory address of the parameter is sent to the function instead of the value at that address.

  • address of a variable

void swap (int &first, int &second) // The & indicates that the parameters

{ // first and second are being passed by reference.

int temp;

temp = first; // Since first is a reference variable,

// the compiler retrieves the value

// stored there and places it in temp.

first = second // New values are written directly into

second = temp; // the memory locations of first and second.

}

   

2) The * symbol is used on

  • define pointer variables:

  • the contents of the memory location

int *ptr;



Experiment 1

Step 1:

Complete this program by filling in the code (places in bold). Note: use only pointer variables when instructed to by the comments in bold. This program is to test your knowledge of pointer variables and the & and * symbols.

Step 2:

Run the program with the following data: 10 15. Record the output here .

// This program demonstrates the use of pointer variables

// It finds the area of a rectangle given length and width

// It prints the length and width in ascending order

#include <iostream>

using namespace std;

int main()

{

int length; // holds length

int width; // holds width

int area; // holds area

int *lengthPtr; // int pointer which will be set to point to length

int *widthPtr; // int pointer which will be set to point to width

  cout << "Please input the length of the rectangle" << endl;

cin >> length;

cout << "Please input the width of the rectangle" << endl;

cin >> width;

// Fill in code to make lengthPtr point to length (hold its address)

// Fill in code to make widthPtr point to width (hold its address)

area = // Fill in code to find the area by using only the pointer variables

cout << "The area is " << area << endl;

if (// Fill in the condition length > width by using only the pointer variables)

cout << "The length is greater than the width" << endl;

else if (// Fill in the condition of width > length by using only the pointer

// variables)

cout << "The width is greater than the length" << endl;

else

cout << "The width and length are the same" << endl;

return 0;

}




Experiment 2: Dynamic Memory

Step 1:

Complete the program by filling in the code. (Areas in bold) This problem requires that you study very carefully. The code has already written to prepare you to complete the program.

Step 2:

In inputting and outputting the name, you were asked NOT to use a bracketed subscript. Why is a bracketed subscript unnecessary? Would using name [pos] work for inputting the name? Why or why not? Would using name [pos] work for outputting the name? Why or why not?

Try them both and see.

// This program demonstrates the use of dynamic variables

#include <iostream>

using namespace std;

const int MAXNAME = 10;

int main()

{

int pos;

char * name;

int * one;

int * two;

int * three;

int result;

// Fill in code to allocate the integer variable one here

// Fill in code to allocate the integer variable two here

// Fill in code to allocate the integer variable three here

// Fill in code to allocate the character array pointed to by name

cout << "Enter your last name with exactly 10 characters." << endl;

cout << "If your name has < 10 characters, repeat last letter. " << endl

<< "Blanks at the end do not count." << endl;

for (pos = 0; pos < MAXNAME; pos++)

cin >> // Fill in code to read a character into the name array // WITHOUT USING a bracketed subscript

cout << "Hi ";

for (pos = 0; pos < MAXNAME; pos++)

cout << // Fill in code to a print a character from the name array // WITHOUT USING a bracketed subscript

cout << endl << "Enter three integer numbers separated by blanks" << endl;

// Fill in code to input three numbers and store them in the

// dynamic variables pointed to by pointers one, two, and three.

// You are working only with pointer variables

//echo print

cout << "The three numbers are " << endl;

// Fill in code to output those numbers

result = // Fill in code to calculate the sum of the three numbers

cout << "The sum of the three values is " << result << endl;

// Fill in code to deallocate one, two, three and name

return 0;

}

Sample Run:

Enter your last name with exactly 10 characters.

If your name < 10 characters, repeat last letter. Blanks do not count.

DeFinooooo

Hi DeFinooooo

Enter three integer numbers separated by blanks

5 6 7

The three numbers are 5 6 7

The sum of the three values is 18




Experiment 3: Dynamic Arrays

Question: Fill in the code as indicated by the comments in bold.

// This program demonstrates the use of dynamic arrays

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

float *monthSales; // a pointer used to point to an array

// holding monthly sales

float total = 0; // total of all sales

float average; // average of monthly sales

int numOfSales; // number of sales to be processed

int count; // loop counter

cout << fixed << showpoint << setprecision(2);

cout << "How many monthly sales will be processed? ";

cin >> numOfSales;

// Fill in the code to allocate memory for the array pointed to by

// monthSales.

if ( // Fill in the condition to determine if memory has been

// allocated (or eliminate this if construct if your instructor

// tells you it is not needed for your compiler)

)

{

cout << "Error allocating memory!\n";

return 1;

}

cout << "Enter the sales below\n";

for (count = 0; count < numOfSales; count++)

{

cout << "Sales for Month number "

<< // Fill in code to show the number of the month

<< ":";

// Fill in code to bring sales into an element of the array

}

for (count = 0; count < numOfSales; count++)

{

total = total + monthSales[count];

}

average = // Fill in code to find the average

cout << "Average Monthly sale is $" << average << endl;

// Fill in the code to deallocate memory assigned to the array.

return 0;

}

Sample Run:

How many monthly sales will be processed 3

Enter the sales below

Sales for Month number 1: 401.25

Sales for Month number 2: 352.89

Sales for Month number 3: 375.05

Average Monthly sale is $376.40

In: Computer Science

1.In computing terminology, the method of opening an application program and then creating a document is...

1.In computing terminology, the method of opening an application program and then creating a document is known as the ____-centric approach.

a.data

b.application

c.document

d.user

2.When you save a WordPad document, it is stored in the main memory (____) of the computer.

a.RAM

b.REM

c.RIM

d.ROM

3.The method of first creating a blank document directly in the Documents library and then use the WordPad program to enter data into the document is called the ____- centric approach.

a.data

b.application

c.document

d.user

4.The default file name of a text document created in the Documents library is ____.

a.New Blank Document

b.Text Document

c.New Document

d.New Text Document

5.With all of the views in the Documents library, the default arrangement for the icons is to be ____.

a.chronological by last date saved

b.alphabetical by author name

c.alphabetical by file name

d.chronological by date created

6. The ____ bar appears at the top of the Documents library window and displays your current location as a series of links separated by arrows.

a.Location

b.Address

c.Text

d.Search

7. When you select a document, the Preview pane displays a live view of the document ____ the list of files in the folder window.

a.to the right of

b.to the left of

c.underneath

d.on top of

8. A shortcut can be a link to a ____.   

a.program

b.printer

c.Web page

d.all of the above

9. If multiple documents are open in WordPad, the icon changes to appear as a ____ button to indicate there is more than one document open.

a.scroll bar

b.cascaded

c.stacked

d.3D

10. To print adjacent items, you select the first item, then while holding down the ____ key, you can select the other items.

a.SHIFT

b.TAB

c.ALT

d.F6

Chapter 2 – True/False (3 points each question)

Select T if the statement is true or F if the statement is false.

T

F

1.   A program is a set of computer instructions that carries out a task on the computer.

T

F

2.   A file name can contain up to 300 characters, including spaces.

T

F

3.To associate a file with a program, Windows 7 assigns an extension to the file name, consisting of a period followed by two or more characters.

T

F

4.Using the Rich Text Format will allow you to use all of WordPad’s features, including formatting options.

T

F

5.Windows 7 creates a unique Documents library for each computer user.

T

F

6.When Small, Medium, or Large icon views are selected, Windows 7 provides a live preview option.

T

F

7.You can group the files by any of the options on the Group by submenu, except Type, and Size.

T

F

8.When you right-drag, a shortcut menu opens and lists the available options.

T

F

9.A shortcut icon is the actual document or program.

T

F

10.In addition to placing a folder shortcut on the Start menu, you also can place a shortcut to other objects.

In: Computer Science

According to an airline, flights on a certain route are on time 75% of the time

According to an airline, flights on a certain route are on time 75% of the time. Suppose 24 flights are randomly selected and the number of on-time flights is recorded. 

(a) Explain why this is a binomial experiment

(b) Find and interpret the probability that exactly 15 lights are on time 

(c) Find and interpret the probability that fewer than 15 flights are on time 

(d) Find and interpret the probability that at least 15 fights are on time. 

(e) Find and interpret the probability that between 13 and 15 flights, inclusive, are on time. 


(a) Identity the statements that explain why this is a binomial experiment Select all that apply. 

A. Each trial depends on the previous trial 

B. The experiment is performed a foved number of times 

C. The experiment is performed until a desired number of successes is reached 

D. There are two mutually exclusive outcomes, success or failure. 

E. The trials are independent 

F. The probability of success is the same for each trial of the experiment 

G. There are three mutually exclusive possibly outcomes, arriving on-time, arriving early, and arriving late 


(b) The probability that exactly 15 flights are on time is _______ (Round to four decimal places as needed)

 Interpret the probability 

in 100 trials of this experiment, it is expected about _______  to exactly than 15 fights being on time


(c) The probability that fewer than 15 flights are on time is _______ (Round to four decimal places as needed.) 

Interpret the probability 

in 100 trials of this experiment, it is expected about _______ to result in fewer than 15 fights being on time 


(d) The probability that at least 15 fights are on time is _______ (Round to four decimal places as needed) 

Interpret the probability 

in 100 trials of this experiment, it is expected about _______ to result in at least 15 nights being on time

In: Math

A survey of US women with Ph.D.'s was conducted. Of the 102 respondents in marriages or...

A survey of US women with Ph.D.'s was conducted. Of the 102 respondents in marriages or long-term partnerships with men, 57% reported that their spouse/partner also held a doctorate degree.

Construct a theoretical 90% confidence interval. The interval is:

Select one:

a. (49.0%, 64.7%)

b. (48.9%, 65.1%)

c. (47.1%, 66.7%)

d. (47.4%, 66.6%)

e. (44.4%, 69.6%)

Based on the interval in the previous question, what group(s) can we make a conclusion about?

Select one:

a. All US women

b. All US women with Ph.D.'s

c. All US women with Ph.D.'s who are married

d. All US women with Ph.D.'s who are married or in long-term partnerships

e. All of the above

f. None of the above

The sociologists reporting on this study stated that: "There is strong evidence (p<0.001) that women in opposite-sex partnerships are more likely than women in same-sex partnerships to have a partner with the equivalent level of education." What type of error might the sociologists have committed?

Select one:

a. Type I

b. Type II

c. Neither error is possible

d. Both errors are possible

In: Statistics and Probability

Can you please write a pseudocode for the following: #include <stdio.h> int main(){    printf("Welcome to...

Can you please write a pseudocode for the following:

#include <stdio.h>
int main(){
   printf("Welcome to my Command-Line Calculator (CLC)\n");
   printf("Developer: Your name will come here\n");
   printf("Version: 1\n");
   printf("Date: Development data Will come here\n");
   printf("----------------------------------------------------------\n\n");
   //choice stores users input
   char choice;
   //to store numbers
   int val1,val2;
   //to store operator
   char operation;
   //flag which leths the loop iterate
   //the loop will break once the flag is set to 0
   int flag=1;
   printf("Select one of the following items: \n");
   printf("B) - Binary Mathematical Operations, such as addition and subtraction.\n");
   printf("U) - Unary Mathematical operations, such as square root, and log.\n");
   printf("A) - Advances Mathematical Operations, using variables, arrays.\n");
   printf("V) - Define variables and assign them values.\n");
   printf("E) - Exit\n");
   //taking user input for choice
   scanf(" %c",&choice);
   //do while loop
   do{
       //switch case
   switch(choice){
       case 'B':
           printf("Please enter the first number:\n");
           scanf("%d",&val1);
           printf("Please enter the operation (+ , - , * , / ):\n");
           scanf(" %c",&operation);
           printf("Please enter the second number:\n");
           scanf("%d",&val2);
           switch (operation){
               case '+':
                   printf("The result is %d \n",(val1+val2));
                   break;
               case '-':
                   printf("The result is %d \n",(val1-val2));
                   break;
               case '*':
                   printf("The result is %d \n",(val1*val2));
                   break;
               case '/':
                   printf("The result is %d \n",(val1/val2));
                   break;
               //if any other input is entered
               default:
                   printf("Invalid operator\n");
               }
           //asking the user for input as the operation ended
           printf("Please select your option ( B , U , A , E , V)\n");
           scanf(" %c",&choice);
           break;

       case 'U':
           printf("Sorry, at this time I don't have enough knowledge to serve you in this category\n");
           //asking the user for input as the operation ended
           printf("Please select your option ( B , U , A , E , V)\n");
           scanf(" %c",&choice);
           break;
       case 'A':
           printf("Sorry, at this time I don't have enough knowledge to serve you in this category\n");
           //asking the user for input as the operation ended
           printf("Please select your option ( B , U , A , E , V)\n");
           scanf(" %c",&choice);
           break;
       case 'V':
           printf("Sorry, at this time I don't have enough knowledge to serve you in this category\n");
           //asking the user for input as the operation ended
           printf("Please select your option ( B , U , A , E , V)\n");
           scanf(" %c",&choice);
           break;
       case 'E':
           //if user enters E flag is set to 0, so that the loop will break
           flag=0;
           printf("Thanks for using my Simple Calculator. Hope o see you soon again, Goodbye!\n");
           break;
       default:
           printf("Invalid input");
           printf("Please select your option ( B , U , A , E , V)\n");
           scanf(" %c",&choice);
           }
      
   }while(flag);
  
  
}

In: Computer Science

Exercise 17-27 On August 15, 2016, Splish Co. invested idle cash by purchasing a call option...

Exercise 17-27

On August 15, 2016, Splish Co. invested idle cash by purchasing a call option on Counting Crows Inc. common shares for $504. The notional value of the call option is 560 shares, and the option price is $56. The option expires on January 31, 2017. The following data are available with respect to the call option.


Date
Market Price of Counting
Crows Shares
Time Value of Call
Option
September 30, 2016 $67 per share $252
December 31, 2016 $64 per share 91
January 15, 2017 $66 per share 42


Prepare the journal entries for Splish for the following dates.

(a) Investment in call option on Counting Crows shares on August 15, 2016.
(b) September 30, 2016—Splish prepares financial statements.
(c) December 31, 2016—Splish prepares financial statements.
(d) January 15, 2017—Splish settles the call option on the Counting Crows shares.


(Credit account titles are automatically indented when amount is entered. Do not indent manually. If no entry is required, select "No Entry" for the account titles and enter 0 for the amounts.)

No.
Date
Account Titles and Explanation
Debit
Credit
(a)

Aug. 15, 2016
Sep. 30, 2016
Dec. 31, 2016
Jan. 15, 2017
(b)

Aug. 15, 2016
Sep. 30, 2016
Dec. 31, 2016
Jan. 15, 2017
(To record the change in intrinsic value.)
(To record the time value change.)
(c)

Aug. 15, 2016
Sep. 30, 2016
Dec. 31, 2016
Jan. 15, 2017
(To record the change in intrinsic value.)
(To record the time value change.)
(d)

Aug. 15, 2016
Sep. 30, 2016
Dec. 31, 2016
Jan. 15, 2017
(To record the time value change.)
(To record settlement of call option.)

In: Accounting

( X, τ ) is normal if and only if for each closed subset C of...

( X, τ ) is normal if and only if for each closed subset C of X and each open
set U such that C ⊆ U, there exists an open set V satisfies C ⊆ V ⊆clu( V) ⊆ U

In: Advanced Math