answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rama09 [41]
2 years ago
15

Given the length of a word (wordLen) and the maximum number of consecutive vowels that it can contain (maxVowels), determine how

many unique words can be generated. Words will consist of English alphabetic letters a through z only. Vowels are v: {a, e, i, o, u}; consonants are c: remaining 21 letters. In the explanations, v and c represent vowels and consonants.

Mathematics
1 answer:
grigory [225]2 years ago
3 0

Answer:

Check the explanation

Step-by-step explanation:

C+++ CODE:

#include<bits/stdc++.h>

using namespace std;

//implementing function calculateWays

int calculateWays(int wordlen , int maxvowels)

{

//if max vowels = 0 calculating ways

if(maxvowels==0)

{

int ways = 1;

//loop for calculating ways

for(int i=0 ; i<wordlen ; i++)

{

ways = ways*21;

}

return ways;

}

else

{

if(wordlen==1)//if word length is 1

{

int c = 1, v = 1;

int ways = c*21 + v*5; //calculating ways

return ways;

}

else // if max vowels and world length both are greater then 1

{

int ways = 0;

//loop to calculating

for(int i=0 ; i<wordlen ; i++)

{

int c = 1, v = 1;

for(int j=0 ; j<wordlen-maxvowels ; j++)

{

c = c*21;

}

for(int k=0 ; k<maxvowels ; k++)

{

v = v*5;

}

ways = ways + (v*c); // calculating ways with vowels

}

int ways1 = 1;

for(int i=0 ; i<wordlen ; i++)

{

ways1 = ways1*21; //calculating ways without vowels

}

return ways + ways1 ; //return total ways

}

}

}

int main()

{

int wordlen , maxvowels;// declaring variables

cin>>wordlen>>maxvowels; // reading inputs from user

int ways = calculateWays(wordlen , maxvowels); //passing values to function calculateWays

cout<<ways; //printing ways

return 0;

}

Kindly check the attached images below to see the Code Screenshot and Code Output.

You might be interested in
Agent bourne transferred classified files from the cia mainframe into his flash drive. the drive had 36.536.536, point, 5 megaby
Sophie [7]
For this case, the first thing you should know is that the speed of the transfer is given by
 Speed = Megabytes / time
 Substituting
 V = (549) / (125)
 V = 4.392 mb / s
 answer
 the speed of the transfer was 4,392 mb / s
3 0
2 years ago
Read 2 more answers
Two students, Claude and Diane, were asked to use synthetic division and the Remainder Theorem to find the value of f(2) given f
ad-work [718]

Answer:

Step-by-step explanation:

Part A

In applying the synthetic division, the polynomial would be fully expressed as

2x³ + 0x² + 5x - 6

The coefficients are 2, 0, 5 and - 6

The working becomes

2| 2 0 5 -6

4 8 16

2 4 13 10

The student that correctly used synthetic division to find f(2) is Claudia

Part B

The value of f(2) is

2(2)^3+5(2) - 6

= (2 × 8) + 10 - 6

= 16 + 10 - 6 = 20

Part C

x - 2 is not a factor of 2x³ + 5x - 6 because there is a remainder of 20.

Part D

The methods that can be used to find out if x - 2 is a factor of 2x³ + 5x - 6 are synthetic division, long division, remainder theorem

8 0
2 years ago
A group of randomly selected members of Mothers' Club were asked how many kids they have. The table below shows the results A gr
LenKa [72]

Answer:

54

Step-by-step explanation:

Estimate=Population size × Sample proportion

population size =  120

sample proportion = (9)/(9+6+5) = 9/20 (check on Cymath as a resource)

estimate = 120 x 9/20 = 54

​

5 0
2 years ago
Read 2 more answers
Is the product of two mixed number less than, between,or greater than the two factors?explain
Anna [14]
The product of two mixed numbers is greater than the two factors (assuming that the two numbers are positive and greater than or equal to 1).
To better understand this, let's take as an example the multiplication of 1.5 and 2.25.
Both are mixed numbers, their multiplication is as follows:
1.5 * 2.25 = 3.375
The two factors here are 1.5 and 2.25 and the product is 3.375 which is greater than the factors
7 0
2 years ago
A farm stand wants to sell fruit to local grocery stores in packages with baskets of strawberries, worth $7 apiece, and baskets
8090 [49]

Answer:

number of baskets of strawberries in each package = 21

number of baskets of raspberries in each package = 9

Step-by-step explanation:

Let x = number of baskets of strawberries in each package.

Let y = number of baskets of raspberries in each package.

Baskets of strawberries worth $7 apiece, and baskets of raspberries, worth $11 apiece. The cost of the each package is $246. This means

7x + 11y = 246 - - - - - - - - -1

The owner wants each package to include 30 baskets total. This means

x + y = 30

Put x = 30 - y in equation 1

7(30-y) + 11y = 246

210 - 7y + 11y = 246

-7y + 11y = 246 - 210

4y = 36

y = 36/4 = 9

x = 30-y = 30-9

= 21

7 0
2 years ago
Other questions:
  • Solve the equation using square roots. 6x2 = 54
    8·2 answers
  • MO, MN, and ON are the midsegments of △JKL. What is the perimeter of △JKL? 6 9.5 11.5 19
    10·2 answers
  • ABC and AED are straight lines.
    12·1 answer
  • One winter day, the outside temperature, y, was never below −1°. The inside of a car was always warmer than the temperature outs
    8·2 answers
  • A cylindrical paint can has a 6.5 inch inside diameter and is 7.75 inches high. It is being filled with paint at a rate of 120in
    7·1 answer
  • The following data show the midterm and final exam scores in an English writing class. Student 1 2 3 4 5 6 7 8 9 10 11 12 Midter
    7·1 answer
  • Alexander invested $320 in an account paying an interest rate of 1.5% compounded annually. Assuming no deposits or withdrawals a
    13·1 answer
  • Michael wants to take French or Spanish, or both. But classes are closed, and he must apply and get accepted to be allowed to en
    6·1 answer
  • Unit 7 polygons &amp; quadrilaterals homework 3: rectangles Gina Wilson answer key
    11·1 answer
  • The Hoffman family has bought one pizza on Friday night every week for the last 10 years.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!