Write a program that reads a string and outputs the number of times each lowercase vowel appears in it. Your program must contain a function with one of its parameters as a string variable and return the number of times each lowercase vowel appears in it. Also write a program to test your function. (Note that if str is a variable of type string, then str.at(i) returns the character at the ith position. The position of the first character is 0. Also, str.length() returns the length of the str, that is, the number of characters in str.)

Answers

Answer 1

Answer:

Here the code is given as follows,

Explanation:

#include <iostream>

#include <string>

using namespace std;

void Vowels(string userString);

int main()

{

   string userString;

   //to get string from user

   cout << "Please enter a string: ";

   getline(cin,userString,'\n');

   Vowels(userString);

   return 0;

}

void Vowels(string userString)

{

   char currentChar;

   //variables to hold the number of instances of each vowel

   int a = 0, e = 0, i = 0, o = 0, u = 0;  

   for (int x = 0; x < userString.length(); x++)  

   {

       currentChar = userString.at(x);

       switch (currentChar)  

       {

           case 'a':

               a += 1;

               break;

           case 'e':

               e += 1;

               break;

           case 'i':

               i += 1;

               break;

           case 'o':

               o += 1;

               break;

           case 'u':

               u += 1;

               break;

           default:

               break;

       }

   }

   // to print no of times a vowels appears in the string

   cout << "Out of the " << userString.length() << " characters you entered." << endl;

   cout << "Letter a = " << a << " times" << endl;

   cout << "Letter e = " << e << " times" << endl;

   cout << "Letter i = " << i << " times" << endl;

   cout << "Letter o = " << o << " times" << endl;

   cout << "Letter u = " << u << " times" << endl;

}

Hence the code and Output.

Please enter a string

Out of the 16 characters you entered.

Letter a = 2 times

Letter e = 1 times

Letter i = 0 times

Letter o = 1 times

Letter u = 0 times.

Write A Program That Reads A String And Outputs The Number Of Times Each Lowercase Vowel Appears In It.

Related Questions

what is the best motivation that you can do/give to make your employees stay? ​

Answers

i'd give fringe benefits to them every month

Explanation:

to encourage them to work on the mission statement and the business goal

A group of computer scientists wants to create a fixed-length compression algorithm. The simplest way to achieve compression is to use a fixed-length code generator. The idea behind this type of code generator is to assign a fixed-length bit sequence to each symbol of the alphabet. As part of this group of computer scientists, your goal is to write a program to determine the alphabet used by the message to be compressed (set of different characters in the input message), and the frequency of each symbol in the alphabet, using conditionals, loops, and arrays.

Answers

Answer:

Here the code is given as follows,

Explanation:

OUTPUT:  

Message: AAAABBBCCDDDDDDDE  

Number of symbols in the alphabet = 5  

Characters in the alphabet = A,B,C,D,E  

Number of bits per symbol = 3  

Histogram showing the frequency of the symbols in the alphabet  

A | ****  

B | ***  

C | **  

D | *******  

E | *

A) Why should assembly language be avoided for general application development?
B) Under what circumstances would you argue in favor of using assembly language for developing an assembly language program?
C) What are the advantages of using a compiled language over an interpreted one?
D) Under what circumstances would you choose to use an interpreted language?

Answers

Answer:

(A) Assembly language should be avoided for general application development for the following reasons:

i. It is difficult to write assembly language codes. It does not contain many tools and in-built functions to help with the development of these applications.

ii. Since general application development requires that the application be machine independent, writing such applications in assembly language (which is a low level, machine dependent language) might be a pain as it would require that the writer have sufficient knowledge of hardware and operating systems.

(B) The following are the circumstances where assembly language should be used:

i. Assembly languages are low level languages that are very close to machine languages that the machine or processor understands. Therefore, when writing codes for programs that should directly communicate with the processor, assembly language should be used.

ii. Since assembly language codes are machine dependent, when there is a need to write applications for target machines, they should be used.

iii. If there is a need to have very great control of certain features of your application and resources to be consumed such as amount of RAM, clock speed e.t.c, assembly languages are a great tool.

