Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a program which generates all prime numbers between 2 and 20. [8 points 2. Write a program that counts the number of vowels

image text in transcribed
1. Write a program which generates all prime numbers between 2 and 20. [8 points 2. Write a program that counts the number of vowels (a, e, i, o, u) (or) (A, E, I, O, U) and the number of consonants in a sentence. [8 points] For example: Enter a sentence: And that's the way it is. Output: Your sentence contains 6 vowels. n! 3. Write a program to compute the permutations lp and combinations n! k!(n - k using recursive functions for the following three pairs of n and k: = c) (n, k) (7, 4). [9 points] 4. Write a program that calculates how many digits a number contains. Assume that the number has no more than four digits. [Hint: Use if statements to test the number.] [8 points] For example: Enter a number: 526 The number 526 has 3 digits. 5. Write a program that prompts the user to enter a telephone number in the form (xx) xx- xxxx and then displays the number in the form xxx.xxx.xxxx [7 points] For example: Enter phone number [(xxx) xxx-xxxx]: (404) 817-6900 You entered: 404.817.6900 Write a program to compute the sum and difference of two matrices which have the same order. Have the user enter the order of the matrices and then have the user enter the elements in the two matrices, and then perform addition and subtraction of respective elements. You may have to use for loops to obtain the entries of the two matrices and also may have to use for loops to add/subtract the entries. [Hint: All matrices have to be stored in 2-D arrays) [10 points] 6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

=+What is he or she seeing that you may not?

Answered: 1 week ago