you cannot review this problem again. You can use printf() to debug your code. The printf()...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
you cannot review this problem again. You can use printf() to debug your code. The printf() may not work in case of syntax/runtime error. The version of GCC being used is 5.5.0. The Torns County Visa Center generates the token number for its applicants from their application ID. The application ID is a numeric value. The token number is generated in a specific form. The even digits in the applicant's ID are replaced by the digit one greater than the even digit and the odd digits in the applicant's ID are replaced by the digit one lesser than the odd digit. The numeric value thus generated represents the token number of the applicant. Write an algorithm to generate the token number from the applicant ID. Input The input consists of an integer-applicant/D, representing the application ID of the applicant Output Print an integer representing the token number. Constraint 0<applicantlD≤ 10⁹ Note 0 is considered as an even digit and 1 is Test Cases & Output Editor 1 // Sample code to read input and write output: 2 3- / 4 #include <stdio.h> 5 6 int main() 7 + { 8 9 10 11 12 } 13 */ 14 15 // Warning: Printing unwanted or ill-formatted data to output idll cause the test cases to fail 16 17 #include<stdio.h> 18 19 int main() 20 - { 21 22 23 24 25- 26 27 28 29 30 - 31 32 33 char name[20]; scanf("%s", name); printf("Hello %s", name); return 0; 34 35 ) // Write your code here int n; if(n%2==0) { } else ( n=n+1; n=(n%10); I nun-1; } printf(n); return 0; // Read input from STOIN // Write output to STDOUT Input The input consists of an integer - applicantlD, representing the application ID of the applicant. Output Print an integer representing the token number. Constraint 0<applicantlD < 10⁹ Note O is considered as an even digit and 1 is considered as an odd digit. Example Input 245567 Output 354476 Explanation The first digit in the application ID is '2' i.e even. It is replaced by one greater digit i.e 3. The second digit is '4' i.e even. It is replaced by one greater digiti.e 5. The third digit is '5' i.e odd. It is replaced by one lesser digit i.e 4 and so on. Hence the output is 354476. 3- /* 4 #include <stdio.h> 5 6 int main() 7 - { 8 9 10 11 12 13 18 19 20 21 22 23 24 25- 26 27 28 29 ) 14 15 // Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fall 16 17 #include<stdio.h> 30 - 31 32 33 / char name[20]; scanf("%s", name); printf("Hello %s", name); return 0; int main() { 34 35 } // Write your code here int n; if(n%2==0) { n=n+1; n=(n%10); } else { n=n-1; // Read input from STDIN // Write output to STDOUT } printf(n); return 0; you cannot review this problem again. You can use printf() to debug your code. The printf() may not work in case of syntax/runtime error. The version of GCC being used is 5.5.0. The Torns County Visa Center generates the token number for its applicants from their application ID. The application ID is a numeric value. The token number is generated in a specific form. The even digits in the applicant's ID are replaced by the digit one greater than the even digit and the odd digits in the applicant's ID are replaced by the digit one lesser than the odd digit. The numeric value thus generated represents the token number of the applicant. Write an algorithm to generate the token number from the applicant ID. Input The input consists of an integer-applicant/D, representing the application ID of the applicant Output Print an integer representing the token number. Constraint 0<applicantlD≤ 10⁹ Note 0 is considered as an even digit and 1 is Test Cases & Output Editor 1 // Sample code to read input and write output: 2 3- / 4 #include <stdio.h> 5 6 int main() 7 + { 8 9 10 11 12 } 13 */ 14 15 // Warning: Printing unwanted or ill-formatted data to output idll cause the test cases to fail 16 17 #include<stdio.h> 18 19 int main() 20 - { 21 22 23 24 25- 26 27 28 29 30 - 31 32 33 char name[20]; scanf("%s", name); printf("Hello %s", name); return 0; 34 35 ) // Write your code here int n; if(n%2==0) { } else ( n=n+1; n=(n%10); I nun-1; } printf(n); return 0; // Read input from STOIN // Write output to STDOUT Input The input consists of an integer - applicantlD, representing the application ID of the applicant. Output Print an integer representing the token number. Constraint 0<applicantlD < 10⁹ Note O is considered as an even digit and 1 is considered as an odd digit. Example Input 245567 Output 354476 Explanation The first digit in the application ID is '2' i.e even. It is replaced by one greater digit i.e 3. The second digit is '4' i.e even. It is replaced by one greater digiti.e 5. The third digit is '5' i.e odd. It is replaced by one lesser digit i.e 4 and so on. Hence the output is 354476. 3- /* 4 #include <stdio.h> 5 6 int main() 7 - { 8 9 10 11 12 13 18 19 20 21 22 23 24 25- 26 27 28 29 ) 14 15 // Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fall 16 17 #include<stdio.h> 30 - 31 32 33 / char name[20]; scanf("%s", name); printf("Hello %s", name); return 0; int main() { 34 35 } // Write your code here int n; if(n%2==0) { n=n+1; n=(n%10); } else { n=n-1; // Read input from STDIN // Write output to STDOUT } printf(n); return 0;
Expert Answer:
Answer rating: 100% (QA)
Answer Code include using namespace std int main int n cinn float sum 0 unorderedmap mp We u... View the full 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
-
Effective persuasive techniques in one culture may not work in another culture. Do a web search on intercultural communication and locate a topic that is important for technical communication. Find...
-
For problem 17-3, suppose an applicant has $54,000 in assets, $10,000 of debt, and a family of four. How would you classify this applicant? In this problem and the preceding one, be careful to...
-
Write a Metropolis algorithm to generate samples from a target distribution, (x) exp(x2/2), based on the proposal v-x) 2(0.4)
-
In Rev. Rul. 81-301, which of the following is not a factor considered by the IRS in determining whether a partner receives payments in her capacity as a partner, or is instead acting as a third...
-
Look through the list of chapters in this textbook, and discuss how globalization could influence each organizational behavior topic.
-
You choose 3 adults at random. What is the probability that all three say none of their closest family and friends have food allergies or intolerances? Use the pie chart, which shows the results of a...
-
The IT manager of Aztec Realty, Inc., prepared the balance sheet of the company while the accountant was ill. The balance sheet contains numerous errors. In par ticular, the IT manager knew that the...
-
Anchor Corporation paid cash of $178,000 to acquire Zink Companys net assets on February 1, 20X3. The balance sheet data for the two companies and fair value information for Zink immediately before...
-
Create a table in which you compare the 3 tax statements. Create columns for and address the following in your comparison: The percentage of taxes that go to schools The value of the property...
-
You are to develop a simple Binary Search Tree ADT and run it against a test program. Avoid the temptation of finding code online. I am aware of all the available solutions and will be looking...
-
Explain why determining the benefit of a training program can be difficult to do?
-
Each of the following statements is either mathematically incorrect or does not communicate any meaning Write down why each statement is wrong or not meaningful, pointing out one or more specific...
-
Show that the sequence {sinn}nEN does not converge.
-
In a period production and cost data were as follows. Total costs material 5115 Labour 3952 Overheads 3000 12067 Production was 1400 fully complete units and 200 partly units. The degree of...
-
Context- Mapping politics: how context counts in electoral geography -John Agnew -Do you agree or disagree with the statement about contextualism: A 'strong' contextualism would imply that...
-
Nike Corporation is into manufacturing shoes. In the financial Year 2019-20, Nike Corporation has the actual production was 20,000 units. The standard data for each unit of the product is given in...
-
Janine is 47 and has a good job at a biotechnology company. Janine estimates that she will need $916,000 in her total retirement nest egg by the time she is 65 in order to have retirement income of...
-
Compare and contrast licensing and subcontracting.
-
While preparing Massie Miller's 2012 Schedule A, you review the following list of possible charitable deductions provided by Massie: Cash contribution to a family whose house burned...
-
In 2012, Margaret and John Murphy are married taxpayers who file a joint tax return with AGl of $25,000. During the year they incurred the following expenses: Hospitalization insurance...
-
How are qualified dividends taxed in 2012? Please give the two rates of tax which apply to qualified dividends, and specify when each of these rates applies._________________________...
-
A uniform circular disc is pivoted at point \(O\), as shown in Fig. 2.105. Find the natural frequency of the system. Also find the maximum frequency of the system by varying the value of \(b\). b...
-
Find the natural frequency of the traffic sign system described in Problem 2.79 in torsional vibration about the \(z\)-axis by considering the masses of both the post and the sign. The spring...
-
Solve Problem 2.99 by changing the material from steel to bronze for both the post and the sign. Material properties of bronze: \(ho\) (specific weight) \(=80.1 \mathrm{kN} / \mathrm{m}^{3}, E=111.0...
Study smarter with the SolutionInn App