(C) Some of the advantages of compiled language over an interpreted language are:

i. Compiled languages are way faster than interpreted languages because the compiled languages are converted directly into native machine codes that are easy for the processor to execute. Put in a better way, with compiled languages, codes are compiled altogether before execution and therefore reduces the overhead caused at run time. Interpreted languages on the other hand executes codes line after line thereby increasing the overhead at run time.

ii. Since codes are compiled first before execution in compiled languages, nice and powerful optimizations can be applied during the compilation stage.

(D) Interpreted languages could be chosen over compiled languages for the following reasons:

i. Interpreted languages are much more flexible and easier to implement than compiled languages as writing good compilers is not easy.

ii. Since interpreters don't need to convert first to intermediary codes as they execute these codes themselves, programs built with interpreters tend to be platform independent.

please help me I mark you brilliant thanks​

Answers

Answer:

B attaches to C, and C goes into A. (Sequence: A, then insert C into A, then insert B into C.)

Explanation:

You can quite literally get the answer from treating it like a puzzle. There is only 1 solution you can have, and they are marked with shapes. This is also the correct solution to clear the text box with button2 on click.

What new details are you able to see on the slide when the magnification is increased to 10x that you could not see at 4x? What about 40x?

Answers

Answer:

x=10

Explanation:

just need points because i can scan questions anymore

You would like to upgrade the processor in your system to a 64-bit processor. Which of the components will you most likely need to upgrade as well to take full advantage of the new processor

Answers

Answer: Operating system

Explanation:

The components that will be required to upgrade as well to take full advantage of the new processor is the Operating system.

The operating system manages the software resources and the computer hardware, through the provision of common services for the computer programs. It simply supports the basic function of the computer like task scheduling

Consider the following class definitions.
public class Apple

{
public void printColor()
{
System.out.print("Red");
}
}
public class GrannySmith extends Apple
{
public void printColor()
{
System.out.print("Green");
}
}
public class Jonagold extends Apple
{
// no methods defined
}

The following statement appears in a method in another class.
someApple.printColor();
Under which of the following conditions will the statement print "Red" ?
I. When someApple is an object of type Apple
II. When someApple is an object of type GrannySmith
III. When someApple is an object of type Jonagold


a. I only
b. II only
c. I and III only
d. II and III only
e. I, II, and III

Answers

i pretty sure it’s d tell me if I’m wrong

mention 3 components that can be found at the back and front of the system unit​

Answers

Answer:

Back

Power port, USB port, Game port

Front

Power button, USB port, Audio outlet

Explanation:

There are several components that can be found on the system unit.

In most (if not all) computer system units, you will find more component at the back side than the front side.

Some of the components that can be found at the back are:

Ports for peripherals such as the keyboard, mouse, monitor, USB ports, power port, etc.

Some of the components that can be found at the back are:

The power button, cd rom, audio usb ports, several audio outlets, video port, parallel ports, etc.

Note that there are more components on the system units. The listed ones are just a fraction of the whole components

Please Help Me!!!!!!!!!!!!!


A commercial photographer would most likely be employed by which of the following?

A business
A magazine
A travel agency
All the above

Answers

Explanation:

a magazine cause it helps put out commercial

For this activity, you will practice being both proactive and reactive to bugs. Both are necessary to get rid of errors in code.

Proactive:

Log in to REPL.it and open your Calculator program that you built in Unit 5.
In the index.js file, type and finish the following block of code that validates the input to make sure both are numbers (not letters or symbols):
try{
if (isNaN(…) || isNaN(…)){
throw …
}
else{
document.getElementById("answer").innerHTML = num1 + num2;
}
}
catch(e){
document.getElementById("answer")…
}

