Questions
SHORT ANSWER __________ refers to those attributes of a system visible to a programmer. 2. _________...

SHORT ANSWER

  1. __________ refers to those attributes of a system visible to a programmer.

2. _________ refers to the operational units and their interconnections that realize the architectural specifications.

3. Control signals, interfaces between the computer and peripherals, and the memory technology used are all examples of _________ attributes.

4. The instruction set, the number of bits used to represent various data types, I/O mechanisms and techniques for addressing memory are all examples of _________ attributes.

  1. The __________ architecture is the architecture of IBM’s mainframe product line.
  2. _________ is the way in which the components are interrelated.
  3. _________ is the operation of each individual component as part of the structure.
  4. The basic functions that a computer can perform are: data processing, data movement, control, and _________.
  5. When data are received from or delivered to a device that is directly connected to the computer, the process is known as __________.
  6. The four main structural components of the computer are: main memory, I/O, system interconnection, and __________.
  7. Often referred to as processor the ________ controls the operation of the computer and performs its data processing functions.
  8. A common example of system interconnection is by means of a ________, consisting of a number of conducting wires to which all the other components attach.
  9. The major structural components of the CPU are: control unit, register, CPU interconnection, and __________.
  10. A __________ control unit operates by executing microinstructions that define the functionality of the control unit.
  11. The _________ controls the operation of the CPU and hence the computer.

Problems:

  1. A program consists of 100,000 instructions as follows:

Instruction Type

Instruction Count

Cycles per Instruction

Integer arithmetic

45,000

4

Data transfer

32,000

6

Floating point arithmetic

15,000

10

Control transfer

8,000

3

1) Determine

  1. the program execution time,
  2. the effective CPI for the machine,
  3. MIPS rate for the following processors.

*Please show work for each answer placed in the Table.

Processor

Execution Time

CPI

MIPS rate

M1 - 350 MHz

M2 - 800 MHz

M3 - 1 GHz

2) What is the speed up of M2 from M1?

3) what is the speed up of M3 from M1?

4) What is the speed up of M3 from M2?

  1. Consider two different machines with two different instruction sets, both of which have a clock rate of 400 MHz. The following measurements are recorded on the two machines running a given set of benchmark programs.

Instruction Type

Instruction Count (millions)

Cycles per

Instruction

Machine A

Arithmetic and logic

Load and store

Branch

Others

8

4

2

4

1

3

4

3

Machine B

Arithmetic and logic

Load and store

Branch

Others

10

8

2

4

1

2

3

4

  1. Determine
    1. the program execution time,
    2. the effective CPI for the machine,
    3. MIPS rate for each machine.

*Please show work for each answer in the Table.

Processor

Execution Time

CPI

MIPS rate

Machine A

Machine B

2) Comment on the result.

  1. We have two types of machine as follows:

Processor

Clock Rate (MHz)

MIPS rate

CPU time (sec)

Machine A

5

1

12 x

Machine B

25

18

x

Mache A requires 12 times longer than Machine B measured in CPU time. For example, a program takes 1 second in Machine B will take 12 seconds.

1) What is the relative size of the instruction count for the program running on the two machines?

2) What is the effective CPI for the two machines?

In: Computer Science

(AM#6c) Is there a difference in how much males and females use aggressive behavior to improve...

  1. (AM#6c) Is there a difference in how much males and females use aggressive behavior to improve an angry mood? For the "Anger-Out" scores, compute a 99% confidence interval on the difference between gender means. (relevant section)

  2. (AM#10) Calculate the 95% confidence interval for the difference between the mean Anger-In score for the athletes and non-athletes. What can you conclude? (relevant section)




25) (AM#10) Calculate the 95% confidence interval for the difference between the mean Anger-In score for the athletes and non-athletes. What can you conclude? (relevant section)

Learning Objectives
State the assumptions for computing a confidence interval on the difference between means
Compute a confidence interval on the difference between means
Format data for computer analysis
It is much more common for a researcher to be interested in the difference between means than in the specific values of the means themselves. We take as an example the data from the "Animal Research" case study. In this experiment, students rated (on a 7-point scale) whether they thought animal research is wrong. The sample sizes, means, and variances are shown separately for males and females in Table 1.
Table 1. Means and Variances in Animal Research study.
Condition n Mean Variance
Females 17 5.353 2.743
Males 17 3.882 2.985
As you can see, the females rated animal research as more wrong than did the males. This sample difference between the female mean of 5.35 and the male mean of 3.88 is 1.47. However, the gender difference in this particular sample is not very important. What is important is the difference in the population. The difference in sample means is used to estimate the difference in population means. The accuracy of the estimate is revealed by a confidence interval.
In order to construct a confidence interval, we are going to make three assumptions:
The two populations have the same variance. This assumption is called the assumption of homogeneity of variance.
The populations are normally distributed.
Each value is sampled independently from each other value.
The consequences of violating these assumptions are discussed in a later section. For now, suffice it to say that small-to-moderate violations of assumptions 1 and 2 do not make much difference.
A confidence interval on the difference between means is computed using the following formula:
Lower Limit = M1 - M2 -(tCL)()
Upper Limit = M1 - M2 +(tCL)()

where M1 - M2 is the difference between sample means, tCL is the t for the desired level of confidence, and is the estimated standard error of the difference between sample means. The meanings of these terms will be made clearer as the calculations are demonstrated.
We continue to use the data from the "Animal Research" case study and will compute a confidence interval on the difference between the mean score of the females and the mean score of the males. For this calculation, we will assume that the variances in each of the two populations are equal.
The first step is to compute the estimate of the standard error of the difference between means (). Recall from the relevant section in the chapter on sampling distributions that the formula for the standard error of the difference in means in the population is:


In order to estimate this quantity, we estimate σ2 and use that estimate in place of σ2. Since we are assuming the population variances are the same, we estimate this variance by averaging our two sample variances. Thus, our estimate of variance is computed using the following formula:

where MSE is our estimate of σ2. In this example,
MSE = (2.743 + 2.985)/2 = 2.864.

Note that MSE stands for "mean square error" and is the mean squared deviation of each score from its group's mean.
Since n (the number of scores in each condition) is 17,
== = 0.5805.

The next step is to find the t to use for the confidence interval (tCL). To calculate tCL, we need to know the degrees of freedom. The degrees of freedom is the number of independent estimates of variance on which MSE is based. This is equal to (n1 - 1) + (n2 - 1) where n1 is the sample size of the first group and n2 is the sample size of the second group. For this example, n1= n2 = 17. When n1= n2, it is conventional to use "n" to refer to the sample size of each group. Therefore, the degrees of freedom is 16 + 16 = 32.
Online: Calculator: Find t for confidence interval

From either the above calculator or a t table, you can find that the t for a 95% confidence interval for 32 df is 2.037.
We now have all the components needed to compute the confidence interval. First, we know the difference between means:
M1 - M2 = 5.353 - 3.882 = 1.471

We know the standard error of the difference between means is
= 0.5805

and that the t for the 95% confidence interval with 32 df is
tCL = 2.037

Therefore, the 95% confidence interval is
Lower Limit = 1.471 - (2.037)(0.5805) = 0.29

Upper Limit = 1.471 + (2.037)(0.5805) = 2.65

We can write the confidence interval as:

0.29 ≤ μf - μm ≤ 2.65

where μf is the population mean for females and μm is the population mean for males. This analysis provides evidence that the mean for females is higher than the mean for males, and that the difference between means in the population is likely to be between 0.29 and 2.65.
Formatting data for Computer Analysis
Most computer programs that compute t tests require your data to be in a specific form. Consider the data in Table 2.
Table 2. Example Data.
Group 1 Group 2
3 5
4 6
5 7

Here there are two groups, each with three observations. To format these data for a computer program, you normally have to use two variables: the first specifies the group the subject is in and the second is the score itself. For the data in Table 2, the reformatted data look as follows:

Table 3. Reformatted Data.
G Y
1 3
1 4
1 5
2 5
2 6
2 7
To use Analysis Lab to do the calculations, you would copy the data and then
Click the "Enter/Edit User Data" button. (You may be warned that for security reasons you must use the keyboard shortcut for pasting data.)
Paste your data.
Click "Accept Data."
Set the Dependent Variable to Y.
Set the Grouping Variable to G.
Click the t-test confidence interval button.
The 95% confidence interval on the difference between means extends from -4.267 to 0.267.
Computations for Unequal Sample Sizes (optional)
The calculations are somewhat more complicated when the sample sizes are not equal. One consideration is that MSE, the estimate of variance, counts the sample with the larger sample size more than the sample with the smaller sample size. Computationally this is done by computing the sum of squares error (SSE) as follows:


where M1 is the mean for group 1 and M2 is the mean for group 2. Consider the following small example:
Table 4. Example Data.
Group 1 Group 2
3 2
4 4
5
M1 = 4 and M2 = 3.

SSE = (3-4)2 + (4-4)2 + (5-4)2 + (2-3)2 + (4-3)2 = 4

Then, MSE is computed by: MSE = SSE/df

where the degrees of freedom (df) is computed as before:
df = (n1 -1) + (n2 -1) = (3-1) + (2-1) = 3.
MSE = SSE/df = 4/3 = 1.333.

The formula

=

is replaced by

=

where nh is the harmonic mean of the sample sizes and is computed as follows:

nh = = = 2.4
and

= = 1.054.


tCL for 3 df and the 0.05 level = 3.182.

Therefore the 95% confidence interval is
Lower Limit = 1 - (3.182)(1.054)= -2.35

Upper Limit = 1 + (3.182)(1.054)= 4.35

We can write the confidence interval as:

-2.35 ≤ μ1 - μ2 ≤ 4.35




24)(AM#6c) Is there a difference in how much males and females use aggressive behavior to improve an angry mood? For the "Anger-Out" scores, compute a 99% confidence interval on the difference between gender means.

Learning Objectives
State the assumptions for computing a confidence interval on the difference between means
Compute a confidence interval on the difference between means
Format data for computer analysis
It is much more common for a researcher to be interested in the difference between means than in the specific values of the means themselves. We take as an example the data from the "Animal Research" case study. In this experiment, students rated (on a 7-point scale) whether they thought animal research is wrong. The sample sizes, means, and variances are shown separately for males and females in Table 1.
Table 1. Means and Variances in Animal Research study.
Condition n Mean Variance
Females 17 5.353 2.743
Males 17 3.882 2.985
As you can see, the females rated animal research as more wrong than did the males. This sample difference between the female mean of 5.35 and the male mean of 3.88 is 1.47. However, the gender difference in this particular sample is not very important. What is important is the difference in the population. The difference in sample means is used to estimate the difference in population means. The accuracy of the estimate is revealed by a confidence interval.
In order to construct a confidence interval, we are going to make three assumptions:
The two populations have the same variance. This assumption is called the assumption of homogeneity of variance.
The populations are normally distributed.
Each value is sampled independently from each other value.
The consequences of violating these assumptions are discussed in a later section. For now, suffice it to say that small-to-moderate violations of assumptions 1 and 2 do not make much difference.
A confidence interval on the difference between means is computed using the following formula:
Lower Limit = M1 - M2 -(tCL)()
Upper Limit = M1 - M2 +(tCL)()

where M1 - M2 is the difference between sample means, tCL is the t for the desired level of confidence, and is the estimated standard error of the difference between sample means. The meanings of these terms will be made clearer as the calculations are demonstrated.
We continue to use the data from the "Animal Research" case study and will compute a confidence interval on the difference between the mean score of the females and the mean score of the males. For this calculation, we will assume that the variances in each of the two populations are equal.
The first step is to compute the estimate of the standard error of the difference between means (). Recall from the relevant section in the chapter on sampling distributions that the formula for the standard error of the difference in means in the population is:


In order to estimate this quantity, we estimate σ2 and use that estimate in place of σ2. Since we are assuming the population variances are the same, we estimate this variance by averaging our two sample variances. Thus, our estimate of variance is computed using the following formula:

where MSE is our estimate of σ2. In this example,
MSE = (2.743 + 2.985)/2 = 2.864.

Note that MSE stands for "mean square error" and is the mean squared deviation of each score from its group's mean.
Since n (the number of scores in each condition) is 17,
== = 0.5805.

The next step is to find the t to use for the confidence interval (tCL). To calculate tCL, we need to know the degrees of freedom. The degrees of freedom is the number of independent estimates of variance on which MSE is based. This is equal to (n1 - 1) + (n2 - 1) where n1 is the sample size of the first group and n2 is the sample size of the second group. For this example, n1= n2 = 17. When n1= n2, it is conventional to use "n" to refer to the sample size of each group. Therefore, the degrees of freedom is 16 + 16 = 32.
Online: Calculator: Find t for confidence interval

From either the above calculator or a t table, you can find that the t for a 95% confidence interval for 32 df is 2.037.
We now have all the components needed to compute the confidence interval. First, we know the difference between means:
M1 - M2 = 5.353 - 3.882 = 1.471

We know the standard error of the difference between means is
= 0.5805

and that the t for the 95% confidence interval with 32 df is
tCL = 2.037

Therefore, the 95% confidence interval is
Lower Limit = 1.471 - (2.037)(0.5805) = 0.29

Upper Limit = 1.471 + (2.037)(0.5805) = 2.65

We can write the confidence interval as:

0.29 ≤ μf - μm ≤ 2.65

where μf is the population mean for females and μm is the population mean for males. This analysis provides evidence that the mean for females is higher than the mean for males, and that the difference between means in the population is likely to be between 0.29 and 2.65.
Formatting data for Computer Analysis
Most computer programs that compute t tests require your data to be in a specific form. Consider the data in Table 2.
Table 2. Example Data.
Group 1 Group 2
3 5
4 6
5 7

Here there are two groups, each with three observations. To format these data for a computer program, you normally have to use two variables: the first specifies the group the subject is in and the second is the score itself. For the data in Table 2, the reformatted data look as follows:

Table 3. Reformatted Data.
G Y
1 3
1 4
1 5
2 5
2 6
2 7
To use Analysis Lab to do the calculations, you would copy the data and then
Click the "Enter/Edit User Data" button. (You may be warned that for security reasons you must use the keyboard shortcut for pasting data.)
Paste your data.
Click "Accept Data."
Set the Dependent Variable to Y.
Set the Grouping Variable to G.
Click the t-test confidence interval button.
The 95% confidence interval on the difference between means extends from -4.267 to 0.267.
Computations for Unequal Sample Sizes (optional)
The calculations are somewhat more complicated when the sample sizes are not equal. One consideration is that MSE, the estimate of variance, counts the sample with the larger sample size more than the sample with the smaller sample size. Computationally this is done by computing the sum of squares error (SSE) as follows:


where M1 is the mean for group 1 and M2 is the mean for group 2. Consider the following small example:
Table 4. Example Data.
Group 1 Group 2
3 2
4 4
5
M1 = 4 and M2 = 3.

SSE = (3-4)2 + (4-4)2 + (5-4)2 + (2-3)2 + (4-3)2 = 4

Then, MSE is computed by: MSE = SSE/df

where the degrees of freedom (df) is computed as before:
df = (n1 -1) + (n2 -1) = (3-1) + (2-1) = 3.
MSE = SSE/df = 4/3 = 1.333.

The formula

=

is replaced by

=

where nh is the harmonic mean of the sample sizes and is computed as follows:

nh = = = 2.4
and

= = 1.054.


tCL for 3 df and the 0.05 level = 3.182.

Therefore the 95% confidence interval is
Lower Limit = 1 - (3.182)(1.054)= -2.35

Upper Limit = 1 + (3.182)(1.054)= 4.35

We can write the confidence interval as:

-2.35 ≤ μ1 - μ2 ≤ 4.35



In: Statistics and Probability

The design should consist of two things: (1) a list of every semaphore, its purpose, and...

The design should consist of two things:
(1) a list of every semaphore, its purpose, and its initial value, and
(2) pseudocode for each function. The pseudocode should be similar to the pseudocode shown in the textbook for the barbershop problem.
Every wait and signal call must be included in the pseudocode.    

Must use Java Threads and Java Semaphores (java.util.concurrent.Semaphore).
You may not use the “synchronized” keyword in Java for mutual exclusion.
You may not use Java data structures that have built-in mutual exclusion.

Please provide corresponding PSEUDOCODE along with JAVA CODE.


Hotel Simulation
A hotel is simulated by using threads and semaphores to model customer and employee behavior.
This project is similar to the “barbershop” example in the textbook. The following rules apply:


The hotel to be simulated has two employees at the front desk to register guests and two bellhops to handle guests’ bags.
A guest will first visit the front desk to get a room number. The front desk employee will find an available room and assign it to the guest.
If the guest has less than 3 bags, the guest proceeds directly to the room. Otherwise, the guest visits the bellhop to drop off the bags.
The guest will later meet the bellhop in the room to get the bags, at which time a tip is given.

Threads:

Guest:
1)   25 guests visit the hotel (1 thread per guest created at start of simulation).
2)   Each guest has a random number of bags (0-5).
3)   A guest must check in to the hotel at the front desk.
4)   Upon check in, a guest gets a room number from the front desk employee.
5)   A guest with more than 2 bags requires a bellhop.
6)   The guest enters the assigned room.
7)   Receives bags from bellhop and gives tip (if more than 2 bags).
8)   Retires for the evening.

Front Desk:
1)   Two employees at the front desk (1 thread each).
2)   Checks in a guest, finds available room, and gives room number to guest.

Bellhop:
1)   Two bellhops (1 thread each).
2)   Gets bags from guest.
3)   The same bellhop that took the bags delivers the bags to the guest after the guest is in the room.
4)   Accepts tip from guest.

Other rules:
1)   All mutual exclusion and coordination must be achieved with semaphores.
2)   A thread may not use sleeping as a means of coordination.
3)   Busy waiting (polling) is not allowed.
4)   Mutual exclusion should be kept to a minimum to allow the most concurrency.
5)   Each thread should print when it is created, and main should print when it joins the customer threads.
6)   Each thread should only print its own activities. The guest threads print guest actions and the employee threads print their own actions.
7)   Your output must include the same information, same wording, and the same set of steps as the sample output. Of course, each run can be different depending on the order of thread execution and the random assignments made.


Output

1)   Each step of each task of each thread should be printed to the screen with identifying numbers so it is clear which threads are involved.
2)   Thread output sample for 3 guests. The wording in your output should exactly match the sample.

Simulation starts
Front desk employee 0 created
Front desk employee 1 created
Bellhop 0 created
Bellhop 1 created
Guest 0 created
Guest 1 created
Guest 2 created
Guest 0 enters hotel with 1 bag
Guest 1 enters hotel with 4 bags
Guest 2 enters hotel with 3 bags
Front desk employee 0 registers guest 0 and assigns room 1
Front desk employee 1 registers guest 1 and assigns room 2
Guest 0 receives room key for room 1 from front desk employee 0
Guest 1 receives room key for room 2 from front desk employee 1
Front desk employee 0 registers guest 2 and assigns room 3
Guest 0 enters room 1
Guest 2 receives room key for room 3 from front desk employee 0
Guest 1 requests help with bags
Guest 0 retires for the evening
Guest 0 joined
Guest 2 requests help with bags
Bellhop 1 receives bags from guest 2
Bellhop 0 receives bags from guest 1
Guest 1 enters room 2
Guest 2 enters room 3
Bellhop 0 delivers bags to guest 1
Bellhop 1 delivers bags to guest 2
Guest 1 receives bags from bellhop 0 and gives tip
Guest 2 receives bags from bellhop 1 and gives tip
Guest 2 retires for the evening
Guest 1 retires for the evening
Guest 1 joined
Guest 2 joined
Simulation ends

