Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Intro to Programming in C Large Program 1 Character/ Number converter Assignment Purpose: To compile, build, and execute an interactive program with a simple loop,

Intro to Programming in C Large Program 1 Character/ Number converter

Assignment Purpose: To compile, build, and execute an interactive program with a simple loop, conditions, user defined functions and library functions from stdio.h and ctype.h.

You will write a program that will convert characters to integers and integers to characters

General Requirements In your program you will change each letter entered by the user to both uppercase AND lowercase

o Use the function toupper in #include

o Use the function tolower in #include You will create a numerical version of both the upper- and lower-case versions of the character

o NOTE: for characters that are not letters both upper and lower will be the sameo Example:

  • int upperNumber = (int)upper;

  • int lowerNumber = (int)lower;

You will create a character version each integer entered by the user (positive or negative)

o Example: char CharacterN = (char)numberInput;

  • You will ask the user if they want to Enter a (1) to enter a character --- (2) to enter a number or --- (0) to Quit

  • You must have at least 6 user defined functions as follows:

o No modifications may be made to the functions

#define _CRT_SECURE_NO_WARNINGS

#include

#include

//greets the user

void Greeting(); //Asks, gets, and returns the users option (1, 2, or 0)

int UserDecision(); 

//Declare a character //Ask, get, and return the characterchar GetLetter();

//Declare an integer //Ask, get, and return the integerint GetInt();

//input: a character //creates a lowercase and uppercase version of the character //finds the numerical versions of the characters //prints the results onto the screen void ProcessCharacterInput(char characterInput);

//input: an integer //finds a corresponding character for the integer (if there is one) //returns the character version of the integer char ProcessIntegerInput(int numberInput);

Additional Requirements:

  • Use function prototypes.

  • Write comments for each function that will appear in the file before each prototype and again before each

    function definition.

  • Be sure to comment your code adequately.

  • Be sure to indent properly. Check your textbook and lecture code examples to see how it should be done.

  • Use meaningful variable names

    **PLEASE MAKE SURE CODE MATCHES SAMPLE OUTPUT**

  • SAMPLE OUTPUT:

    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, (0) to quit) >> 1 Enter a character: k The capital letter is K and the numerical value is 75 The lowercase letter is k and the numerical value is 107 -------------------------------------------------------------------------

    Would you like to enter a character or a number?

    (ENTER (1) to enter a character, (2) to enter a number, (0) to quit) >> 1

    Enter a character: &

    The capital letter is & and the numerical value is 38

    The lowercase letter is & and the numerical value is 38

    ------------------------------------------------------------------------- Would you like to enter a character or a number?

    (ENTER (1) to enter a character, (2) to enter a number, (0) to quit) >> 2 Enter a number: -32

    The corresponding character for -32 is -------------------------------------------------------------------------

Would you like to enter a character or a number? (ENTER (1) to enter a character, (2) to enter a number, (0) to quit) >> 2 Enter a number: 241

The corresponding character for 241 is ------------------------------------------------------------------------- Would you like to enter a character or a number?

(ENTER (1) to enter a character, (2) to enter a number, (0) to quit) >> 0 Press any key to continue . . .

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