(Note: The || symbol is used in JavaScript to mean or . You can find this key to the left of the Z key if you’re using a PC or directly above the Enter key if you’re using a Mac.)
Add the finished code above to the correct place in your add() function. Make sure to delete this line since we moved it into the try block:
document.getElementById("answer").innerHTML = num1 + num2;
Paste the same code into the subtract() , multiply() , and divide() functions, making the necessary changes. Be careful with your divide() function since you already have an extra if else statement checking for a division by 0 mistake. (Hint: Cut and paste the entire if else statement inside the else block of your try statement.)
Test your program by typing in letters or symbols instead of numbers. Make sure you get the appropriate error message. (Note: The function is not supposed to check whether the text field is empty, only whether it contains non-numbers.)
When you are finished, share the link to your webpage with your teacher by clicking on the share button and copying the link.
Reactive:
The following Python program should print the sum of all the even numbers from 0 to 10 (inclusive), but it has two bugs:

x = 0
sum = 0
while x < 10:
sum = sum + x
x = x + 1
print(sum)
Complete a trace table and then write a sentence or two explaining what the errors are and how to fix them. You can choose whether to do the trace table by hand or on the computer. Turn in your trace table and explanation to your teacher.

Answers

Answer:

okk

Explanation:

A pointer can be used as a function argument, giving the function access to the original argument.
A. True
B. False

Answers

Answer:

True

Explanation:

A pointer can be used as a function argument, giving the function access to the original argument.

Question 6 Which of the following statements about datasets used in Machine Learning is NOT true? 1 point Testing data is data the model has never seen before and is used to evaluate how good the model is Training subset is the data used to train the algorithm Validation data subset is used to validate results and fine-tune the algorithm's parameters Training data is used to fine-tune algorithm’s parameters and evaluate how good the model is

Answers

Answer:

Training data is used to fine-tune the algorithm’s parameters and evaluate how good the model is

Explanation:

The statement about datasets used in Machine Learning that is NOT true is "Training data is used to fine-tune algorithm’s parameters and evaluate how good the model is."

This is based on the fact that a Training dataset is a process in which a dataset model is trained for corresponding it essentially to fit the parameters.

Also, Testing the dataset is a process of examining the performance of the dataset. This refers to hidden data for which predictions are determined.

And Validation of dataset is a process in which results are verified to perfect the algorithm's details or parameters

Kesley has been hired to set up a network for a large business with ten employees. Which of the factors below will be
least important to her in designing the company's network?
the tasks performed by each computer on the network
the number of hours each employee works
O the number of computers that will be on the network
the way in which business documents are shared in the organization
TURN IT IN
NEXT QUESTION
ASK FOR HELP

Answers

The way the documents are shared

outline 3 computer system problem that could harm people and propose the way avoid the problem​

Answers

Answer:

outline 3 computer system problem that could harm people and propose the way avoid the problem are :_

Computer Won't Start. A computer that suddenly shuts off or has difficulty starting up could have a failing power supply. Abnormally Functioning Operating System or Software. Slow Internet.

It has been a hectic day for the cyber security team. The team is struggling to decide to which incident to devote the most resources. You are estimating the amount of time taken to recover from each incident Which scope factor are you considering?

Answers

Answer:

This definitely is a project management question. The scope factors to be considered are:

Varying Resource Levels Time FactorCompliance with Regulatory Factors Requirements of Stakeholders Quality of Management RisksLegal Factors

Explanation:

Any element or factor that can advantageously advance a project or negatively impact it is usually referred to as Project Scope Factor.

It is considered a desirable or nice-to-have ability to be able to spot these factors to the end that the positive ones are enhanced whilst negative ones are mitigated.

Failure, for instance, to timeously and properly identify factors that can negatively impact a project is most likely to result in a negative outcome.

Cheers

Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a color, and a Boolean value to indicate whether the triangle is filled.

Answers

Answer:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           

Explanation:

   Scanner in = new Scanner(System.in);

       System.out.print("Please enter 3 sides of a triangle, color and " +

                       "whether it is filled or not (true false): ");

       double s1 = in.nextDouble();

       double s2 = in.nextDouble();

       double s3 = in.nextDouble();

       String color = in.next();

       boolean filled = in.nextBoolean();

       

       Triangle t1 = null;

       

       try {

           t1 = new Triangle(s1, s2, s3, color, filled);

       }

       catch (IllegalTriangleException ite) {

           System.out.println(ite.toString());

       }

       

       System.out.println(t1.toString());

       System.out.printf("Triangle color: %s, Triangle filled: %s%n" +  

                       "Area: %.2f%n" +  

                       "Perimeter: %.2f%n%n",

                   t1.getColor(),  

                   t1.isFilled(),

                   t1.getArea(),

                   t1.getPerimeter());

           

Smartphones are more likely to be used than laptop computers for everyday ICT use.
Describe three advantages of using a smartphone rather than a laptop computer.

Answers

Answer:

it's small amd you can carry it everywhere

easy to use

long lasting battery

Explanation:

hope the answers are right:)

You're expecting visitors who will be demanding Mamet access Before they arrive, you can activate a Guest network that has its own ________ and a different password from the one used with the network where you store all your files.

Answers

functions

is the correct answer of your question ^_^

what is function of spacebar​

Answers

Answer:

The function of a spacebar is to enter a space between words/characters when you're typing

To input a space in between characters to create legible sentences

Suppose that in a 00-11 knapsack problem, the order of the items when sorted by increasing weight is the same as their order when sorted by decreasing value. Give an efficient algorithm to find an optimal solution to this variant of the knapsack problem, and argue that your algorithm is correct.

Answers

Answer:

Following are the response to the given question:

Explanation:

The glamorous objective is to examine the items (as being the most valuable and "cheapest" items are chosen) while no item is selectable - in other words, the loading can be reached.

Assume that such a strategy also isn't optimum, this is that there is the set of items not including one of the selfish strategy items (say, i-th item), but instead a heavy, less valuable item j, with j > i and is optimal.

As [tex]W_i < w_j[/tex], the i-th item may be substituted by the j-th item, as well as the overall load is still sustainable. Moreover, because [tex]v_i>v_j[/tex] and this strategy is better, our total profit has dropped. Contradiction.

For each compound below, identify any polar covalent bonds and indicate the direction of the dipole moment using the symbols δ +and δ-.
(a) HBr
(b) HCI
(c) H2O
(d) CH40

Answers

Answer:

H-Br bond is polar, hydrogen is partly positive and bromine is partly negative

H-Cl bond is polar, hydrogen is partly positive and bromine is partly negative

O-H bond in water is polar, hydrogen is partly positive and oxygen is partly negative

C-O bond in CH40 is polar, carbon is partly positive and oxygen is partly negative

Explanation:

A molecule possess a dipole moment when there is a large difference in electro negativity between two bonding atoms in the molecule.

The presence of dipole moments introduces polarity to the molecule. In all the molecules listed in the answer, the shared electron pair of the bond is closer to the more electronegative atom causing it to be partially negative while the less electronegative atom in the bond is partially positive.

2. A data catalog identifies all of the following, except: a. Attribute data type b. Attribute range of values c. Attribute constraints d. Attribute value for Instructor ID

Answers

Answer:

c. Attribute constraints

Explanation:

A data catalog identifies all of the following, except: "Attribute constraints"

The above statement is TRUE because a Data Catalog, a metadata management service, operates by searching for key data, understand and manage data for usefulness.

Data Catalog checks on the BigQuery datasets, tables, and views and checks both technical and business metadata by identifying the following attributes:

1. Data type

2. Range of values

3. Value for Instructor ID

Which statement describes what happens when a user configures No Automatic Filtering in Junk Mail Options?
O No messages will ever be blocked from the user's mailbox.
Messages can still be blocked at the server level.
O Messages cannot be blocked at the network firewall.
O Most obvious spam messages will still reach the client computer,
PLEASE ANSWER CORRECTLY WILL GIVE 15pts

Answers

No messages will ever be blocked from the users mailbox. Messages can still be blacked at the sever level

HEALTH AND SAFETY IN USING ICT TOOLS

Answers

Answer:

Health and Safety using ICT Tools.

...

Some of the long-term health effects are:

Headaches and tiredness. Using the mobile phone for hours can be very stressful and may lead to mild or severe headaches.

Creates joint pain. ...

Mobile phone battery explosion. ...

Induced ringing!

Answer:

ICT tools for health and safety. Find common health issues related to computer usage and other ICT tools.

Explanation:

Use of ICT instruments

ICT tools are computer-based equipment used for processing and communicating information and technology. There are certain ICT tools;

- TV.

- System of Public Address

- Radio

- Mobile Phone

- Computer

What are the adverse consequences of long-term television exposure?

You don't have eyes for hours to stare at the TV.

Taking hours on the TV can be dangerous and dangerous for the eye.

If you starve continuously, your eye will get overworked and this will cause an irritation of the eye, such as dry eye, red, itchy, and watery eyes, fatigue, eyelid weight or forehead, as well as eye concentration.

Certain long-term effects on health are:

1. Tiredness and headaches.

2. Make pain joint.

3. Battery explosion mobile phone.

4. Ringing induced! In ears.

for macroscale distillations, or for microscale distillations using glassware with elastomeric connectors, compare the plot from your simple distillation with that from your fractional distillation. in which case do the changes in temperature occur more gradually

Answers

Answer:

Fractional Distillation

Explanation:

Fractional Distillation is more effective as compared to simple distillation. In simple distillation, the temperature changes more gradually as compared to the fractional distillation

Write a program Ticket.py that will allow the user to enter actual speed
limit, the speed limit at which the offender was travelling, and the number
of previous tickets that person has received. The application should
calculate and display how many miles over the speed limit the offender
was travelling, the cost of the speeding ticket, and court cost. Use $10.00
as the amount to be charged for each mile per hour over the speed limit.
The court cost should be $50.00

Answers

Answer:

Following are the code to the given question:

def speedlimit():#defining a method speedlimit

a= int(input("Enter the offender's speed in mph: "))#defining a variable for input value

lim = int(input("Enter the speed limit in mph: "))#defining a variable for input value

n = int(input("The number of previous tickets that person has received: "))#defining a variable for input value

if (lim >= 20) and (lim < 70):#defining if block to check speed is between 20 to 70

if a > lim:#use if to check lim value greater than a

print("Driver was going", a-lim, "mph over the limit.")#print calculated value with message

print("The cost of the speeding ticket $",10*(a-lim))#print calculated value with message

else:

print( "Driver was going at a legal speed.")#print message

else:

print('Invalid speed limit.')#print calculated value with message

print("Court cost $",(50 + n*20))#print calculated value with message

speedlimit()

Output:

Please find the attached file.

Explanation:

In this code, a method "speedlimit" is declared that defines three variables that are "a, lim, and n" in which we input value from the user-end.

Inside the method, a nested conditional statement is used that checks the speed value is between 20 to 70 if it is true it will go to the next condition in which it checks lim value greater than a. It will use a print message that will print the calculated value with the message.

Discuss at least 1 Microsoft Windows security features that could protect data?

Answers

Answer:

Virus & threat protection.

Explanation:

Monitor threats to your device, run scans, and get updates to help detect the latest threats.

One Microsoft Windows security feature that can help protect data is BitLocker Drive Encryption.

BitLocker is a full-disk encryption feature available in certain editions of Microsoft Windows, such as Windows 10 Pro and Enterprise. It provides protection for data stored on the system's hard drives or other storage devices.

By encrypting the entire drive, BitLocker helps safeguard the data against unauthorized access or theft, even if the physical drive is removed from the device. It uses strong encryption algorithms to convert the data into an unreadable format, ensuring that only authorized users with the appropriate encryption key or password can access and decrypt the data.

BitLocker also provides additional security features, such as pre-boot authentication, which requires users to enter a password or use a USB key to unlock the drive before the operating system loads. This prevents unauthorized users from accessing the encrypted data, even if they have physical access to the device.

Overall, BitLocker Drive Encryption is a powerful security feature in Microsoft Windows that can effectively protect data by encrypting entire drives and adding layers of authentication and protection against unauthorized access.

Learn more about Security here:

https://brainly.com/question/13105042

#SPJ6

Any action that causes harm to your computer is called a
1.Security harm
2.Security damage
3.Security risk
4.Security crime​