In: Computer Science

Lisp In the language Lisp1 , each of the four basic arithmetic operators appears before an...

Lisp

In the language Lisp1 , each of the four basic arithmetic operators appears before an arbitrary number of operands, which are separated by spaces. The resulting expression is enclosed in parentheses. The operators behave as follows:

(+ a b c ...) returns the sum of all the operands, and (+) returns 0.

(- a b c ...) returns a - b - c - ..., and (- a) returns -a. The minus operator must have at least one operand.

(* a b c ...) returns the product of all the operands, and (*) returns 1.

(/ a b c ...) returns a / b / c /..., and (/ a) returns 1 / a. The divide operator must have at least one operand.

You can form larger arithmetic expressions by combining these basic expressions using a fully parenthesized prefix notation. For example, the following is a valid Lisp expression:

(+ (- 6) (* 2 3 4) (/ (+ 3) (*) (- 2 3 1)))

This expression is evaluated successively as follows:

(+ (- 6) (* 2 3 4) (/ 3 1 -2))

(+ -6 24 -1.5)

16.5

Write a program that reads such expressions and demonstrates your algorithm. We have provided you some starter code, and you are asked to complete the rest.

LISPTOKEN

package hw5;

public class LispToken

{

private Character operator;

private Double operand;

private boolean isOperator;

/** Constructors for objects of class LispToken. */

public LispToken(Character anOperator)

{

operator = anOperator;

isOperator = true;

operand = 0.0;

}

public LispToken(Double value)

{

operand = value;

isOperator = false;

operator = ' ';

}

/** TODO: Applies this operator to two given operand values.

@param value1 The value of the first operand.

@param value2 The value of the second operand.

@return The real result of the operation.

TODO: You need to complete this method.

*/

public Double applyOperator(Double value1, Double value2)

{

}

/** Gets the identity value of this operator.

For example, x + 0 = x, so 0 is the identity for +

and will be the value associated with the expression (+).

@return The identity value of the operator. */

public Double getIdentity()

{

Double result = 0.0;

switch (operator)

{

case '+':

result = 0.0;

break;

case '-':

result = 0.0;

break;

case '*':

result = 1.0;

break;

case '/':

result = 1.0;

break;

}

return result;

}

/** Detects whether this operator returns a value when it has no operands.

@return True if the operator returns a value when it has no operands,

or false if not. */

public boolean takesZeroOperands()

{

boolean result = false;

switch (operator)

{

case '+':

result = true;

break;

case '-':

result = false;

break;

case '*':

result = true;

break;

case '/':

result = false;

break;

}

return result;

}

/** Gets the value of this operand.

@return The real value of the operand. */

public Double getValue()

{

return operand;

}

/** Returns true if the object is an operator.

@return True is this object is an operator. */

public boolean isOperator()

{

return isOperator;

}

public String toString()

{

String result = null;

if (isOperator)

result = operator.toString();

else

result = operand.toString();

return result;

}

}

