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 =...
-
Let X be a Poisson random variable with l = 1 / 3. Find (a) P(X = 0) (b) P(X 4).
-
A hole is drilled through the narrow end of a \(0.960-\mathrm{kg}\) baseball bat, and the bat is hung on a nail so that it can swing freely (Figure P15.85). The bat is \(0.860 \mathrm{~m}\) long, the...
-
The following MINITAB output presents a 95% confidence interval for the mean ozone level on days when the relative humidity is 60%, and a 95% prediction interval for the ozone level on a particular...
-
A sample of an ideal gas goes through the process shown in Figure P20.32. From A to B, the process is adiabatic; from B to C, it is isobaric with 100 kJ of energy entering the system by heat. From C...
-
A Fox News poll of 900 registered voters found that 19% of Americans "regift" (give gifts that they received as gifts). Women (21%) are more likely to regift than men (16%), and the results are...
-
Cinder Inc. is a Canadian-controlled private corporation based in your province. The company operates a wholesale business. The following information is provided for its year ended May 31, 2020: 1....
-
Consider the following two sets A, B that represents two group of people in the social media, if the connections between the two sets are as follow: A= {a,b,c,d,e,f} B={al,bl,cl,dl} Connection set ={...
-
The term Philosophy is derived from two Greek words, Philia meaning to love or to befriend and, Sophia meaning wisdom. Thus, philosophy, means the love of wisdom. It was coined by Pythagoras, one of...
-
The company XYZ has scheduled to put $7,389 of excess earnings in a savings account at the end of EACH of the following eight years. The interest rate of the account is 3.5% p.a.. How much will the...
-
Damron, Incorporated, has 246,000 shares of stock outstanding. Each share is worth $47, so the company's market value of equity is $11,562,000. Suppose the firm issues 40,000 new shares at the...
-
For Feet's Sake has two classes of stock authorized: 8%, $10 par preferred, and $1 par value common. The following transactions affect stockholders' equity during 2024, its first year of operations:...
-
nominate a cruise market segment and undertake research from academic and industry sources This market you choose may be - the country the cruise passengers come from (the SOURCE market, NOT...
-
04:04 ook Chuck, a single taxpayer, earns $83,800 in taxable income and $15,300 in interest from an investment in City of Heflin bonds. (Use the U.S tax rate schedule.) Required: a. How much federal...
-
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...
-
The adjusted trial balance of Marshall Ltd. at December 31, 2020. Requirements 1. Prepare Marshall Ltd.'s 2020 income statement, statement of retained earnings, and balance sheet. List expenses...
-
Fred's Catering Ltd. had the following selected transactions during May 2020: Requirements 1. Show how each transaction would be handled using the cash basis and the accrual basis, Under each column,...
-
The balance sheet at December 31, 2018, 2019) and 2020 and income statement for the years ended December 31, 2018, 2019, and 2020 for Ojibway Inc. include the following data: Requirements Use the...
Study smarter with the SolutionInn App