Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming in C. I could use some assistance. 1. Write and submit the algorithm OR flowchart to indicate you understand the problem 2. Create a

Programming in C. I could use some assistance. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. Write and submit the algorithm OR flowchart to indicate you understand the problem 2. Create a project and name the source code lastname firstname_prog5.c 3. Use the prog5.c as a guide, copy paste into your project source code * build run and test, the outline code You will need to declare an integer variable called again and initialize it 4. Add the function prototype and implement the function definition for the Greeting function 5. Add the function call to Greeting in the main function build run and test Now it is time to Implement the UserDecision function 6. Add the function prototype and Implement the function definition for the UserDecision function Function definition: Declare an integer a. b. Use printf statements to ask the user what they want to enter (1),(2), (0) Scan into the integer d. c. Return the integer value 8. Call the function twice from the main function a. before the while loop(initialization) b inside the while loop(update) 9. The integer that is returned from this function will be assigned to the variable again *build run and test (try entering , a 2, and a 0) SAMPLE OUTPUT AT THIS STEP Welcome to the number/ character converter! This program converts characters to numbers and numbers to characters You may enter any single character on the keyboard You may enter any integer value, negative or positive You may be surprised by the output! Would you like to enter a character or a number? ENTER (1) to enter a character, (2) to enter a number, (o) to quit) > Would you like to enter a character or a number? (ENTER (a) to enter a character, (2) to enter a number, (o) to quit) >> 2 Would you like to enter a character or a number? (ENTER (a) to enter a character, (2) to enter a number, (o) to quit) > o Press any key to continue 10. Now add the message for the user if anything other than a 0, 1, or 2 is entered (the else inside the while loop) ***build/run and test 11. Now it is time to implement the GetCharacter function, add the prototype and definition, 12. Function definition: a. b. c. Declare a character Prompt for the character Read (scarf) the character-REMEMBER TO ADD the space between-and % scani(" %e", & tempchar); d. Retun the character 13. Add the function call inside the block of code if againI) "build/run and test- Add a printf statements to test that everything is working as instructed 14. The next function to implement will be the 15. Function definition: erlnput function, add the prototype and definition Declare 2 characters and 2 integer variables Use toupper and tolower functions to assign an uppercase version and a lowercase version of the characterlnput function argument variable Use (int) type casting to assign the numerical value for the 2 characters (upper and lower) Print all 4 results onto the screen a. b. c. d. 6. Add the function call and pass the character that was returned from GetCharacter function **build/run and test 17. Now it is time to implement the Getint function, add the prototype and definition. 18. Function definition: a. Declare an integer b. Prompt for the integer c. Read (scanf the integer DO NOT ADD A SPACE for an integer d. Retu the integer 19. Add the function call (inside the block of code if again2) build run and test-Add a printf statements to test that everything is working as instructed 20. The next function to implement will be the ProcessIntegerlnput function, add the prototype and definition 21. Function definition: a. b. c. Declare 1 character Use (char) type casting to assign the character version of the integer argument Returm the character 22. Add the function call and pass the character that was returned from Getlnteger function 23. Print the original integer and the character onto the screen. ***build/run and test #define-CRT-SECURE-IO ilARNINGS #include //printf and scanf #include //for toupper and tolower add function prototypes here void Greeting() printf("Hello User! welcome to the number and character converterln" Bint UserDecision() int usernumber; , 2 for a number, or e to quit: "); scanf("%d", &usernumber); return usernumber Bchar GetCharacter) char characterl; printf("Please enter a character: "): scanf(" Xc", &character1); printf("Your letter was Xcin-, character!) return character1; Bint ProcessCharacterInput() char let2; int num2; num2 (int)let2; printf("The value for your character is d, num2); return num2; Bint GetInt) from: Build Build started: Project: Large Program 1, Configuration: Debug win32 samer_progs.c grammingilarge program 1labed saner_prog5.c(53):warning C4477: printf : forma gramminglarge program Ilabea_sanerprogs.c (34): warning C47ee: uninitialized io erammingilarge progran 1labed samer progs.c(52): warning C47e0: uninitialized lo tput 26 Col 48 ogram Bint ProcessIntegerInput() char let3; int num3; let3 (char)num3; printf("The character for your input is c, &let3); return let3; int main() //declare variables 2 characters and 2 integers char letterl, letter2; int number1, number2, again; //call the Greeting function Greeting). //call the UserDecision function //LOOP initialization UserDecision); while (again --0) //LOOP test if (again-1) //call GetCharacter GetCharacter(letter1); //call ProcessCharacterInput ProcessCharacterInput (number1); else if (again 2) //call GetInt GetInt (number2); ut from: Build Build started: Project: Large Program 1, Configuration: Debug win32 . ed_saner.progs.c rogranmingtlarge program 11 rogramminglarge progran 1labed_saner_progs.c(34) abed_ saner_ progs.c(53): warning C4477: 'printf : fe arge progran 1labed_saner progs.c(34): warning C4700: uninitializec ngvlarge program 1labed saner progs.c(52): warning c4700: uninitialize Output Ln 26 Col 46 Test Anelyze Window Heo w Project Buld Dbu Team Tools x86 Local Windows Debugger S Debug gram i (Globel Scope) UserDecision); hile (ogaine) /LoOP test if (again1) /call GetCharacter Getcharacter(letter1); //call ProcessCharacterInput ProcessCharacterInput (nueber1); else if (again2) //call GetInt GetInt (number2); //call ProcessInteger Input numberi ProcessIntegerInput (letter2); //else t I/let the user know their input was incorrect (they did not enter //call the UserDecision function //LOOP update UserDecision(again): return ; //Add function definitions here from: Build Build started: Project: Large Progran 1, Configuration: Debug liin32 samer_progs.c granningtlarge progran 1labed samer_progs.c(53): warning C4477: "printf : fornat granning\large progran 11abed samer_progs.c(34): warning C4780: uninitialized loc gramningvlarge program 1labed_ samer_prog5.c(52): warning C4760: uninitialized loca utput Ln 26 | Coll 48 1. Write and submit the algorithm OR flowchart to indicate you understand the problem 2. Create a project and name the source code lastname firstname_prog5.c 3. Use the prog5.c as a guide, copy paste into your project source code * build run and test, the outline code You will need to declare an integer variable called again and initialize it 4. Add the function prototype and implement the function definition for the Greeting function 5. Add the function call to Greeting in the main function build run and test Now it is time to Implement the UserDecision function 6. Add the function prototype and Implement the function definition for the UserDecision function Function definition: Declare an integer a. b. Use printf statements to ask the user what they want to enter (1),(2), (0) Scan into the integer d. c. Return the integer value 8. Call the function twice from the main function a. before the while loop(initialization) b inside the while loop(update) 9. The integer that is returned from this function will be assigned to the variable again *build run and test (try entering , a 2, and a 0) SAMPLE OUTPUT AT THIS STEP Welcome to the number/ character converter! This program converts characters to numbers and numbers to characters You may enter any single character on the keyboard You may enter any integer value, negative or positive You may be surprised by the output! Would you like to enter a character or a number? ENTER (1) to enter a character, (2) to enter a number, (o) to quit) > Would you like to enter a character or a number? (ENTER (a) to enter a character, (2) to enter a number, (o) to quit) >> 2 Would you like to enter a character or a number? (ENTER (a) to enter a character, (2) to enter a number, (o) to quit) > o Press any key to continue 10. Now add the message for the user if anything other than a 0, 1, or 2 is entered (the else inside the while loop) ***build/run and test 11. Now it is time to implement the GetCharacter function, add the prototype and definition, 12. Function definition: a. b. c. Declare a character Prompt for the character Read (scarf) the character-REMEMBER TO ADD the space between-and % scani(" %e", & tempchar); d. Retun the character 13. Add the function call inside the block of code if againI) "build/run and test- Add a printf statements to test that everything is working as instructed 14. The next function to implement will be the 15. Function definition: erlnput function, add the prototype and definition Declare 2 characters and 2 integer variables Use toupper and tolower functions to assign an uppercase version and a lowercase version of the characterlnput function argument variable Use (int) type casting to assign the numerical value for the 2 characters (upper and lower) Print all 4 results onto the screen a. b. c. d. 6. Add the function call and pass the character that was returned from GetCharacter function **build/run and test 17. Now it is time to implement the Getint function, add the prototype and definition. 18. Function definition: a. Declare an integer b. Prompt for the integer c. Read (scanf the integer DO NOT ADD A SPACE for an integer d. Retu the integer 19. Add the function call (inside the block of code if again2) build run and test-Add a printf statements to test that everything is working as instructed 20. The next function to implement will be the ProcessIntegerlnput function, add the prototype and definition 21. Function definition: a. b. c. Declare 1 character Use (char) type casting to assign the character version of the integer argument Returm the character 22. Add the function call and pass the character that was returned from Getlnteger function 23. Print the original integer and the character onto the screen. ***build/run and test #define-CRT-SECURE-IO ilARNINGS #include //printf and scanf #include //for toupper and tolower add function prototypes here void Greeting() printf("Hello User! welcome to the number and character converterln" Bint UserDecision() int usernumber; , 2 for a number, or e to quit: "); scanf("%d", &usernumber); return usernumber Bchar GetCharacter) char characterl; printf("Please enter a character: "): scanf(" Xc", &character1); printf("Your letter was Xcin-, character!) return character1; Bint ProcessCharacterInput() char let2; int num2; num2 (int)let2; printf("The value for your character is d, num2); return num2; Bint GetInt) from: Build Build started: Project: Large Program 1, Configuration: Debug win32 samer_progs.c grammingilarge program 1labed saner_prog5.c(53):warning C4477: printf : forma gramminglarge program Ilabea_sanerprogs.c (34): warning C47ee: uninitialized io erammingilarge progran 1labed samer progs.c(52): warning C47e0: uninitialized lo tput 26 Col 48 ogram Bint ProcessIntegerInput() char let3; int num3; let3 (char)num3; printf("The character for your input is c, &let3); return let3; int main() //declare variables 2 characters and 2 integers char letterl, letter2; int number1, number2, again; //call the Greeting function Greeting). //call the UserDecision function //LOOP initialization UserDecision); while (again --0) //LOOP test if (again-1) //call GetCharacter GetCharacter(letter1); //call ProcessCharacterInput ProcessCharacterInput (number1); else if (again 2) //call GetInt GetInt (number2); ut from: Build Build started: Project: Large Program 1, Configuration: Debug win32 . ed_saner.progs.c rogranmingtlarge program 11 rogramminglarge progran 1labed_saner_progs.c(34) abed_ saner_ progs.c(53): warning C4477: 'printf : fe arge progran 1labed_saner progs.c(34): warning C4700: uninitializec ngvlarge program 1labed saner progs.c(52): warning c4700: uninitialize Output Ln 26 Col 46 Test Anelyze Window Heo w Project Buld Dbu Team Tools x86 Local Windows Debugger S Debug gram i (Globel Scope) UserDecision); hile (ogaine) /LoOP test if (again1) /call GetCharacter Getcharacter(letter1); //call ProcessCharacterInput ProcessCharacterInput (nueber1); else if (again2) //call GetInt GetInt (number2); //call ProcessInteger Input numberi ProcessIntegerInput (letter2); //else t I/let the user know their input was incorrect (they did not enter //call the UserDecision function //LOOP update UserDecision(again): return ; //Add function definitions here from: Build Build started: Project: Large Progran 1, Configuration: Debug liin32 samer_progs.c granningtlarge progran 1labed samer_progs.c(53): warning C4477: "printf : fornat granning\large progran 11abed samer_progs.c(34): warning C4780: uninitialized loc gramningvlarge program 1labed_ samer_prog5.c(52): warning C4760: uninitialized loca utput Ln 26 | Coll 48

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions