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...
-
Rank the following bonds in order from lowest credit risk to highest risk, all with the same time to maturity, by their yield to maturity: Treasury bond with yield of 4.65 percent, United Airline...
-
The Federal Communications Act of 1934 grants the right to govern all interstate telecommunications to the Federal Communications Commission (FCC) and the right to regulate all intrastate...
-
Choose a country from three of the regions presented in Table 6.7. Using the Internet, collect as much information as you believe is needed to identify the potential for market segments based on age,...
-
Sutton Pointers Corporation expects to begin operations on January 1, 2015; it will operate as a specialty sales company that sells laser pointers over the Internet. Sutton expects sales in January...
-
Defining the database management system and identifying the differences between a database and a database management system (DBMS) or relational database management system (RDBMS). Please provide the...
-
The state of Kentucky filed a tax lien against Panbowl Energy, claiming unpaid taxes. Six months later, Panbowl bought a powerful drill from Whayne Supply, making a down payment of $11,500 and...
-
If a contractor proposes to increase concrete cover beyond contractual specification (i.e. 40mm to 70mm), shall engineers accept the proposal?
-
Write a CompStack() function which takes pointer to two stack as an argument and return true or false depending upon whether all the elements of the stack are equal or not. You are given isEqual(int,...
-
The Students for an Affordable Education have asked you to estimate the average amount of money spent per semester on textbooks. To produce this estimate, you have decided to randomly sample 25...
-
Do you know of any other cases similar to Airbnbs and Ubers problems with local government? What are the pros and cons of government regulation of internet platforms?
-
What are the benefits of having a local approach?
-
Can Apple be classified as a global firm? Why did you make that assessment?
-
Auditing is a prestigious profession in modern society and therefore they are expected to provide a high quality service to the stakeholders. Audit quality is highly regulated nationally and...
-
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._________________________...
-
If a person has a highly elastic demand, will he likely bear a large or small percentage of the burden of a tax?
-
Minneapolis Federal Reserve Bank economist Edward Prescott estimates the elasticity of the U.S. labor supply to be 3. Given this elasticity, what would be the impact of funding the Social Security...
-
How much of a $100 tax would a consumer pay if elasticity of demand is 0.2 and elasticity of supply is 1.8?
Study smarter with the SolutionInn App