Problem D Job Expenses...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem D Job Expenses <Hide At ACME Corp, the seller Robin is selling software like hotcakes. To sell the software, he arranges meetings all over the country. Of course, he always needs to travel there, and sometimes even stay the night. Other times, he decides that a hot dog on the way to a meeting counts as accommodation. Because Robin is very busy, he hasn't been able to file his job expenses this month. Eret, the accountant, told him that he could fix it for him, as long as he got the price of all the expenses along with the receipts. Robin did this but misheard him: He has provided a list of all expenses and incomes he has brought in last month, with incomes as positive integers and expenses as negative integers. Can you help Eret find out how much expenses Robin has paid for the last month? Input The input consist of two lines: One line with the integer N, and one line with N integers kį, representing the numbers Robin has written down. Output Output the sum of all the expenses Robin has paid for the last month. Limits . 0≤ N20 000 -50 000 ≤ k < 500 000 and k; # 0 Sample Input 1 3 1 -2 3 Sample Input 2 5 129 44 394 253 147 Sample Input 3 10 -100 40000 -6500 -230 -18 34500 Sample Output 1 2 Sample Output 2 0 Sample Output 3 7398 Problem D Job Expenses <Hide At ACME Corp, the seller Robin is selling software like hotcakes. To sell the software, he arranges meetings all over the country. Of course, he always needs to travel there, and sometimes even stay the night. Other times, he decides that a hot dog on the way to a meeting counts as accommodation. Because Robin is very busy, he hasn't been able to file his job expenses this month. Eret, the accountant, told him that he could fix it for him, as long as he got the price of all the expenses along with the receipts. Robin did this but misheard him: He has provided a list of all expenses and incomes he has brought in last month, with incomes as positive integers and expenses as negative integers. Can you help Eret find out how much expenses Robin has paid for the last month? Input The input consist of two lines: One line with the integer N, and one line with N integers kį, representing the numbers Robin has written down. Output Output the sum of all the expenses Robin has paid for the last month. Limits . 0≤ N20 000 -50 000 ≤ k < 500 000 and k; # 0 Sample Input 1 3 1 -2 3 Sample Input 2 5 129 44 394 253 147 Sample Input 3 10 -100 40000 -6500 -230 -18 34500 Sample Output 1 2 Sample Output 2 0 Sample Output 3 7398
Expert Answer:
Answer rating: 100% (QA)
Expensesjava import javautil public class Expenses ... View the full answer
Related Book For
Posted Date:
Students also viewed these computer engineering questions
-
When business transactions are conducted by the exchange of assets on site, there is no ambiguity in revenue recognition. In practice, however, transactions are often conducted without immediate...
-
Assume that Freeland could produce 8 units of X and no Y, 16 units of Y and no X, or any linear combination in between, and Braveburg could produce 32 units of X and no Y, 48 units of Y and no X, or...
-
Use library or Internet resources to find the major international stock exchanges on which Volkswagen AG is listed. Write a short paper on the complexities relative to ethics of listing on stock...
-
Consider the problem of minimizing (x, y) = x subject to g(x, y) = (x 1) 3 y 2 = 0. (a) Show, without using calculus, that the minimum occurs at P = (1, 0). (b) Show that the Lagrange condition P =...
-
Of Ghisellis six traits, which does your boss possess? Are there any that she or he does not possess?
-
A viral infection is spread by contact with an infected person. Let the probability that a healthy person gets the infection in one contact be p = .4. (a) An infected person has contact with six...
-
The equation of motion for the forced vibration of a single-degree-of-freedom nonlinear system can be expressed as \[\ddot{x}+c \dot{x}+k_{1} x+k_{2} x^{3}=a_{1} \cos 3 \omega t-a_{2} \sin 3 \omega...
-
Garden depot is a retailer that is preparing its budget for the upcoming fiscal year. Management has prepared the following summary of its budgeted cash flows: The companys beginning cash balance for...
-
Morganton Company makes one product and it provided the following information to help prepare the master budget: a. The budgeted selling price per unit is $65. Budgeted unit sales for June, July,...
-
A local gas station owner, Michael, is looking to invest in LED lighting displays around his fuel pumps to distinguish his station from the one just down the street. He has received several bids from...
-
1. Briefly explain what GKE is and how it works. 2. What are the main advantages of using a managed service such as GKE over on-premise (non-hosted) solutions? 3. What are the disadvantages of using...
-
Three groups of children were given two tests. The numbers of children and the sample correlation coefficients between the two test scores in each group were as follows: Is there any evidence that...
-
Considering conflict from a critical perspective involves a focus on the key concept of power in social relationships. That power may be expressed either covertly or overtly. The location of power...
-
Because of extra-inning games, the median might be a more meaningful statistic for the length-of-game data in the previous exercise. The median length of all 2430 MLB games in 2018 was min. a. Use...
-
The number of stores a person visits on a shopping trip Name and define the four types of measurement levels used in statistics. determine whether the data are qualitative or quantitative.
-
Exercise 16 of Chapter 1 presented data on the noise level (dBA) experienced by a sample of 77 individuals working at a particular office. a. Construct a 95% confidence interval for the true average...
-
30 year loan is being paid off by amortization, with payments made at the end of each year. The first 5 payments are $0, the next 11 payments are $600 each, and the subsequent 14 payments increase by...
-
Show that, given a maximum flow in a network with m edges, a minimum cut of N can be computed in O(m) time.
-
Which of the following markets are perfectly competitive or monopolistically competitive. Why? a. Soy market b. Retail clothing stores c. Spagos Restaurant Beverly Hills
-
If country A is the lowest opportunity cost producer of X and country B is the lowest opportunity cost producer of Y, what happens to their absolute and comparative advantages if country A suddenly...
-
Multiple Choice Questions 1. In a supply and demand graph, the triangular area under the demand curve but above the market price is a. The consumer surplus. b. The producer surplus. c. The marginal...
-
What do you really enjoy doing? What is your passion? Can your passion be a platform for a viable opportunity?
-
What do your friends and family envision you doing? What strengths and weaknesses do they observe? How do their insights help lead you to an opportunity that is right for you?
-
Put several of your ideas through the opportunity checklist in Figure 3.10. Which ideas seem to have the highest potential? Customer Identifiable Demographics Psychographics Trends Macromarket Target...
Study smarter with the SolutionInn App