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...
-
Suppose that the note did not state a specific interest rate but instead referred to a statute that established the maximum interest rate for government-guaranteed school loans. Would the note fail...
-
Explain why a swap has zero value when it is initiated. Why might this be a useful convention?
-
\(18 <20\) Determine if the comparison is true or false.
-
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...
-
Read the article from Balance Careers. What is Included in a Reference Check for Employment What did you learn that you may not have experienced or thought of? How does this change how you use...
-
For the circuit in Fig. 2.95, determine i1 to i5. Figure 2.95 For Prob. 2.31 3 ( 2 --> i 13 12 40 V
-
Solve the following Ordinary Differential Equations (ODE): $$ \begin{array}{1} y^{\prime}+y=x y^{3}. \\ x y^{\prime}+y=-2 x^{6} y^{4}. \\ y^{\prime}-\frac{1}{x} y=-\frac{y^{2}}{x}. \\...
-
Epson produces color cartridges for inkjet printers. Suppose cartridges are sold to mail-order distributors for $5.20 each. Total fixed costs per year are $957,600. Variable cost per unit are $1.85...
-
What can managers embarking on an organizational downsizing do to minimize the impact of the process on the "survivors" of downsizing? Discuss the effect of the "Amazon Effect" on the workplace of...
-
Evaluate the impact of talent acquisition on the overall organizational performance. Include key performance indicators, employee satisfaction metrics, and any other relevant data to support your...
-
), Arches Manufacturing had always made its components in-house. However, Canyonlands Component Works had recently offered to supply one component, DA, at a price of $50 each. Arches uses 10,000...
-
3. Write the output of following codes. (10 pts) public static void main(String[] args) { int grade = 75; if(grade >= 60) { System.out.println("Passed"); }else { System.out.println("Not Passed"); }...
-
Elaborate on how &pizza responded to COVID- 19 Situation w.r.t its business in 2020 and 2021.
-
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....
-
The following information for Great Oaks Furniture, a retail furniture and design firm, relates to Exercises 6 through 11. Cash flow from mmm operations was \($645,590\) for 2008 and \($795,823\) for...
-
Comparative income statements for Cramer Carpets, a carpet retailer, are given below: The president is concerned that net income is down in 2009 even though sales have increased during the year. The...
-
Safeway, Inc. is a large food and drug retailer with more than 1,700 stores in the U.S. and Canada. The following financial information relates to fiscal 2009 and 2008. Required Calculate inventory...
Study smarter with the SolutionInn App