Question

) You will write a program that will do the following: prompt the user enter characters from the keyboard you will read the characters until reading the letter O You will compute statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character Example inpu mJ0*5/tx1@3qcx0 The Qshould be included when computing the statistics properties of the input. Since characters are integers you will determine the average character (average when one looks at the character as an integer (its ASCll value). To achieve this you will need to compute the sum of the ASCII values of the characters. Using c++
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>

using namespace std;

int main()

{

char input;

int sum = 0;

while (true)

{

cin >> input;

if (input == 'Q')

break;

sum += input;

}

cout <<"Statitics Properties of Input is : "<< sum << endl;

return 0;

}

// IP : mJ0*5/l+x1@3qcxQ

// OP : Statitics Properties of Input is : 1140

Add a comment
Know the answer?
Add Answer to:
Using c++ ) You will write a program that will do the following: prompt the user...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In C programming please (b) You will write a program that will do the following: prompt...

    In C programming please (b) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the characters until reading the letter 'O' You will compule statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character 'Q' Example input mJ0*5/1+x1@3qcxQ The 'Q' should be included when computing the statistics properties of the input....

  • In basic c develop the code below: (a) You will write a program that will do...

    In basic c develop the code below: (a) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the characters until reading the letter ‘X’ You will compute statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character ‘X’. Example input mJ0*5/]+x1@3qcxX The ‘X’ should not be included when computing the statistics...

  • To be turned in You will write a program that will do the following: Prompt the...

    To be turned in You will write a program that will do the following: Prompt the user to enter any character form the keyboard. You will compute some statistic concerning the type of characters entered. You will keep reading characters until a 'Q' is entered. The 'Q' should not be included when computing the statistics properties of the input. Example input: $8mJ0*5/I+Nx1@3qc2XQ We are interested in determining the following statistics: The number of alphabets The number of uppercase letters The...

  • C++ please! In this program you will be outputting the characters that map to the ASCIl...

    C++ please! In this program you will be outputting the characters that map to the ASCIl codes 32 through 126. You will need a loop to iterate through the input values and output the corresponding character. This mapping is shown in appendix A in your Gaddis text book. Your program will be reading in two unsigned integer values. The prompt for read will be Enter lower and upper values You need to check that both values are in the range...

  • IN C language Write a C program that prompts the user to enter a line of...

    IN C language Write a C program that prompts the user to enter a line of text on the keyboard then echoes the entire line. The program should continue echoing each line until the user responds to the prompt by not entering any text and hitting the return key. Your program should have two functions, writeStr andcreadLn, in addition to the main function. The text string itself should be stored in a char array in main. Both functions should operate...

  • In this program, you will be using C++ programming constructs, such as overloaded functions. Write a...

    In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...

  • Prompt the user and read in a string. Make your string large enough to hold 100...

    Prompt the user and read in a string. Make your string large enough to hold 100 characters. 2. Count the number of words in the string. A word is one or more non-blank characters separated by one or more blanks. My suggestion is to use a flag (a boolean variable) to indicate whether or not you are in a word. Then you know you have found a word when the flag indicates that you are in a word and the...

  • Create a program that performs the following operations: Prompt for and accept a string of up...

    Create a program that performs the following operations: Prompt for and accept a string of up to 80 characters from the user. • The memory buffer for this string is created by: buffer: .space 80 # create space for string input • The syscall to place input into the buffer looks like: li $v0, 8 # code for syscall read_string la $a0, buffer # tell syscall where the buffer is li $a1, 80 # tell syscall how big the buffer...

  • I need eclipse code for : Write a program that analyzes text written in the console...

    I need eclipse code for : Write a program that analyzes text written in the console by counting the number of times each of the 26 letters in the alphabet occurs. Uppercase and lowercase letters should be counted together (for example, both ‘A’ and ‘a’ should count as an A). Any characters that are not letters should be ignored. You must prompt the user to enter the text to be analyzed. Then, for any letter that appeared at least once...

  • Write the Code in C program. Create a random password generator that contains a user-specified number...

    Write the Code in C program. Create a random password generator that contains a user-specified number of characters. Your program should prompt the user for the desired length of the password. Length of password: To create your password, use the random number generator in the stdlib.h C library. To generate random numbers, you will need the srand() and rand() functions. srand(seed) is used to "seed" the random number generator with the given integer, seed. Prompt the user for the seed...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT