How to call the function to update the statistics

Assignment Help Basic Computer Science
Reference no: EM13306884

You have a friend who is an English major. This friend needs to collect statistics about words for a project . The statistics are the number of vowels , consonants and letters that occur in a sequence of words. You offer to help by writing a program to aid in generating these statistics. Your friends tell you that he wants to enter as many words as he can think of.when he is done using the program he wants to enter "bye" and have the statistics displayed on the screen .In order to complete this program you must write the following functions;

A function that takes as an in parameter a single character. If this character is a vowel (a, e, I, or, u) it will return true, otherwise it will return false. you must deal with the fact that these vowels could be uppercase or lowercase. To do this add, #include<Q-tip. To the top of your program, then you may also use the function tolower with prototype char tolower (char), to convert a character to lowercase before deciding if it is a vowel or not .

A function that takes a string as an in parameter and three in/out parameters .The in/out parameters are three counters, the number of vowels, the number of constants, and the number of letters , this function will update these counters appropriately based on the contents of the string that was passed in.

A function which takes as in the parameters the three counters and displays them to the screen as shown in he example below.

Your main function should use a flag controlled loop to prompt the user for a string (single word) and if that string is not ("bye") call the function to update the statistics .if the string is"bye" exit the loop and call the function to display the statistics.

Please enter a word ("bye" to exit): hike
Please enter a word ("bye" to exit):bike
please enter a word("bye" to exit):run
please enter a word("bye" to exit):swim
please enter a word("bye" to exit):bye

vowels:6
constants:9
total letters:15

Reference no: EM13306884

Questions Cloud

What is the maximum amount of energy : The motor in a refrigerator has a power of 156 W. If the freezing compartment is at 268 K and the outside air is at 302 K, what is the maximum amount of energy
Create a fully unbalanced bst : I need to create a program written in Java. It needs to create a fully unbalanced BST. It must have 26 levels. It must demonstrate the insertion of elements into the BST.
Find the final temperature of the iron block : A 3.5-kg block of iron (c=0.11 kcal/kgoC) that has been brought to a temperature of 1,063oC is placed on top of a 2.5-kg block of ice (c=0.5 kcal/kgoC) that has been cooled to -50oC
Claim myrtle under a multiple support agreement : Myrtle is fully supported by her three children and Fred, a close friend of the family. Mark paid $4,000 toward Myrtle's support, while Nancy, Opel, and Fred paid $3,200, $ 800, and $2,000 respectively. Which individual are eligible to claim My..
How to call the function to update the statistics : A function which takes as in the parameters the three counters and displays them to the screen as shown in he example below.
What is the impedance of this circuit : A 150 ohm resistor, a 30 mH inductor and a 2 uF capacitor are connected in series with a 120 V rms source at 1500 Hz. What is the impedance of this circuit
Accounting reports are a major tool in business : Given Mountainarious Sporting Co.'s financial statements for the period 2004 to 2007 you are to undertake appropriate vertical, horizontal and ratio analysis of those financial statements
Explain different levels in a software organization : Give at least three examples of where decision making process could be used at different levels in a software organization.
Estimate the power the device can produce at a wind speed : The U.S. Department of Energy (DOE) constructed a Darrieus vertical-axis wind turbine in Sandia, New Mexico. The machine is 60.0-ft tall and 30.0-ft in diameter, and swept an area of 1200 ft 2.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Given a 3 millisecond seek time

Given a 3 millisecond seek time for a disk drive and assuming that once you reach the starting track you will write the file as contiguous sectors, how long will it take to write a 1 megabyte file? The disk rotates at 7200 rpm and each sector hold 1 ..

  What is the current size of q

Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operations, 5 of which generated QueueEmptyExceptions, which were caught and ignored. What is the current size of Q?

  Runnig test cases on same piece of code

Why four people must waste their time looking for faults when one person can run test cases on same piece of code. How do you respond?

  Exploit wildcard feature in order to cheat system

How could Dave, dishonest teller, exploit the wildcard feature  to cheat the system? Dave would want to concentrate on vouchers that are nearly one year old since such vouchers are likely to have been lost.

  What can we predict about the future of our economy

1. Would culture affect one's propensity to save? Or, would geographic location affect one's propensity to save?

  Write down differences in company policies of firm

For Firm ABC, each of the relations is in 3NF. Write down two differences should exist in company policies of Firm ABC? Explain your answer.

  Follow-up actions for making decisions

What are the things you should consider in making this decision, and based on your choice, what would be your follow-up actions?

  List five addressing modes of the lc

What is an addressing mode? Name three places an instruction's operands might be located. List five addressing modes of the LC-2.

  Write a program that displays four lines of text in four lab

Write a program that displays four lines of text in four labels

  Which of the following statements is true

Which of the following statements is true?

  Program to clear register a

Write a program to clear Register A, add five to Register A 10 times, and place the result in RAM Location $2000. Use a RAM location for holding the counter.

  What is an evil twin access point and a rogue twin access

What is an evil twin access point and a rogue twin access point?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd