Overview
For this assignment, write a program that will calculate the amount that a customer spends on tickets at a movie theater.
This program will be continued in program 3 so it is important that this program is completed.
Basic Program Logic
The basic logic for this program is similar to program 1: the user is asked to enter values, a calculation is performed, and the result of the calculation is displayed.
For this program, prompt the user for the number of adult tickets they would like to purchase. This is an integer value and must be placed into an int variable.
Prompt the user for the number of childrens tickets they would like to purchase. This value should also be placed in an int variable.
Calculate the user's purchase amount using a cost of $11.25 for a single adult ticket and $4.50 for a single child ticket. The purchase amount is the cost of adult tickets plus the cost of childrens tickets.
After the calculation, display the number of adult tickets that were purchased, the number of childrens tickets that were purchased, and the total purchase amount. Use the setw manipulator to line up the last digit of the number of tickets that were purchased and the total purchase amount. The total purchase amount should be displayed with exactly 2 digits after the decimal point, including zeroes.
Program Requirements
At the top of the C++ source code, include a documentation box that resembles the one from program 1.Make sure the Date Due and Purpose are updated to reflect the current program.
Include line documentation. There is no need to document every single line, but logical "chunks" of code should be preceded by a line or two that describes what the "chunk" of code does. This will be a part of every program that is submitted for the remainder of the semester.
The calculated dollar amount should be displayed with exactly 2 digits after the decimal point.
The numeric values read in from the user should all be integer values. Use meaningful variable names.
Make sure and test the program with values other than the ones supplied in the sample output.
Hand in a copy of the source code (CPP file) using Blackboard.
Sample Output
A few runs of the program should produce the following results:
Run 1
Enter the number of adult tickets that are being purchased: 2
Enter the number of child tickets that are being purchased: 5
************************************
Theater Sale
************************************
Number of adult tickets: 2
Number of child tickets: 5
Total purchase: 45.00
Run 2
Enter the number of adult tickets that are being purchased: 1
Enter the number of child tickets that are being purchased: 2
************************************
Theater Sale
************************************
Number of adult tickets: 1
Number of child tickets: 2
Total purchase: 20.25
Run 3
Enter the number of adult tickets that are being purchased: 21
Enter the number of child tickets that are being purchased: 0
************************************
Theater Sale
************************************
Number of adult tickets: 21
Number of child tickets: 0
Total purchase: 236.25
Run 4
Enter the number of adult tickets that are being purchased: 0
Enter the number of child tickets that are being purchased: 0
************************************
Theater Sale
************************************
Number of adult tickets: 0
Number of child tickets: 0
Total purchase: 0.00In: Computer Science
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 38 arrests last month, 21 were of males aged 15 to 34 years. Use a 1% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%. (a) What is the level of significance? State the null and alternate hypotheses. H0: p = 0 .7; H1: p < 0.7 H0: p = 0.7; H1: p > 0.7 H0: p ≠ 0.7; H1: p = 0.7 H0: p = 0.7; H1: p ≠ 0.7 H0: p < 0 .7; H1: p = 0.7 (b) What sampling distribution will you use? The Student's t, since np > 5 and nq > 5. The standard normal, since np < 5 and nq < 5. The standard normal, since np > 5 and nq > 5. The Student's t, since np < 5 and nq < 5. What is the value of the sample test statistic? (Round your answer to two decimal places.) (c) Find the P-value of the test statistic. (Round your answer to four decimal places.) Sketch the sampling distribution and show the area corresponding to the P-value. WebAssign Plot WebAssign Plot WebAssign Plot WebAssign Plot (d) Based on your answers in parts (a) to (c), will you reject or fail to reject the null hypothesis? Are the data statistically significant at level α? At the α = 0.01 level, we reject the null hypothesis and conclude the data are statistically significant. At the α = 0.01 level, we reject the null hypothesis and conclude the data are not statistically significant. At the α = 0.01 level, we fail to reject the null hypothesis and conclude the data are statistically significant. At the α = 0.01 level, we fail to reject the null hypothesis and conclude the data are not statistically significant. (e) Interpret your conclusion in the context of the application. There is sufficient evidence at the 0.01 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%. There is insufficient evidence at the 0.01 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 34 arrests last month, 26 were of males aged 15 to 34 years. Use a 5% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%.
(a) What is the level of significance?
State the null and alternate hypotheses.
H0: p = 0.7; H1: p ≠ 0.7
H0: p < 0 .7; H1: p = 0.7
H0: p ≠ 0.7; H1: p = 0.7
H0: p = 0.7; H1: p > 0.7
H0: p = 0 .7; H1: p < 0.7
(b) What sampling distribution will you use?
The standard normal, since np > 5 and nq > 5.
The standard normal, since np < 5 and nq < 5.
The Student's t, since np > 5 and nq > 5.
The Student's t, since np < 5 and nq < 5.
What is the value of the sample test statistic? (Round your answer
to two decimal places.)
(c) Find the P-value of the test statistic. (Round your
answer to four decimal places.)
Sketch the sampling distribution and show the area corresponding to
the P-value.
(d) Based on your answers in parts (a) to (c), will you reject or
fail to reject the null hypothesis? Are the data statistically
significant at level α?
At the α = 0.05 level, we reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we reject the null hypothesis and conclude the data are not statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
There is sufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
There is insufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 37 arrests last month, 26 were of males aged 15 to 34 years. Use a 10% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%.
(a) What is the level of significance?__
State the null and alternate hypotheses.
___H0: p = 0.7; H1: p ≠ 0.7
___H0: p ≠ 0.7; H1: p = 0.7
___H0: p = 0.7; H1: p > 0.7
___H0: p = 0 .7; H1: p < 0.7
___H0: p < 0 .7; H1: p = 0.7
(b) What sampling distribution will you use?
___The Student's t, since np > 5 and nq > 5.
___The Student's t, since np < 5 and nq < 5.
___The standard normal, since np < 5 and nq < 5.
___The standard normal, since np > 5 and nq > 5.
What is the value of the sample test statistic? (Round your answer
to two decimal places.)_______
(c) Find the P-value of the test statistic. (Round your
answer to four decimal places.)_______
(d) Based on your answers in parts (a) to (c), will you reject or fail to reject the null hypothesis? Are the data statistically significant at level α?
__At the α = 0.10 level, we reject the null hypothesis and conclude the data are statistically significant.
__At the α = 0.10 level, we reject the null hypothesis and conclude the data are not statistically significant.
__At the α = 0.10 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
__At the α = 0.10 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
__There is sufficient evidence at the 0.10 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
__There is insufficient evidence at the 0.10 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 37 arrests last month, 29 were of males aged 15 to 34 years. Use a 5% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%.
(a) What is the level of significance?
State the null and alternate hypotheses.
H0: p = 0 .7; H1: p < 0.7
H0: p = 0.7; H1: p > 0.7
H0: p = 0.7; H1: p ≠ 0.7
H0: p < 0 .7; H1: p = 0.7
H0: p ≠ 0.7; H1: p = 0.7
(b) What sampling distribution will you use?
The standard normal, since np > 5 and nq > 5.
The Student's t, since np < 5 and nq < 5.
The Student's t, since np > 5 and nq > 5.
The standard normal, since np < 5 and nq < 5.
What is the value of the sample test statistic? (Round your answer
to two decimal places.)
(c) Find the P-value of the test statistic. (Round your
answer to four decimal places.)
Sketch the sampling distribution and show the area corresponding to
the P-value.
(d) Based on your answers in parts (a) to (c), will you reject or
fail to reject the null hypothesis? Are the data statistically
significant at level α?
At the α = 0.05 level, we reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we reject the null hypothesis and conclude the data are not statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
There is sufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
There is insufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 35 arrests last month, 25 were of males aged 15 to 34 years. Use a 10% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%.
(a) What is the level of significance?
State the null and alternate hypotheses.
H0: p = 0 .7; H1: p < 0.7
H0: p = 0.7; H1: p > 0.7
H0: p = 0.7; H1: p ≠ 0.7
H0: p < 0 .7; H1: p = 0.7
H0: p ≠ 0.7; H1: p = 0.7
(b) What sampling distribution will you use?
The Student's t, since np > 5 and nq > 5.The standard normal, since np < 5 and nq < 5.
The standard normal, since np > 5 and nq > 5.The Student's t, since np < 5 and nq < 5.
What is the value of the sample test statistic? (Round your answer
to two decimal places.)
(c) Find the P-value of the test statistic. (Round your
answer to four decimal places.)
Sketch the sampling distribution and show the area corresponding to
the P-value.
(d) Based on your answers in parts (a) to (c), will you reject or
fail to reject the null hypothesis? Are the data statistically
significant at level α?
At the α = 0.10 level, we reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.10 level, we reject the null hypothesis and conclude the data are not statistically significant.
At the α = 0.10 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.10 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
There is sufficient evidence at the 0.10 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
There is insufficient evidence at the 0.10 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
Is the national crime rate really going down? Some sociologists say yes! They say that the reason for the decline in crime rates in the 1980s and 1990s is demographics. It seems that the population is aging, and older people commit fewer crimes. According to the FBI and the Justice Department, 70% of all arrests are of males aged 15 to 34 years†. Suppose you are a sociologist in Rock Springs, Wyoming, and a random sample of police files showed that of 39 arrests last month, 26 were of males aged 15 to 34 years. Use a 5% level of significance to test the claim that the population proportion of such arrests in Rock Springs is different from 70%.
(a) What is the level of significance?
State the null and alternate hypotheses.
H0: p = 0.7; H1: p > 0.7
H0: p = 0.7; H1: p ≠ 0.7
H0: p = 0 .7; H1: p < 0.7
H0: p ≠ 0.7; H1: p = 0.7
H0: p < 0 .7; H1: p = 0.7
(b) What sampling distribution will you use?
The Student's t, since np > 5 and nq > 5.
The standard normal, since np < 5 and nq < 5.
The standard normal, since np > 5 and nq > 5.
The Student's t, since np < 5 and nq < 5.
What is the value of the test statistic? (Round your answer to two
decimal places.)
(c) Find the P-value of the test statistic. (Round your
answer to four decimal places.)
Sketch the sampling distribution and show the area corresponding to
the P-value.
(d) Based on your answers in parts (a) to (c), will you reject or
fail to reject the null hypothesis? Are the data statistically
significant at level α?
At the α = 0.05 level, we reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we reject the null hypothesis and conclude the data are not statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the α = 0.05 level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
(e) Interpret your conclusion in the context of the
application.
There is sufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
There is insufficient evidence at the 0.05 level to conclude that the true proportion of arrests of males aged 15 to 34 in Rock Springs differs from 70%.
In: Statistics and Probability
In: Finance
In: Operations Management
What are the differences between a casino hotel and other types of hotels in terms of the organization, facility, and management?
In: Operations Management