Write a C++ program for the following problem:
Calculate and print the area and volume of a cone inside a While loop that goes from 1 to 20 with a step of .5. (the step is 1/2 or Point 5, so you go 10, 10.5,11, 11.5)
Note: Your loop variable will need to be a double data type
Use two decimal places on all numbers that are double data type.
This will be a table with 3 columns. Don't worry about borders or grid lines on the table.
print column headings outside the loop
Use r as the loop counter and as the radius. Let the height of the cone be twice the radius.
Below the while loop, print the sum of all 3 columns
In: Computer Science
The range of integers that can be represented by this 12-bit construction is -255 to 255 (a 9-bit signed integer has a range of -256 to 255). What are the floating-point representations for the first eight, odd, positive, decimal integers (i.e., 1, 3, 5, 7, 9, 11, 13, 15) in this 12-bit notation?
In: Computer Science
Solve question by python
Question: Day Old Bread
A bakery sells loaves of bread for $3.49 each. Day old bread is
discounted by 60 percent. Write a program that begins by reading
the number of loaves of day-old bread being purchased from the
user. Then your program should display the:
• Regular price for the bread
• The discount because it is a day old
• The total price.
Reading input: 1 mark
All of the values should be displayed using two decimal places, and
the decimal points in all of the numbers should be aligned when
reasonable values are entered by the user.
Declare the bread price and the discount amount as constants.
Include appropriate comments throughout your code including a
header comment to briefly describe the purpose of your code.
Name your file: dayoldbread.py
In: Computer Science
. Provide a short, real-world workplace scenario that exemplifies at least one type of discrimination you researched. (Disability, pregnancy, race, color, religion, sex, national original….) b. Discuss how the FMLA serves to discourage workplace discrimination.
In: Accounting
John is listening to a horn. When the horn and John are both at rest, the frequency of the horn is 300 Hz. If he hears a pitch of 330 Hz, there are clearly several possibilities. State which of the possibilities are correct.
1. Both can be moving and have the same speed
2. John is moving towards the horn at rest
3. The distance between John and the horn is increasing with time
4. Both can be moving in opposite directions
5. Both can be moving and have different speeds
6. John and the horn are both moving in the same direction but John is behind and moving faster than the horn
In: Physics
Suppose we have the following returns for large-company stocks and Treasury bills over a six-period:
Year Large Company US Treasury Bill
1 |
3.88% |
5.78% |
2 | 14.31 | 2.45 |
3 | 19.05 | 3.68 |
4 | -14.63 | 7.12 |
5 | -32.12 | 4.92 |
6 | 37.29 |
4.89 |
a. Calculate the arithmetic average returns for large-company stocks and T-bills over this period.( Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places.)
b. Calculate the standard deviation of the returns for large-company stocks and T-bills over this period. ( Do not round intermediate calculations and enter your answers as a percent to 2 decimal places.)
c-1. Calculate the observed risk premium in each year for the large-company stocks versus the T-bills. What was the average premium over this period? (A negative answer should be indicated by a minus sign. Do not round intermediate calculations and enter your answer as a percent rounded to 2 decimal places.)
c-2: Calculate the observed risk premium in each year for the large-company stocks versus the T-bills. What was the standard deviation of the risk premium over this period? ( Do not round intermediate calculations and enter your answer as a percent rounded to 2 decimal places.)
In: Finance
Selected Dividend Transactions, Stock Split
Selected transactions completed by Canyon Ferry Boating Corporation during the current fiscal year are as follows.
Journalize the transactions.
If no entry is required, select "No entry required" and leave the amount boxes blank. If an amount box does not require an entry, leave it blank.
Jan. 8. Split the common stock 3 for 1 and reduced the par from $84 to $28 per share. After the split, there were 135,000 common shares outstanding.
Jan. 8. | |||
Apr. 30. Declared semiannual dividends of $1.30 on 9,000 shares of preferred stock and $0.08 on the common stock payable on July 1.
Apr. 30. | |||
July 1. Paid the cash dividends.
July 1. | |||
Oct. 31. Declared semiannual dividends of $1.30 on the preferred stock and $0.06 on the common stock (before the stock dividend). In addition, a 3% common stock dividend was declared on the common stock outstanding. The fair market value of the common stock is estimated at $50.
Cash Dividends | |||
Stock dividends | |||
Dec. 15. Paid the cash dividends and issued the certificates for the common stock dividend.
Payment | |||
Issuance | |||
In: Accounting
What do you understand by abstract data type or ADT? Provide examples and discuss implementation mechanisms in C++ and in object-oriented programming languages in general.
In: Computer Science
What role does the Accounting Information System play in the production cycle by taking a Company as sample study?
In: Accounting
Can you please write this in python thank you.
Consider 'x' being a number chosen by a user. Using python conditional statements, write a code that:
In: Computer Science
What are the advantage and disadvantage of assuming normally distributed returns in meanvariance analysis?
In: Math
three samples of technical writing (minimum of 1 page each), on the art of communication, how to control your emotions and the importance of psychologists. please don't copy and paste from the internet.
In: Psychology
In: Psychology
1. Write a Java program from scratch that meets the following requirements:
a. The program is in a file called Duplicates.java that defines a class called Duplicates (upper/lower case matters)
b. The program includes a Java method called noDuplicates that takes an array of integers and returns true if all the integers in that array are distinct (i.e., no duplicates). Otherwise it returns false. Make sure the method is public static.
example tests: noDuplicates({}) returns true
noDuplicates({-1, 1}) returns true noDuplicates({4,22,100,99,1,5,7}) returns true
noDuplicates({4,22,100,99,22,5,7}) returns false
c. The program’s main method calls noDuplicates on the above test cases and prints each return value.
2. Write a Java program from scratch that meets the following requirements:
a. The program is in a file called Matching.java that defines a class called Matching.
b. The program includes a Java method called find that takes two Strings and returns an integer. If the second string does not appear in the first string, find returns -1. If the second string appears in the first string, find returns the index of the character where the second string begins in the first string. Make sure the method is public static.
example tests:
find("","") returns 0
find("", "a") returns -1
find("Hello World", "World") returns 6
find("World", "Hello World") returns -1
In: Computer Science
Consider a list called A:
A = [-6, 10, 100, 5, -20, 1000, 9, -15]
Make a for loop that iterates over A and:
In: Computer Science