Write a java program that generates random string called str of 10 characters from the English...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a java program that generates random string called str of 10 characters from the English alphabet (lower and upper case, without repeated letters) and then find the index of longest sequence of characters from str that is also a substring in your First Name called matchStr with ignore case. The program should display: 1) The string str. 2) Your first name 3) Index Of The longest sequence matchStr in str. Example: Suppose the generated random String is "vbcedAhmox" Name is "Ahmad" Output: Str= "vbcedAhmox" Name = "Ahmad" Index = 5 4 Write a java program that generates random string called str of 10 characters from the English alphabet (lower and upper case, without repeated letters) and then find the index of longest sequence of characters from str that is also a substring in your First Name called matchStr with ignore case. The program should display: 1) The string str. 2) Your first name 3) Index Of The longest sequence matchStr in str. Example: Suppose the generated random String is "vbcedAhmox" Name is "Ahmad" Output: Str= "vbcedAhmox" Name = "Ahmad" Index = 5 4
Expert Answer:
Answer rating: 100% (QA)
java public class MatchString public static void mainString args Declare the size of random string as 10 int n 10 Declare a variable to store the rand... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these computer network questions
-
Manage risk-related issues and concerns within the program. Meet with relevant program stakeholders on two separate instances, and in each instance: Go over their program-risk related issues and...
-
Consider the energy sector consisting of J firms where energy producers are characterized by their cost functions C j (x j ,e j ). The firms are subject to an emission trading system with a total...
-
When you walk with a cup of coffee (diameter 8 cm) at just the right pace of about 1 step per second, the coffee sloshes more and more until eventually it starts to spill over the top (Fig. 11-55)....
-
Young, innovative, or high-tech firms often adopt the strategy of ignoring history or attempting to do something radically new. In what ways might this strategy help them? In what ways might this...
-
Suppose that in September 2013 a company takes a long position in a contract on May 2014 crude oil futures. It closes out its position in March 2014. The futures price (per barrel) is \($88.30\) when...
-
The Garrett Company has the following transactions during the months of April and May: The cost of the inventory on April 1 is $5, $4, and $2 per unit, respectively, under the FIFO, average, and LIFO...
-
How can we add Database connection script to search product item form input into MySQL Database Tables?
-
Professor Balkaran wants to sell his Bugatti Car and advertises it in the local FIU newspaper at $1,370,000, giving his telephone number, one of his students at FIU sees the advertisement and rings...
-
Making decisions about where to place manufacturing is a difficult task. Numerous decision-makers do complicated analyses for large-scale industrial initiatives. FDI is usually the most expensive...
-
Discussion Questions 1. Compare and contrast planned and emergent approach. 2. Discuss how HRM is related to each of these approaches.
-
if the bank were to lend all the reserves that can be legally lent, what is the potential for new money creation?
-
Question 8 (5 points) Evershine Ltd. is a gold company and its EBITDA is highly sensitive to the price of gold. You have collected the following data for the last four years: Year 2020 (Year 0) 2019...
-
you will assess methods of training and development such as presentation, hands-on, group building, or technology-based training program for the managers of Beefsteak. You will need to determine how...
-
What is the significance of the Palette of King Narmer in terms of its establishment of enduring visual and iconographic conventions that would shape Egyptian art for generations to come?
-
Discuss what is job costing, its features, advantages, and disadvantages?
-
A circular concrete shaft liner with Youngs modulus of 3.4 million psi, Poissons ratio of 0.25, unconfined compressive strength 3,500 psi and tensile strength 350 psi is loaded to the verge of...
-
A palindrome is a string that reads the same forward and backward, such as "radar". Write a static recursive method that has one parameter of type String and returns true if the argument is a...
-
Write a class ContactInfo to store contact information for a person. It should have attributes for a persons name, business phone, home phone, cell phone, e-mail address, and home address. It should...
-
Suppose we attend a party. To be sociable, we will shake hands with everyone else. Write a fragment of code using a for statement that will compute the total number of handshakes that occur. Upon...
-
a. Show that the mean-squared forecast error \(E\left[\left(\hat{y}_{T+1}-y_{T+1} ight)^{2} \mid I_{T} ight]\) for a forecast \(\hat{y}_{T+1}\), that depends only on past information \(I_{T}\), can...
-
Consider the AR(1) model \(y_{t}=\delta+\theta y_{t-1}+e_{t}\) where \(|\theta|)=0\) and \(\operatorname{var}\left(e_{t} \mid I_{t-1} ight)=\sigma^{2}\). Let \(\bar{y}_{-1}=\sum_{t=2}^{T} y_{t}...
-
Consider a stationary model that combines the \(\operatorname{AR}(2)\) model \(y_{t}=\delta+\theta_{1} y_{t-1}+\theta_{2} y_{t-2}+e_{t}\) with an \(\mathrm{AR}(1)\) error model \(e_{t}=ho...
Study smarter with the SolutionInn App