Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer a country he must know about his enemy's boundary limits. Help him to find his enemy's boundary limits by writing a java program. Input format Integer: No of enemy country(N) N Integer corresponds to no. of villages in each country (M). M Integers corresponds to ID of each villages. Output format Integer output corresponds to ID of each village located at the boundary of each enemy's country. Sample testcases Input 1 4 4 2 1 6 12 66 78 10 10 2 100 123456 Output 1 12 10 10 2 Report Error 100 16 Note: The program will not be evaluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing Q-1 Single File Programming Question Sum of the asked digits Input format Write a java program to calculate the sum of every ith digit in the given number. The input consists of a single integer 'n' which corresponds to the given number. Set of digits to be considered for calculating the sum will be provided as space separated integer values. Refer the sample input and output for more explanation. Long n Integer k Space separated k integers Code constraints 0 < Number of digits in the given number n < 10000 Sample testcases Input 1 1234567890 2 2.3 Output 1 32 Report Error Marks: 20 Negative Marks : 0 Note: The program will not be aluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer a country he must know about his enemy's boundary limits. Help him to find his enemy's boundary limits by writing a java program. Input format Integer: No of enemy country(N) N Integer corresponds to no. of villages in each country (M). M Integers corresponds to ID of each villages. Output format Integer output corresponds to ID of each village located at the boundary of each enemy's country. Sample testcases Input 1 4 4 2 1 6 12 66 78 10 10 2 100 123456 Output 1 12 10 10 2 Report Error 100 16 Note: The program will not be evaluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing Q-1 Single File Programming Question Sum of the asked digits Input format Write a java program to calculate the sum of every ith digit in the given number. The input consists of a single integer 'n' which corresponds to the given number. Set of digits to be considered for calculating the sum will be provided as space separated integer values. Refer the sample input and output for more explanation. Long n Integer k Space separated k integers Code constraints 0 < Number of digits in the given number n < 10000 Sample testcases Input 1 1234567890 2 2.3 Output 1 32 Report Error Marks: 20 Negative Marks : 0 Note: The program will not be aluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Each matrix i n Problems 1 to 3 corresponds to one of the linear transformations in Problem 54. Match each matrix with the corresponding image from Fig. 5. 1.9. 1. 2. 3. 0 and 0 0
-
Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:...
-
Each student in a sample of 10 was asked for the distance and the time required to commute to college yesterday.The data collected are shown here. a. Draw a scatter diagram of these data. b. Find the...
-
Explain the difference between product placement & branded entertainment . Do you personally notice product placements in television shows or movies? Why or why not? Identify at least two factors...
-
What measurement focus is used in fund-based financial statements for governmental funds, and what system is applied to determine the timing of revenue and expenditure recognition?
-
At Morris Mart Inc., all sales are on account. Mary Morris-Manning is responsible for mailing invoices to customers, recording the amount billed, opening mail, and recording the payment. Mary is very...
-
It would be helpful to me if I could start by asking you to basically tell me about your job. Okay?
-
The expected annual returns are 15% for investment 1 and 12% for investment 2. The standard deviation of the first investments return is 10%; the second investments return has a standard deviation of...
-
The relational model representation of an EERD relationship with a cardinality of (M,M) must be represented with a relationship table. Explain why this is true.
-
Develop a database to help "YourPerfectEvent" event planners to manage their operations. The database must be able to accommodate the following. A customer contacts the company and makes...
-
Dan and Leo agree to buy and sell "groceries and sundries" from Public Growers, Inc. in their stores. The five-year contract does not define groceries and sundries, but the parties agree the number...
-
1. If management thinks that it can increase shareholder wealth to the detriment of debt holders, employees, or suppliers, is it duty bound to do so? 2. To what extent can senior managers justify...
-
(a) Which is a better measure of risk, standard deviation or semi-standard deviation? (b) Under what conditions would standard deviation and semi-standard deviation be equally good measures of risk?...
-
How many dimensions of wellness would you say there are, and what are they?
-
All questions have equally weighted points 4 pts each. (20 points total) Q1. Consider the multifactor model APT with two factors. Portfolio A has a beta of 1.20 on factor 1 and a beta of 1.50 on...
-
how to Create a project plan, including all subsidiary plans, to deliver a project outcomes that meet stakeholder expectations?
-
Draw a net for the prism. Then calculate the area of each face, and the total surface area. Area of the front =20cm^(2) Area of the back =20cm^(2) Area of the top =1cm^(2) Area of the bottom =15cmcm...
-
Perform the indicated operations. In designing a cam for a fire engine pump, the expression is used. Simplify this expression. (3) (3 4 32
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
Cedar Corporation has an S corporation election in effect. During the 2012 calendar tax year, the corporation had ordinary taxable income of $200,000, and on January 15, 2012, the corporation paid...
-
Larry and Lisa Williams, both 33 years old, have been married for 9 years. They live at 638 Arctic Way, Fairbanks, AK 99701. Lisa's Social Security number is 445- 81-1423 and Larry's is 798-09-8526....
-
Prove Part 1 of Theorem 1.14 using induction. That is, prove that for any non-negative integer \(k\), \[H_{k}(x)=\sum_{i=0}^{\lfloor k / 2floor}(-1)^{i} \frac{(2 i) !}{2^{i} i...
-
Use Theorem 1.13 (Taylor) to find fourth and fifth order polynomials that are approximations to the standard normal distribution function \(\Phi(x)\). Is there a difference between the...
-
Prove Part 2 of Theorem 1.14. That is, prove that for any non-negative integer \(k \geq 2\), \[H_{k}(x)=x H_{k-1}(x)-(k-1) H_{k-2}(x) .\] The simplest approach is to use Definition 1.6. Theorem 1.14....
The People Equation Why Innovation Is People Not Products 1st Edition - ISBN: 1626566410 - Free Book
Study smarter with the SolutionInn App