Answers

Answer:

Security risk.

Explanation:

It is making your computer vulnerable to attacks and less secure.

Any action that causes harm to your computer is called a security risk. That is option 3.

What is security risk in computer?

A computer is an electronic device that can be used to prepare, process and store data.

Security risk in computer is any action undertaken by a computer user that can lead to the loss of data or damage to hardware or software of the computer.

Some of the security risks that predisposes a computer to damage include the following:

unpatched software,

misconfigured software or hardware, and

bad habits such as keeping fluid close to the computer.

Therefore, any action that causes harm to your computer is called a security risk.

Learn more about security risks here:

https://brainly.com/question/25720881

Please help me with this question

Answers

Answer:

2

Explanation:

evaluate the formula for n=2, then it says:

a₂ = 2a₁ - 3·2

So

a₂ = 2·4 - 3·2 = 8-6

a₂ = 2

Which of the following ribbon tools would be most efficient for applying multiple
changes to text formatting?
a. Font Dialog Box
b. Paragraph Styles
c. Styles Dialog Box
d. Find and Replace

Answers

Answer:

Option A, Font Dialog Box

Explanation:

In order to make changes in the text formatting, the font setting in the dialog box can be used on the Ribbon's Home tab.

From the font settings in Word 2016, one can change the following change font color, size, style etc.

Hence, option A is correct

Other Questions
Abbys employee benefits include family health care coverage. She contributes 15% of the cost. Abby gets paid bi-weekly and $105.00 is taken out of each paycheck for family health care coverage. How much does Abby and her employer contribute annually for the family coverage? find the value of x what makes DEF ~ XYZ What is the best summary of the authors claim?Rock lyrics can be like poetry.Bob Dylan was a revolutionary.Musicians deserve Nobel prizes.More Americans deserve Nobel prizes I will give u brainliest and 5 star and thanks if its correct simplify (3 3) 3 Why increasing the temperature of a gas would increase the volume of its container in gas law? Which action would decrease the entropy of a deck of playing cards?A. Shuffling the deckB. Dropping the deck on the floorO C. Stacking the cards in order of face valueD. Throwing the deck up into the airSUBMIT help please! no links :) Can someone summarize this for me i just need like 2 or 3 sentencesI left the woods for as good a reason as I went there. Perhapsit seemed to me that I had several more lives to live, and could notspare any more time for that one. It is remarkable how easily andinsensibly we fall into a particular route, and make a beaten trackfor ourselves. I had not lived there a week before my feet wore apath from my door to the pond-side; and though it is five or sixyears since I trod it, it is still quite distinct. It is true, Ifear, that others may have fallen into it, and so helped to keep itopen. The surface of the earth is soft and impressible by the feetof men; and so with the paths which the mind travels. How worn anddusty, then, must be the highways of the world, how deep the ruts oftradition and conformity! (Easy question)What is an Adaptation? Whats the area of the rectangle find the value of x. What do these terms represent? -8,-4, 0, 4, 8, 12 Does this sentance make sense?Women are also referred to as not be as good at sports. Book: HolesStanley and his family half-jokingly blame their misfortunes on Stanley's "no-good-dirty-rotten-pig-stealing-great-great-grandfather." Do you believe in fate that people are lucky or unlucky or do you believe, as Mr. Pendanski tells the boys, that we are all responsible for ourselves and our destinies? PLEASE HELP WITH THIS. WILL GIVE BRAINLEIST FOR AN ACTUAL ANSWER Determine the distance from (-5,-6) to (3,1). 10.Describe the life of Freedmen after Emancipation. How did the Freedmens Bureau help newly freed African Americans after the war? Got another question for you lovely folk, dont understand how to do this one either One of the most important consequences of the American Revolution was:A. the elimination of British legal traditions in the former Americancolonies.B. the reduced influence of Enlightenment ideals in the formerAmerican colonies.C. the enforcement of popular sovereignty in the former Americancolonies.D. the abolition of all forms of slavery and forced labor in the formerAmerican colonies. solve solve solve solve