write a program that finds the average of all positive, non-zero values found in a given array of doubles and prints that to the console. Any negative or zero values do not contribute to the average. The program should use the array provided in the code, and you may assume that it has already been populated with values. The results should be printed out to the console in the following format:
“Average: ”<<average value>>
Values denoted in “<< >>” represent variable values, and strings in quotations denote literal values (make sure to follow spelling, capitalization, punctuation, and spacing exactly). Also, if there are either no non-zero or positive in the array then print out the average value as “0.0”.
Solution Tests:
Average: 7.0
Average: 3.5
Average: 0.0
PROVIDED CODE:
* Provided code. Do not alter the code that says "Do not alter"
* Make sure this at least compiles (no syntax errors)
* You may write additional methods to help
*/
//Do not alter-----------------------------------------------------------------------
import java.util.Scanner;
public class Question04 {
public static double[] array;//The array to be used in the problem
public static void main(String[] args) {
int number;//Used for the stairs
if(args == null || args.length == 0)
{
//-----------------------------------------------------------------------------------
double[] tempArray ={2.0,-4.0,-6.0,8.0,11.0};//You may change these values to test your solution
//Do not alter-----------------------------------------------------------------------
array = tempArray;
}
else
{
}
//-----------------------------------------------------------------------------------
//Write your solution here
}//Do not alter this
//Space for other methods if necessary-----------------------------------------------
//Write those here if necessary
//-----------------------------------------------------------------------------------
}//Do not alter this
/*Solution Description
* In: Computer Science
Smoky Mountain Corporation makes two types of hiking boots—the Xtreme and the Pathfinder. Data concerning these two product lines appear below: Xtreme Pathfinder Selling price per unit $ 120.00 $ 87.00 Direct materials per unit $ 65.20 $ 51.00 Direct labor per unit $ 11.20 $ 8.00 Direct labor-hours per unit 1.4 DLHs 1.0 DLHs Estimated annual production and sales 30,000 units 65,000 units The company has a traditional costing system in which manufacturing overhead is applied to units based on direct labor-hours. Data concerning manufacturing overhead and direct labor-hours for the upcoming year appear below: Estimated total manufacturing overhead $ 2,033,000 Estimated total direct labor-hours 107,000 DLHs Required: 1. Compute the product margins for the Xtreme and the Pathfinder products under the company’s traditional costing system. 2. The company is considering replacing its traditional costing system with an activity-based costing system that would assign its manufacturing overhead to the following four activity cost pools (the Other cost pool includes organization-sustaining costs and idle capacity costs): Estimated Overhead Cost Expected Activity Activities and Activity Measures Xtreme Pathfinder Total Supporting direct labor (direct labor-hours) $ 631,300 42,000 65,000 107,000 Batch setups (setups) 876,000 410 320 730 Product sustaining (number of products) 460,000 1 1 2 Other 65,700 NA NA NA Total manufacturing overhead cost $ 2,033,000 Compute the product margins for the Xtreme and the Pathfinder products under the activity-based costing system. 3. Prepare a quantitative comparison of the traditional and activity-based cost assignments.
In: Accounting
Smoky Mountain Corporation makes two types of hiking boots—the Xtreme and the Pathfinder. Data concerning these two product lines appear below: Xtreme Pathfinder Selling price per unit $ 121.00 $ 86.00 Direct materials per unit $ 65.30 $ 52.00 Direct labor per unit $ 13.50 $ 9.00 Direct labor-hours per unit 1.5 DLHs 1.0 DLHs Estimated annual production and sales 31,000 units 65,000 units The company has a traditional costing system in which manufacturing overhead is applied to units based on direct labor-hours. Data concerning manufacturing overhead and direct labor-hours for the upcoming year appear below: Estimated total manufacturing overhead $ 2,230,000 Estimated total direct labor-hours 111,500 DLHs Required:
1. Compute the product margins for the Xtreme and the Pathfinder products under the company’s traditional costing system.
2. The company is considering replacing its traditional costing system with an activity-based costing system that would assign its manufacturing overhead to the following four activity cost pools (the Other cost pool includes organization-sustaining costs and idle capacity costs): Estimated Overhead Cost Expected Activity Activities and Activity Measures Xtreme Pathfinder Total Supporting direct labor (direct labor-hours) $ 724,750 46,500 65,000 111,500 Batch setups (setups) 975,000 420 330 750 Product sustaining (number of products) 470,000 1 1 2 Other 60,250 NA NA NA Total manufacturing overhead cost $ 2,230,000 Compute the product margins for the Xtreme and the Pathfinder products under the activity-based costing system.
3. Prepare a quantitative comparison of the traditional and activity-based cost assignments.
In: Accounting
Smoky Mountain Corporation makes two types of hiking boots—the Xtreme and the Pathfinder. Data concerning these two product lines appear below:
| Xtreme | Pathfinder | |||||
| Selling price per unit | $ | 124.00 | $ | 88.00 | ||
| Direct materials per unit | $ | 63.40 | $ | 53.00 | ||
| Direct labor per unit | $ | 14.40 | $ | 8.00 | ||
| Direct labor-hours per unit | 1.8 | DLHs | 1.0 | DLHs | ||
| Estimated annual production and sales | 23,000 | units | 70,000 | units | ||
The company has a traditional costing system in which manufacturing overhead is applied to units based on direct labor-hours. Data concerning manufacturing overhead and direct labor-hours for the upcoming year appear below:
| Estimated total manufacturing overhead | $ | 2,005,200 | ||
| Estimated total direct labor-hours | 111,400 | DLHs | ||
Required:
1. Compute the product margins for the Xtreme and the Pathfinder products under the company’s traditional costing system.
2. The company is considering replacing its traditional costing system with an activity-based costing system that would assign its manufacturing overhead to the following four activity cost pools (the Other cost pool includes organization-sustaining costs and idle capacity costs):
| Estimated Overhead Cost |
Expected Activity | |||||
| Activities and Activity Measures | Xtreme | Pathfinder | Total | |||
| Supporting direct labor (direct labor-hours) | $ | 712,960 | 41,400 | 70,000 | 111,400 | |
| Batch setups (setups) | 504,000 | 230 | 190 | 420 | ||
| Product sustaining (number of products) | 740,000 | 1 | 1 | 2 | ||
| Other | 48,240 | NA | NA | NA | ||
| Total manufacturing overhead cost | $ | 2,005,200 | ||||
Compute the product margins for the Xtreme and the Pathfinder products under the activity-based costing system.
3. Prepare a quantitative comparison of the traditional and activity-based cost assignments.
In: Accounting
This is an intro to java question. Please post with pseudocode and java code.
Problem should be completed using repetition statements like
while and selection statements.
Geometry (10 points) Make API (API design) Java is an extensible
language, which means you can expand the programming language with
new functionality by adding new classes. You are tasked to
implement a Geometry class for Java that includes the following API
(Application Programming Interface): Geometry Method API: Modifier
and Type Method and Description static double
getAreaRectangle(double width, double length) Returns the area of a
rectangle, area = length * width static double getAreaCircle(double
radius) Returns the area of a circle, area = ?(radius 2 ) static
double getAreaTriangle(double base, double height) Returns the area
of a triangle, area = ½(base * height) static double
getPerimeterRectangle(double width, double length) Returns the
perimeter of a Rectangle, perimeter = 2(length + width) static
double getPerimeterCircle(double radius) Returns the perimeter of a
Circle, perimeter = 2?(radius) static double
getPerimeterTriangle(double side1, double side2, double side3)
Returns the perimeter of a triangle, perimeter = s1 + s2 + s3 Facts
● Java Math class contains an approximation for PI, i.e. Math.PI ●
Your Geometry class implementation should not have a main method. ●
NO Scanner for input & NO System.out for output! Input The
Geometry class will be accessed by an external Java Application
within Autolab. This Java app will send data in as arguments into
each of the methods parameters. Output The Geometry class should
return the correct data calculations back to the invoking client
code
Sample Method Calls
getAreaRectangle(1,1);
getAreaCircle(1);
getAreaTriangle(1,1);
getPerimeterRectangle(1,1);
getPerimeterCircle(1);
getPerimeterTriangle(1,1,1);
Sample Method Returns
1.0
3.141592653589793
0.5
4.0
6.283185307179586
3.0
In: Computer Science
C -Language Create a simple calculator that performs addition, subtraction, multiplication, and division. Your program should prompt the user for the operation they wish to perform followed by the numbers they wish to operate on. You should have a function for each operation and use branches to determine which function to call.
I need this to make any integers given, into decimal numbers, such as 3 to 3.0, or 2 to 2.0, also, so that I can multiply or add things like 2.5 + 3.0 or 2.5 * 2.5, etc.
Thank you, please see my code below.
-------------------------------------------------------------
MY CODE:*****
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//Functions
int add(int a, int b)
{
return a + b;
}
int sub(int a, int b)
{
return a - b;
}
int mul(int a, int b)
{
return a * b;
}
float div(int a, int b)
{
return a * 1.0 / b;
}
int main()
{
int result, a, b, choice;
float res;
//User prompts
printf("Math Calculator: What type of operation would you like me to use? (You will choose numbers after selection) : \n1.Addition\n2.Subtraction\n3.Multiply\n4.Divide\n");
scanf("%d", &choice);
printf("Enter first number : ");
scanf("%d", &a);
printf("Enter second number : ");
scanf("%d", &b);
//Cases
switch (choice) {
case 1:
result = add(a, b);
printf("The answer equals %d", result);
break;
case 2:
result = sub(a, b);
printf("The answer equals %d", result);
break;
case 3:
result = mul(a, b);
printf("The answer equals %d", result);
break;
case 4:
res = div(a, b);
printf("The answer equals %f", res);
break;
default:
printf("You did not select a valid operation from above.");
break;
}
return 0;
}
In: Computer Science
Match the lumber column section to their appropriate size factor (Cf)
|
|
5 points
QUESTION 2
"A 12ft tall column is made of 4x8 Douglas-Fir-South #1 wood. If the column is pinned (hinged) at both ends, calculate the service load capacity, in whole pounds, of the column. Assume normal temperature and moisture conditions."
1 points
QUESTION 3
"A 12ft tall column is made of 5x5 Hem-Fir #2 wood. If the column is pinned (hinged) at both ends, calculate the service load capacity, in whole pounds, of the column. Assume normal temperature and moisture conditions."
1 points
QUESTION 4
"An 18ft tall column is made of 4X6 Douglas-Fir-South Sel Struct wood. If the column is braced half-way on its weak axis and its hinged on both ends, calculate the column service load capacity. Assume normal conditions."
1 points
QUESTION 5
"An 18ft tall column is made of 6x8 Douglas-Fir-South #1 wood. If the column is braced half-way on its weak axis and its hinged on both ends, calculate the column service load capacity. Assume normal conditions."
In: Civil Engineering
As a consultant specializing in economics, you have been hired by the small island nation of Petrolo. Although Petrolo’s landmass is small (about the size of Florida), it enjoys enormous oil reserves that rank number five in the world for high grade petroleum. To date Petrolo has not found it necessary to drill into its substantial but at a higher production cost of offshore reserves that are within the 18 mile territorial limit. Petrolo has prospered by pumping enough onshore oil to allow its government to provide handsome social benefits and low taxes to its population while maintaining full employment. Although its only industry is crude oil supply, the country enjoys one of the highest standards of living in the world. Unfortunately, the industrial economies of the world have slowed tremendously in petroleum consumption; world demand for oil is now at a 25 year low; oil prices are at about 30% of what they were a year ago. Today a barrel of oil is selling for $40 while Petrolo’s current average cost of pumping oil is $50 per barrel. As the special consultant to the President, you have been asked to evaluate the economic impact of four options and make a specific recommendation for what the country should do. The options are: Option 1: Stop pumping until the market price reaches at least the extraction cost of $50 a barrel. Option 2: Keep pumping to provide some cash flow. Option 3: Sell offshore licenses to private international companies, which would pay a royalty of $15 per barrel with all extraction costs borne by the licensees. Option 4: Prepare a bond to finance entry into the leisure market with high-end hotels, casinos and entertainment venues. Although this would restrict drilling operations to southern half of the island, the northern end of Petrolo could become a magnificent tourism venue for the world’s wealthy. Tax-free operations for the first ten years of operations for major hotel/casino operations would entice investment. Assignment Prepare a 4 - 6 page paper that uses 2 or more sources, adheres to APA standards and addresses the following: For each of the four options, identify three (3) potential economic impacts considering both possible benefits and downsides and implications for Petrolo’s government and citizens. Based on your analysis and research, make one or more specific recommendations to address the issue.
In: Economics
Garner Strategy Institute (GSI) presents executive-level training seminars nationally. Eastern University (EU) has approached GSI to present 40 one-week seminars during 2019. This activity level represents the maximum number of seminars that GSI is capable of presenting annually. GSI staff would present the week-long seminars in various cities throughout the United States and Canada. Terry Garner, GSI’s president, is evaluating three financial options for the revenues from Eastern: accept a flat fee for each seminar, receive a percentage of Eastern’s profit before tax from the seminars, and form a joint venture to share costs and profits. Estimated costs for the 2019 seminar schedule follow: Garner Strategy Institute Eastern University Fixed costs for the year: Salaries and benefits $ 200,000 N/A * Facilities 46,000 N/A * Travel and hotel 0 $ 360,920 Other 72,000 N/A * Total fixed costs $ 318,000 $ 360,920 Variable cost per participant: Supplies and materials 0 $ 47 Marketing 0 18 Other site costs 0 35 *Eastern’s fixed costs are excluded because the amounts are not considered relevant for this decision (i.e., they will be incurred whether or not the seminars are presented). Eastern does not include these costs when calculating the profit before tax for the seminars. EU plans to charge $1,200 per participant for each 1-week seminar. It will pay all variable marketing, site costs, and materials costs. Required 1. Assume that the seminars are handled as a joint venture by GSI and EU to pool costs and revenues. a. Determine the total number of seminar participants needed to break even on the total costs for this joint venture. b. Assume that the joint venture has an effective income tax rate of 30%. How many seminar participants must the joint venture enroll to earn an after-tax income of $97,209? 2. Assume that GSI and EU do not form a joint venture, but that GSI is an independent contractor for EU. EU offers two payment options to GSI: a flat fee of $9,500 for each seminar or a fee of 40% of EU’s profit before taxes from the seminars. Compute the minimum number of participants needed for GSI to prefer the 40% fee option over the flat fee.
double figures for fixed assets because there are 2, one for gsi and one for eu
In: Accounting
A random sample of 366 married couples found that 292 had two or more personality preferences in common. In another random sample of 552 married couples, it was found that only 20 had no preferences in common. Let p1 be the population proportion of all married couples who have two or more personality preferences in common. Let p2 be the population proportion of all married couples who have no personality preferences in common.
(a) Find a 95% confidence interval for p1 – p2. (Use 3 decimal places.)
| lower limit | |
| upper limit |
The U.S. Geological Survey compiled historical data about Old Faithful Geyser (Yellowstone National Park) from 1870 to 1987. Let x1 be a random variable that represents the time interval (in minutes) between Old Faithful eruptions for the years 1948 to 1952. Based on 9740 observations, the sample mean interval was x1 = 61.8 minutes. Let x2 be a random variable that represents the time interval in minutes between Old Faithful eruptions for the years 1983 to 1987. Based on 25,925 observations, the sample mean time interval was x2 = 71.4 minutes. Historical data suggest that σ1 = 8.07 minutes and σ2 = 12.69 minutes. Let μ1 be the population mean of x1 and let μ2 be the population mean of x2.
(b) Compute a 90% confidence interval for μ1 – μ2. (Use 2 decimal places.)
| lower limit | |
| upper limit |
(c) Comment on the meaning of the confidence interval in the context of this problem. Does the interval consist of positive numbers only? negative numbers only? a mix of positive and negative numbers? Does it appear (at the 90% confidence level) that a change in the interval length between eruptions has occurred? Many geologic experts believe that the distribution of eruption times of Old Faithful changed after the major earthquake that occurred in 1959.
Because the interval contains only positive numbers, we can say that the interval length between eruptions has gotten shorter.
Because the interval contains both positive and negative numbers, we can not say that the interval length between eruptions has gotten longer.
We can not make any conclusions using this confidence interval.
Because the interval contains only negative numbers, we can say that the interval length between eruptions has gotten longer.
In: Statistics and Probability