This assignment will test you over inputting and outputting files character-by-character, while applying appropriate logic. we have a text file that has been written in a bizarre code. the code works like this: the message consists of alphabetic characters that alternate from upper to lower and back to upper case. any other letters that appear in the message that are not in this sequence are "dummy characters" to be discarded. in addition, the message can contain non-alphabetic characters which should be output as is. the upperto-lower-to-upper sequence restarts with each new sentence (that is, after any period, we will assume no other character ends a sentence such as ! or the only upper case letters that should be output in upper case are the first letter of any sentence. all other letters, no matter if they appear in upper or lower case in the input should be output in lower case. consider the following text: abcbcdcccdefghee afafghijkhij jklmklmlmnmno nonoop pqrqqq. abcsuuv abcwxyxxx yyz. start with the ‘a’ which should be output as ‘a’. we next expect a lower case letter

Answers

explanation #include <iostream>#include <cstring>#include <string>using namespace std;//function prototypevoid reverse(char *);void lower(char *);void upper(char *);int main(){    //declare char array to hold user string    char inputString[101];    //prompt user to enter string then read    cout << "Please enter a string (max length 100 characters):\n";    cin.getline(inputString, 101);    //call functions in order that is specified    reverse(inputString);    lower(inputString);    upper(inputString);    //return 0 to mark successful termination    return 0;}void reverse(char *input){    cout << "String with reversed case: \n";    //loop through each char using for loop    //that goes from first char until last    for(int counter = 0; counter < strlen(input)-1; counter++){        //if it is uppercase, print lowercase equivalent        if(isupper(input[counter]))            cout << (char) tolower(input[counter]);        //if it is lowercase, print uppercase equivalent        else            cout << (char) toupper(input[counter]);    }    //print newline    cout << endl;}void lower(char *input){    cout << "String with lowered case: \n";    //loop through each char using for loop    //that goes from first char until last    for(int counter = 0; counter < strlen(input)-1; counter++){        //if it is uppercase, print lowercase equivalent        if(isupper(input[counter]))            cout << (char) tolower(input[counter]);        //if it is lowercase, print as is        else            cout << input[counter];    }    //print newline    cout << endl;}void upper(char *input){    cout << "String with uppered case: \n";    //loop through each char using for loop    //that goes from first char until last    for(int counter = 0; counter < strlen(input)-1; counter++){        //if it is lowercase, print uppercase equivalent        if(islower(input[counter]))            cout << (char) toupper(input[counter]);        //if it is uppercase, print as is        else            cout << input[counter];    }    //print newline    cout << endl;}hope this help

View Image

Explanation:

Import the #include <ctype.h> so that you can use the function to check the characters in the string.Create variable to store letter counts and user input.Ask for user input with scanf().Loop through the user input and check each character. Increase count accordingly.Print out final result.
Count uppercase, lowercase, special character and numeric values given a string, write a program to
Count uppercase, lowercase, special character and numeric values given a string, write a program to

K e q equals StartFraction StartBracket upper C EndBracket superscript lower c StartBracket upper D EndBracket superscript lower D over StartBracket upper A EndBracket superscript lower a StartBracket upper B EndBracket superscript lower b EndFraction.

Explanation:

In order to aid understanding of the question, let me put the words into a proper chemical reaction equation.

aA + bB ⇄cC + dD

We must recall that the equilibrium constant often designated as Keq is given as;

Keq= product of the concentration of product species raised to the power of their respective molar coefficients / product of the concentration of reactant species raised to the power of their respective molar coefficients

Hence from what was written above, I can safely write;

Keq= [C]^c [D]^d / [A]^a [B]^b

This has been represented in words in the answer given above.

K e q equals StartFraction StartBracket upper C EndBracket superscript lower c StartBracket upper D EndBracket superscript lower D over StartBracket upper A EndBracket superscript lower a StartBracket upper B EndBracket superscript lower b EndFraction.

Explanation:

Equilibrium constant is the ratio of the concentration of products to the concentration of reactants each term raised to its stochiometric coefficients. It is represented by the symbol K_{eq}

The balanced chemical reaction is:

aA+bB\rightleftharpoons cC+dD     

The expression for K_{eq} is written as:

K_{eq}=\frac{[C]^c\times [D]^d}{[A]^a\times [B]^b}

Thus the correct option is K e q equals StartFraction StartBracket upper C EndBracket superscript lower c StartBracket upper D EndBracket superscript lower D over StartBracket upper A EndBracket superscript lower a StartBracket upper B EndBracket superscript lower b EndFraction.



Do you know the answer?

Other questions on the subject: Engineering

answer: the formula for amps is watts divided by volts. to use the chart, cover up the a with your finger and use the remaining chart calculation of w divided by v. using our sampl...Read More
3 more answers
Engineering, 04.07.2019, nsheikh2407
answer: 1: productivity. productivity is an important reason for developing it systems. 2: information. it systems are key to delivering the information and intelligence you need t...Read More
3 more answers