LISPQUESTION

package hw5;

import java.util.Scanner;

import java.util.Stack;

public class LispQuestion

{

/** Evaluates a Lisp expression.

The algorithm:

Scan the tokens in the string.

If you see "(", push the next operator onto the stack.

If you see an operand, push it onto the stack.

If you see ")",

Pop operands and push them onto a second stack

until you find an operator.

Apply the operator to the operands on the second stack.

Push the result on the stack.

If you run out of tokens, the value on the top of the stack is

the value of the expression.

@param lispExp A string that is a valid lisp expression.

@return A double that is the value of the expression.

@TODO: You need to complete this method. This method must call the applyOperator from LispToken class.

*/

public static double evaluate(String lispExp)

{

}

public static void main (String args[])

{

Double result;

String test1 = "(+ (- 6) (* 2 3 4) (/ (+ 3) (*) (- 2 3 1)))";

result = evaluate(test1);

System.out.println("Expression " + test1 + " evaluates to " + result);

String test2 = "(+ (- 632) (* 21 3 4) (/ (+ 32) (*) (- 21 3 1)))";

result = evaluate(test2);

System.out.println("Expression " + test2 + " evaluates to " + result);

String test3 = "(+ (/ 2) (* 2) (/ (+ 1) (+) (- 2 1 )))";

result = evaluate(test3);

System.out.println("Expression " + test3 + " evaluates to " + result);

}

}

/*

Expression (+ (- 6) (* 2 3 4) (/ (+ 3) (*) (- 2 3 1))) evaluates to 16.5

Expression (+ (- 632) (* 21 3 4) (/ (+ 32) (*) (- 21 3 1))) evaluates to -378.11764705882354

Expression (+ (/ 2) (* 2) (/ (+ 1) (+) (- 2 1 ))) evaluates to Infinity

*/

In: Computer Science

Instructions: You are givne main.c and exam.h. Your task is to implement exam.c. write the code...

Instructions:
You are givne main.c and exam.h.
Your task is to implement exam.c.
write the code for these 20 functions on repl.it.
*/

#include 
#include "exam/exam.h"

int main(void) {
  return 0;
}
/*
/*
exam.h
*/

#ifndef _EXAM_H_
#define _EXAM_H_

// 1
// Display title of code and your name. ( koorsh maghsoodi my name)
// See exam.txt for sample output.
void exam_hello_world(void);

// 2
// Display argc and all argv[] values.
// See exam.txt for sample output.
// returns: number of arguments
int exam_cmd_line_args(int argc, char *argv[]);

