Question

Write two functions: Main should call the first function. The first function should use getline to...

Write two functions:

Main should call the first function.

The first function should use getline to read a line of data:

getline(cin,variableToHoldLineOfData);

It should then call the second function, sending the line of data it just read.

The second function should determine the number of CAPITAL letters, the number of lowercase letters, and the number of everything else (that's not capital or lower case).

Count the length of the string and then use a for loop to go through each character.

You will need THREE counters, one for each of those cases. Use an if to determine if something is capital (ascii value is between 65 and 90), and then increase the counter if its true. Do the same for the other cases and then print the results.

OPTIONAL: Use pass by reference to send the three counters from the first function to the second function and then print the results in the first function instead.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Write two functions: Main should call the first function. The first function should use getline to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Problem: Create a program that contains two functions: main and a void function to read data...

    Problem: Create a program that contains two functions: main and a void function to read data from a file and process it. Your main function should prompt the user to enter the name of the file (Lab7.txt), store this name, and then call the function sending the name of the file to the function. After the function has completed, the main function should output the total number of values in the file, how many of the values were odd, how...

  • This program should use a main function and two other functions named playlist and savelist as...

    This program should use a main function and two other functions named playlist and savelist as follows: The main function: The main function should create an empty list named nums and then use a loop to add ten integers to nums, each integer in the range from 10-90. NOTE: In Python, a list is a data type. See Chapter 7. The main function should then call the playlist function and savelist function, in that order. Both of these functions take...

  • Write a complete C++ program that is made of functions main() and rShift(). The rShift() function...

    Write a complete C++ program that is made of functions main() and rShift(). The rShift() function must be a function without return with 6 parameters. rShift() should do following. Shift the first 4 formal parameters' value one place to right circularly and send the updated values out to the caller function, i.e. main. Furthermore, after calling this function with first 4 actual parameters, say a1, a2, a3, a4, and these actual parameters should shift their value one place to right...

  • Write a program that will do the following. The main function should ask the user how...

    Write a program that will do the following. The main function should ask the user how many numbers it will read in. It will then create an array of that size. Next, it will call a function that will read in the numbers and fill the array (fillArray). Pass the array that was made in themain function as a parameter to this function. Use a loop that will read numbers from the keyboard and store them in the array. This...

  • C++ Program Int Main First Please Write one program that does the following: 1.       1.   Ask the...

    C++ Program Int Main First Please Write one program that does the following: 1.       1.   Ask the user for ten (10) grades, and store the data in an array.  Compute the average of all the grades.  Print the original ten grades and the average. a.       Declare an integer array with the name of “grades” of size 10 in the main function. b.      Create a function called “getGrades” that prompts the User for the grades and puts them in an integer array.                                                                i.      The function will receive...

  • 4. [8] Write a C function with prototype void letter_freq(const char wordll, int freaq ); This...

    4. [8] Write a C function with prototype void letter_freq(const char wordll, int freaq ); This function computes the number of appearances of each letter in the string word and stores them irn array freq of size 26. The letters are the 26 letters of the Latin alphabet whose ASCII values are in the range 97-122 for the lower case letters, and in the range 65-90 for the uppercase letters. You must account for uppercase and lowercase letter variants, which...

  • JAVA PROBLEM! PLEASE DO IT ASAP!! REALLY URGENT! PLEASE DO NOT POST INCOMPLETE OR INCORRECT CODE...

    JAVA PROBLEM! PLEASE DO IT ASAP!! REALLY URGENT! PLEASE DO NOT POST INCOMPLETE OR INCORRECT CODE Below is the program -- fill the code as per the instructions commented: //---------------------------------------------------------------------------------------------------------------------------------------------------------------// /* The idea of this HW is as follows : A password must meet special requirements, for instance , it has to be of specific length, contains at least 2 capital letters , 2 lowercase letters, 2 symbols and 2 digits. A customer is hiring you to create a class...

  • Write a complete program that uses the functions listed below. Except for the printOdd function, main...

    Write a complete program that uses the functions listed below. Except for the printOdd function, main should print the results after each function call to a file. Be sure to declare all necessary variables to properly call each function. Pay attention to the order of your function calls. Be sure to read in data from the input file. Using the input file provided, run your program to generate an output file. Upload the output file your program generates. •Write a...

  • problem specification: writing in c++ language ... Question Problem Specification: Writing in c++ language write a...

    problem specification: writing in c++ language ... Question Problem Specification: Writing in c++ language write a program that will define a structure consisting of the following data members, “fields”: - name - hours worked - hourly rate Use a structure to implement the following: -Use a function to read the name, hours and rate, passing them by reference to the main function. -Call a function to print, this function accepts the entire structure by value. This function will call a...

  • MATLAB Please help with encryption. Then main program should then call a function encrypt message which...

    MATLAB Please help with encryption. Then main program should then call a function encrypt message which should • take in the message to encrypt and the keyword • subtract 'a' from each element of the message (so the letter a is now 0) • subtract 'a' from each element of the keyword • encrypt the message using the keyword as described above (hint: first handle the letters encrypted using k0, then those encrypted using k1, etc) • add 'a' to...

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