Question
Using C++ 1.) The main module should contain a menu allowing the user to [a] execute exercise 2 (Grocery Expense) below [b] execute exercise 3
Using C++
1.) The main module should contain a menu allowing the user to [a] execute exercise 2 (Grocery Expense) below [b] execute exercise 3 (Frequency of the letters) below and [c] end the program.Include a loop that lets the user repeat the selection again and again until the user selects the option to end the program.
2.) Write a function to read in cost of grocery purchase of each month in dollars (in type double) and calculate the annual grocery expense, highest grocery expense, lowest grocery expense, and average monthly expense and print them to the console. Allow user to input from the keyboard to take 12 numbers (indicating 12 months) in type double for testing. Print the output to the console with the given input. The input and output should be mentioned in the comments with sample tests done with this selection.
3.) Write a function that will read an input (in the format of characters, ending with a period) and calculates the count of the letters: a, b, c and "d", the other letters are to be considered as others and must be saved into that category.You may assume that the input uses all lowercase letters and will not contain spaces in them.
The input and output should be mentioned in the comments with sample tests done with this function.
Example,
Given Input: abbceafdz.
Output:
Letter Number of Occurrences
a 2
b 2
c 1
d 1
others 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started