// 3
// Display info about signed integer data types.
// See exam.txt for sample output.
// Return number of signeed integer data types
int exam_signed_integer_data_types(void);

// 4
// Display info about unsigned integer data types.
// See exam.txt for sample output.
// Return number of unsigned integer data types
int exam_unsigned_integer_data_types(void);

// 5
// Display info about these data types:
// int8_t, uint8_t
// int16_t, uint16_t
// int32_t, uint32_t
// See exam.txt for sample output.
// Return number of unsigned integer data types
int exam_stdint_integer_data_types(void);

// 6
// Display info about floating-point data types.
// See exam.txt for sample output.
int exam_floating_data_types(void);

// 7
// Return the sum of three integer numbers.
// See exam.txt for sample output
int exam_sum(int n1, int n2, int n3);

// 8
// Given two integer numbers, return:
// -1 if n1 is less than n2
// 0 if n1 is equal to n2
// 1 if n1 is greater than n2
// See exam.txt for sample output
int exam_compare(int n1, int n2);

// 9
// Given two integer numbers,
// return the sum of n1 to n2.
// For example, if n1=2 and n2=4,
// return sum of 2+3+4, i.e. 9
// Do this using a for loop.
int exam_for(int n1, int n2);

// 10
// Given two integer numbers,
// return the sum of n1 to n2.
// For example, if n1=2 and n2=4,
// return sum of 2+3+4, i.e. 9
// Do this using a while loop.
int exam_while(int n1, int n2);

// 11
// Given two integer numbers,
// return the sum of n1 to n2.
// For example, if n1=2 and n2=4,
// return sum of 2+3+4, i.e. 9
// Do this using a do_while loop.
int exam_do_while(int n1, int n2);

// 12
// Display info about enum data types.
// See exam.txt for sample output.
typedef enum {
  EXAM_ERROR_OK = 0,
  EXAM_ERROR_BAD_PARAM,
  EXAM_ERROR_OUT_OF_RANGE,
  EXAM_ERROR_IO
} exam_error_t;
exam_error_t exam_typedef_enum_data_types(void);

// 13
// Add a student.
// If the max students is reached return
// EXAM_ERROR_OUT_OF_RAMGE,
// else return EXAM_ERROR_OK
// See exam.txt for sample output
#define EXAM_MAX_STUDENTS 3
typedef struct {
  int id;
  float average;
  char *name;
} student_t;
exam_error_t exam_add_student(student_t *s);

// 14
// List all students
// See exam.txt for sample output
// Return the number of students listed
int exam_list_students(void);

// 15
// Remove a student by id 
// See exam.txt for sample output
// Return EXAM_ERROR_OK if studentt was
// removed. Else return EXAM_ERROR_BAD_PARAM
exam_error_t exam_remove_student_by_id(int id);

// 16
// Remove a student by name
// See exam.txt for sample output
// Return EXAM_ERROR_OK if studentt was
// removed. Else return EXAM_ERROR_BAD_PARAM
exam_error_t exam_remove_student_by_name(char *name);

//17
// Write the list of students to a file.
// Return EXAM_ERROR_OK on success or
// Return EXAM_ERROR_BAD_PARAM if filenmae is NULL.
// Return EXAM_ERROR_IO if file write error
exam_error_t exam_write_students_to_file(char *filename);

//18
// Read the list of students from a file.
// Return EXAM_ERROR_OK on success or
// Return EXAM_ERROR_BAD_PARAM if filenmae is NULL.
// Return EXAM_ERROR_IO if file write error
exam_error_t exam_read_students_from_file(char *filename);

//19
// Given an array of students (e.g. just read in from a file)
// display them to the console.
// Return the number of students displayed.
int exam_display_students_from_list(student_t s[], size_t size);

//20
// For each of the following files, read them in,
// and then display the following info:
// Filename, Number of Lines, Number of Characters
// main.c....
// exam/exam.h....
// exam/exam.c...
// Return the total number of LINES of all files,
// i.e. lines of main.c + exam.h + exam.c
int exam_return_total_lines(void);

#endif

YOUR SAMPLE OUTPUT SHOULD LOOK LIKE THIS:

1 - exam_hello_world
        CSCI 112 Final
        Code by Norman McEntire
2 - exam_cmd_line_args
        argc: 4
        argv[0]: main
        argv[1]: one
        argv[2]: two
        argv[3]: three
value returned: 4
3 - exam_signed_integer_data_types
        type    size
        ----    ----
        char    1
        short   2
        int     4
        long    8
value returned: 4
4 - exam_unsigned_integer_data_types
        type    size
        ----    ----
        unsigned char   1
        unsigned short  2
        unsigned int    4
        unsigned long   8
value returned: 2
5 - exam_stdint_integer_data_types
        type            size
        ----            ----
        uint8_t         1
        uint16_t        2
        uint32_t        4
value returned: 3
6 - exam_floating_data_types
        type    size
        ----    ----
        float   4
        double  8
value returned: 2
7 - exam_sum
        n1: 10, n2: 20, n3: 30
value returned: 60
8 - exam_compare
        n1: -10, n2: 20
value returned: -1
8 - exam_compare
        n1: 10, n2: 10
value returned: 0
8 - exam_compare
        n1: 20, n2: 10
value returned: 1
9 - exam_for
        n1: 10, n2: 20
value returned: 165
10 - exam_while
        n1: 10, n2: 20
value returned: 165
11 - exam_do_while
        n1: 10, n2: 20
value returned: 165
12 - exam_typedef_enum_data_types
        EXAM_ERROR_OK: 0
        EXAM_ERROR_BAD_PARAM: 1
        EXAM_ERROR_OUT_OF_RANGE: 2
        EXAM_ERROR_IO: 3
13 - exam_add_student
        id: 123, average: 94.50, name: John
        Currrent num_students: 0
        Student added. updated num_students: 1
value returned: 0
13 - exam_add_student
        id: 234, average: 95.60, name: Sally
        Currrent num_students: 1
        Student added. updated num_students: 2
value returned: 0
13 - exam_add_student
        id: 345, average: 96.70, name: Billy
        Currrent num_students: 2
        Student added. updated num_students: 3
value returned: 0
13 - exam_add_student
        id: 456, average: 97.80, name: Paul
        Currrent num_students: 3
        Max number of students reachd!
value returned: 2
14 - exam_list_students
        Total of 3 students:
        id: 123, average: 94.50, name: John
        id: 234, average: 95.60, name: Sally
        id: 345, average: 96.70, name: Billy
value returned: 3
15 - exam_remove_student_by_id
        id: 234
        FOUND! Student removed!
value returned: 0
14 - exam_list_students
        Total of 2 students:
        id: 123, average: 94.50, name: John
        id: 345, average: 96.70, name: Billy
value returned: 2
15 - exam_remove_student_by_id
        id: 999
        NO STUDENT FOUND!
value returned: 1
14 - exam_list_students
        Total of 2 students:
        id: 123, average: 94.50, name: John
        id: 345, average: 96.70, name: Billy
value returned: 2
16 - exam_remove_student_by_name
        name: Billy Bob
        NO STUDENT FOUND!
value returned: 1
14 - exam_list_students
        Total of 2 students:
        id: 123, average: 94.50, name: John
        id: 345, average: 96.70, name: Billy
value returned: 2
16 - exam_remove_student_by_name
        name: No One
        NO STUDENT FOUND!
value returned: 1
14 - exam_list_students
        Total of 2 students:
        id: 123, average: 94.50, name: John
        id: 345, average: 96.70, name: Billy
value returned: 2
13 - exam_add_student
        id: 234, average: 95.60, name: Sally
        Currrent num_students: 2
        Student added. updated num_students: 3
value returned: 0
13 - exam_add_student
        id: 456, average: 97.80, name: Paul
        Currrent num_students: 3
        Max number of students reachd!
value returned: 2
14 - exam_list_students
        Total of 3 students:
        id: 123, average: 94.50, name: John
        id: 234, average: 95.60, name: Sally
        id: 345, average: 96.70, name: Billy
value returned: 3
17 - exam_write_students_to_file
        filename: (null)
Error: filename is NULL
value returned: 1
17 - exam_write_students_to_file
        filename: asdf.txt
value returned: 0
18 - exam_read_students_from_file
        filename: asdf.txt
        123 94.500000 John
        234 95.599998 Sally
        345 96.699997 Billy
value returned: 0
19 - exam_display_students_from_list
id: 11, average: 90.11, name: Sam
id: 22, average: 90.22, name: Jack
id: 33, average: 90.33, name: Lisa
value returned: 0
20 - exam_return_total_lines
        main.c:         lines: 253, chars: 6881
        exam/exam.h:    lines: 158, chars: 4059
        exam/exam.c:    lines: 398, chars: 10282
Total lines: 809

In: Computer Science

what is correct About relative frequency distribution histogram(more can be choosen) 1. the total area of...

what is correct About relative frequency distribution histogram(more can be choosen)

1. the total area of all bars is equal to 1
2. the trial area of all bars is equal to the number of values in a sample
3. the total height of all bars are equal to 1.
4. the height of the bars highly depends on number of bins
5. the height of a bar is a percent values in the corresponding bin divided to its width
6. the height of a bar is a percent of values in corresponding bin.

what is correct about density distribution histogram(can choose several)
1. the total area of all bars are equal to 1
2. the total area of all bars is equal to the number of values in a sample
3. the sum of height of all bars is equal to 1
4. the height of bars highly depends in number of bins
5. the height of a bar is a percent of values in the corresponding bin divided by its width
6. the height of a bar is a percent of values in corresponding bin

In: Statistics and Probability

Net income $500 million, common stock $1 par. 1/1 shares outstanding 150 million shares, 2/1 retire...

Net income $500 million,

common stock $1 par.

1/1 shares outstanding 150 million shares,

2/1 retire for cash 24 million shares,

7/23 2-for-1 split. 9/1 sold for cash 18million shares

Preferred stock, 10% $60 par, cumulative, non-convertible $70 million.

Preferred stock, 8% $50 par, cumulative, convertible into 4 million shares common stock $100 million.

