5. Write a program that prompts the user for their first name, then generates a userid...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
5. Write a program that prompts the user for their first name, then generates a userid formed by two letters and six digits, as follows: - The two letters come from the first name, that is, the 1st initial followed by the second non-vowel letter from the first name. The vowels are the characters a, e, i, o, and u. Design the function is vowel () to decide whether a letter is vowel or not, and in its implementation, call the find() function of string library. Use letter x as the non-vowel letter if the first name doesn't include a non-vowel letter. - The 6-digit portion is generated randomly. Design the function generate_random_number () to generate a random number between two integers. Call the cstdlib library functions srand() and rand() in the implementation of this function. Here are sample program inputs/outputs: Enter your first name: Sarah You entered: Sarah Your userid is: sr123456 Enter your first name: Aaron You entered: Aaron Your userid is: ar654321 Enter your first name: Joe You entered: Joe Your userid is: jx142536 5. Write a program that prompts the user for their first name, then generates a userid formed by two letters and six digits, as follows: - The two letters come from the first name, that is, the 1st initial followed by the second non-vowel letter from the first name. The vowels are the characters a, e, i, o, and u. Design the function is vowel () to decide whether a letter is vowel or not, and in its implementation, call the find() function of string library. Use letter x as the non-vowel letter if the first name doesn't include a non-vowel letter. - The 6-digit portion is generated randomly. Design the function generate_random_number () to generate a random number between two integers. Call the cstdlib library functions srand() and rand() in the implementation of this function. Here are sample program inputs/outputs: Enter your first name: Sarah You entered: Sarah Your userid is: sr123456 Enter your first name: Aaron You entered: Aaron Your userid is: ar654321 Enter your first name: Joe You entered: Joe Your userid is: jx142536
Expert Answer:
Answer rating: 100% (QA)
It appears that youre asking how to write a program based on the instructions provided in the image Unfortunately the full text of the instructions is ... View the full answer
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Although an insurance adjuster is highly qualified and experienced, sometimes he or she is not confident in his or her abilities, especially with new tasks. He seems to believe that any new...
-
The formula changes based on its location. The formula remains unchanged when it is moved. The formula is related to another spreadsheet. What does the term "relative" mean for a formula?
-
A chemical is spilled into a lake of pure water and the concentration of chemicals in this lake is 4 If 20 of the water in the lake is replaced with clean in one month then. What will be the...
-
Rajeesh Skin Clinic experienced the following selected transactions during October: Oct. 1 Paid for insurance for October through December, $9,000. The payment was recorded in an asset account. 4...
-
The rational valuation formula for stochastic discount factor models is How does this formula simplify, if the SDF can be assumed conditionally uncorrelated, E Man Fi ELD+k\Fi] + >Cov|| | Mirn, Dirk...
-
A turbine rotor is run at the natural frequency of the system. A stroboscope indicates that the maximum displacement of the rotor occurs at an angle \(229^{\circ}\) in the direction of rotation. At...
-
Target prices, target costs, activity-based costing. Snappy Tiles is a small distributor of marble tiles. Snappy identifies its three major activities and cost pools as ordering, receiving and...
-
A large trapezoidal channel (bottom width of 10 m) is constructed in an alluvial material (lined reinforced banks at an angle of 35 degree) with an estimated d50 = 1.5 mm, d35 = 2 mm, and S, = 2.65....
-
Gibson Agency Case: 1. Calculate and present the budgeted profit for each of Gibson's clients for each of the years 2016 through 2019, using the current costing system (i.e., the one described in the...
-
Two small balls with mass 15 g hang in separate thin strings with length L= 1.2 m. The two strings are attached to the ceiling in a common suspension point as the figure above shows. The two balls...
-
Write a program which inputs an octal number and outputs its decimal equivalent. The following example illustrates the expected behavior of the program: Input an octal number: 214 Octal(214) =...
-
Assume that you are one of investment analysts working with Do-It. Your investment manager asked you to prepare an investment plan. All RM1,000,000 that is available must be invested. Your investment...
-
Stock 1 Jan 2020- Purchases Sales Carriage outwards Carriage inwards Returns inwards Return outwards Discounts allowed Salaries Rente Motor expenses General expenses Motor vehicles at cost Office...
-
For 8824 Department of the Treasury Internal Revenue Service Name shown on tax retur 2 3 Part I Information on the Like-Kind Exchange Note: Generally, only real property should be described on lines...
-
Hillside Pharmaceuticals is an Irish firm that manufactures generic drugs. 95% of its customers are in the Euro area. It has recently completed construction of a new fabrication facility in Cork,...
-
Assess the requirements of the Sarbanes-Oxley Act related to accounting quality, indicating whether or not you believe the requirements are sufficient to protect stockholders and potential investors....
-
We all experience emotions, but some people disguise their true feelings better than others. Do you think this is a helpful or harmful thing to do? Under what conditions do you think it would be most...
-
Design a class named Date that meets the following requirements: Three data fields year, month, and day for representing a date A constructor that constructs a date with the specified year, month,...
-
Programming Exercise 11.1 defined the Triangle class with three sides. In a triangle, the sum of any two sides is greater than the other side. The Triangle class must adhere to this rule. Create the...
-
Rewrite Programming Exercise 5.39 as follows: Use a for loop instead of a do-while loop. Let the user enter COMMISSION_SOUGHT instead of fixing it as a constant.
-
Prove: 'Bernoulli's equation is a restrictive form of energy equation'.
-
What are the assumption made for the establishment of Bernoulli's equation?
-
A pipe, through which water is flowing, has diameters \(30 \mathrm{~cm}\) and \(15 \mathrm{~cm}\) at crosssections 1 and 2 respectively. The discharge velocity of the pipe is \(40 \mathrm{~L} /...
Study smarter with the SolutionInn App