(Debug) Determine and correct the errors in the following
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
C++ for Engineers and Scientists
- (C PROGRAMMING ONLY) 1. Dealing With Monthsby CodeChum Admin We're done dealing with days. It's time to step up and now deal with months! Instructions: In the code editor, you are provided with a code in the main() which has 12 printf's. Each printf prints a month with its corresponding value. For this program, January is 1, February is 2, March is 3, and so on. When you run the initial code, you will encounter errors because these month names that have been printed don't exist yet.Your task is to create an enum data type which contains these month names as values so that when we run the code, there will be no more error.Do not edit anything in the main(). Output January = 1February = 2March = 3April = 4May = 5June = 6July = 7August = 8September = 9October = 10November = 11December = 12arrow_forward(Intro to Java) Avoid using breaks The Enigma Machine The encryption algorithm is: For each character in a String: 1. Extract each character from a String as a char. 2. Convert the character to its Unicode value. 3. Unicode divided by 10 to get the first encoded character as an int. 4. Unicode modulus 10 to get the second encoded character as an int. 5. Convert each of the two integers to its Unicode character code. 6. Concatenate both of the characters to the end of a String. The final String (after concatenation) contains the encrypted message. Working through an example: char letter = 'A' from the input String 'A' -> 65 65 / 10 -> 6 65 % 10 -> 5 6 + 48 -> 54 -> '6' 5 + 48 -> 53 -> '5' encryptionString = encryptionString + uniDigit1 + uniDigit2 To Decrypt our Secret Coded Message, We Need to Reverse the Above Steps! (Why?) The decryption algorithm is: For each pair of encrypted characters: 1. Convert the first and second characters of the pair to its…arrow_forward(a) {w|w contains a 1 after a 0 and before another 0} (b) {w |w does not contain the substring 00} (c) {w |w contains an odd number of 1s or exactly one 0} 2. Use the algorithm you learned in class to convert the following NFA to an equivalent regular expression. a, A Poarrow_forward
- (4 Points) An algorithm takes 0.5 ms for input size 100. How long will it take for input size 500 if the running time is the following (assume low-order terms are negligible)? a. linear, b. O(N logN), c. quadratic, d. cubicarrow_forward(PYTHON PLEASE) Also I was made aware that I can only ask one question and this question requires four different programs so please provide code for Pattern C. Thank you. (Display four patterns using loops) Use nested loops that display the following patterns in four separate programs:arrow_forward(PYTHON PLEASE) Also I was made aware that I can only ask one question and this question requires four different programs so please provide code for Pattern D. Thank you. (Display four patterns using loops) Use nested loops that display the following patterns in four separate programs:arrow_forward
- 1. (Floating-Point Arithmetic). For each of the following numbers,(a) determine whether the number is a 4-digit oating-point number (the number of the FPA4);(b) if yes, write the number in the standard form ±0.d1d2d3d4 × 10n, where d1 is a nonzero digit and n ∈ Z;(c) if no, rst chop and then round the number to a number of the FPA4, written in the standard form:(i) − 0.989067000000001; (ii) − 51.8; (iii) − 900.377050000001; (iv) − 5000.0;(v) − 0.023409; (vi) 2036.0; (vii) 0.01814.arrow_forward(25-26) Verify that each of the following statements is a false statement by finding a counterexample. For all numbers x: |x| >0 For all numbers x: x > xarrow_forward(JAVA program language) I want last answer only, Idont need the explain.arrow_forward
- (java programming language) Given f(x) = x+ x2/2+ x3/3+…… xn/n. Using do-while, write a program to compute f(x) for given x andn. The user should enter x and a positive integer n. Save your file as Q3.Javaarrow_forward(Intro to Python) Q2. Given a string of odd length: Write an expression to print the middle characterarrow_forward(C prog. language)arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education