Incentive stock option outstanding, fully vested for 4 million shares of common stock, exercisable at $15 per share.

Bond payable, 12.5% convertible into 20 million shares of common stock $200 million.

The average market price of common stock was $20

The convertible preferred stock and the bonds payable had been issued at par in 2012

The tax rate was 40%

Require: calculate basic and diluted earnings per share for the year ended December 31, 2014

In: Finance

Each of the four independent situations below describes a sales-type lease in which annual lease payments...

Each of the four independent situations below describes a sales-type lease in which annual lease payments of $145,000 are payable at the beginning of each year. Each is a finance lease for the lessee. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $1) (Use appropriate factor(s) from the tables provided.)

Situation
1 2 3 4
Lease term (years) 6 6 7 7
Lessor's and lessee's interest rate 11% 10% 12% 12%
Residual value:
Estimated fair value 0 $59,000 $8,900 $59,000
Guaranteed by lessee 0 0 $8,900 $69,000


Determine the following amounts at the beginning of the lease: (Round your intermediate and final answer to the nearest whole dollar amount.)
  

Answer is complete but not entirely correct.

Situation
1 2 3 4
A The lessor’s:
1. Total lease payments $870,000selected answer correct $870,000selected answer correct $1,015,000selected answer correct $1,015,000selected answer correct
2. Gross investment in the lease 870,000selected answer correct 929,000selected answer correct 1,032,800selected answer incorrect 1,143,000selected answer incorrect
3. Net investment in the lease 680,906selected answer correct 776,514selected answer incorrect 805,193selected answer incorrect 799,054selected answer incorrect
B The lessee’s:
4. Total lease payments 870,000selected answer correct 870,000selected answer correct 1,023,900selected answer incorrect 1,084,000selected answer incorrect
5. Right-of-use asset 680,906selected answer correct 694,666selected answer correct 800,325selected answer incorrect 772,365selected answer incorrect
6. Lease liability 680,906selected answer correct 694,666selected answer correct 800,325selected answer incorrect 772,365selected answer incorrect

In: Accounting

The Harris Company is the lessee on a four-year lease with the following payments at the...

The Harris Company is the lessee on a four-year lease with the following payments at the end of each year:

Year 1: $ 11,500
Year 2: $ 16,500
Year 3: $ 21,500
Year 4: $ 26,500


An appropriate discount rate is 7 percentage, yielding a present value of $62,927.


a-1. If the lease is an operating lease, what will be the initial value of the right-of-use asset?




a-2. If the lease is an operating lease, what will be the initial value of the lease liability?




a-3. If the lease is an operating lease, what will be the lease expense shown on the income statement at the end of year 1?




a-4. If the lease is an operating lease, what will be the interest expense shown on the income statement at the end of year 1? (Leave no cells blank – be certain to enter “0” wherever required.)




a-5. If the lease is an operating lease, what will be the amortization expense shown on the income statement at the end of year 1? (Leave no cells blank – be certain to enter “0” wherever required.)




b-1. If the lease is a finance lease, what will be the initial value of the right-of-use asset?




b-2. If the lease is a finance lease, what will be the initial value of the lease liability?




b-3. If the lease is a finance lease, what will be the lease expense shown on the income statement at the end of year 1? (Leave no cells blank – be certain to enter “0” wherever required.)




b-4. If the lease is a finance lease, what will be the interest expense shown on the income statement at the end of year 1? (Round your answer to the nearest dollar amount.)




b-5. If the lease is a finance lease, what will be the amortization expense shown on the income statement at the end of year 1? (Round your answer to the nearest dollar amount.)

In: Finance

Each of the four independent situations below describes a sales-type lease in which annual lease payments...

Each of the four independent situations below describes a sales-type lease in which annual lease payments of $145,000 are payable at the beginning of each year. Each is a finance lease for the lessee. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $1) (Use appropriate factor(s) from the tables provided.)

Situation
1 2 3 4
Lease term (years) 6 6 7 7
Lessor's and lessee's interest rate 11% 10% 12% 12%
Residual value:
Estimated fair value 0 $59,000 $8,900 $59,000
Guaranteed by lessee 0 0 $8,900 $69,000


Determine the following amounts at the beginning of the lease: (Round your intermediate and final answer to the nearest whole dollar amount.)

Situation
1 2 3 4
A The lessor’s:
1. Total lease payments $870,000selected answer correct $870,000selected answer correct $1,015,000selected answer correct $1,015,000selected answer correct
2. Gross investment in the lease 870,000selected answer correct 929,000selected answer correct 1,032,800selected answer incorrect 1,143,000selected answer incorrect
3. Net investment in the lease 680,906selected answer correct 776,514selected answer incorrect 805,193selected answer incorrect 799,054selected answer incorrect
B The lessee’s:
4. Total lease payments 870,000selected answer correct 870,000selected answer correct 1,023,900selected answer incorrect 1,084,000selected answer incorrect
5. Right-of-use asset 680,906selected answer correct 694,666selected answer correct 800,325selected answer incorrect 772,365selected answer incorrect
6. Lease liability 680,906selected answer correct 694,666selected answer correct 800,325selected answer incorrect 772,365

In: Accounting