# 20.8: H1.08: Exercises

## Part I.

1. During the first and second quarters of a year, a business had sales of $42,000 and$58,000, respectively. If the growth of sales follows a linear pattern for the next four years, what will sales be in the fourth quarter? In the 9th quarter? Use an algebraic method of solution.
2. Ajax Manufacturing bought a machine for $48,000. It is expected to last 15 years and, at the end of that time, have a salvage value of$7,000. Set up a linear depreciation model for this machine and find the worth at the end of 10 years.
3. For a certain type of letter sent by Federal Express, the charge is $8.50 for the first 8 ounces and$0.90 for each additional ounce (up to 16 ounces.) How much will it cost to send a 12-ounce letter?
4. Write a mathematical model for the population of this city over the given period of time and use that to predict the population in 2010.
 Year 1970 1980 1990 2000 Pop’n (thousands) 234 289.5 345 400.5
1. When cigarettes are burned, one by-product in the smoke is carbon monoxide. Data is collected to determine whether the carbon monoxide emission can be predicted by the nicotine level of the cigarette. It is determined that the relationship is approximately linear when we predict carbon monoxide, C, from the nicotine level, N. Both variables are measured in milligrams. The formula for the model is .
1. Interpret the slope.
2. Interpret the intercept.
2. Reinforced concrete buildings have steel frames. One of the main factors affecting the durability of these buildings is carbonation of the concrete (caused by a chemical reaction that changes the pH of the concrete) which then corrodes the steel reinforcing the building. Data is collected on specimens of the core taken from such buildings, where the depth, d, of the carbonation, in mm, and the strength, s, of the concrete, in mega-Pascals (MPa,) are measured. It is found that the model is
1. Interpret the slope.
2. Interpret the intercept.

## Part II.

In addition to learning to work applied problems, one point of this lesson is to increase your ease and flexibility in reading and working problems. Ask questions as needed.

Notice that many of the following problems have parts labeled with letters. In your solution, you are required to label each of the parts of your solution with the appropriate letter that shows which question you are answering.

Sometimes students prefer to work problems using exactly the same steps as the examples, numbering the steps in the same way. If you would prefer to work the problems in that way, then first do that, numbering the steps just as in the examples. AFTER you have completed that, then re-read the problem and go back and put additional labels onto your solution, to indicate where each part of the stated problem is solved.

1. A college had linear growth in enrollment over the period from 1993 – 2003. In 1997 they had 6754 students enrolled and in 2000 they had 8117 students enrolled. If the same pattern in growth continues, how many students do you expect they will have in 2010?
1. Let t = number of years since 1993. Let E = enrollment. Make a table by hand or in a spreadsheet that shows the relationship of E to t over the given period of time.
2. Graph the relationship.
3. Write a linear model for the relationship of E to t.
4. Interpret the slope and y-intercept in the formula, using the units in the problem.
5. Use the formula to predict the enrollment in 2010.
6. Use your graph to predict the enrollment in 2010.
7. New question—not stated in the original problem: Approximately when do we expect the enrollment to be 11,380 students? Use either your graph or formula to do this. Explain which you used and how you did it.
2. A person deposits a certain amount of money in an account that pays simple interest.Thus the amount of money in the account at any time is a linear function of time. After 2 months, the amount in the account is $759.After 3 months, the amount in the account is$763.50.
1. Do all the steps necessary to find a linear model to relate the amount in the account, y, to the number of months, x. Be sure to interpret the slope and intercept.
2. Use your formula for the linear model to find the amount that will be in the account after 36 months.
3. Use a spreadsheet to make a table of the amount in the account after each month up to 36 and check the answer you obtained using algebra.
3. One can measure temperature in degrees Celsius or degrees Fahrenheit. The two measurements are linearly related. The temperature at which water freezes is 0 degrees Celsius and 32 degrees Fahrenheit. The temperature at which water boils is 100 degrees Celsius and 212 degrees Fahrenheit. We want to predict the temperature Celsius.
1. Let C = degrees Celsius and F = degrees Fahrenheit. Do all the steps necessary to find a linear model to describe this relationship.
2. Interpret the slope and y-intercept of equation, using the units in the problem.
3. When the temperature is 72 degrees Fahrenheit, what is the Celsius temperature?
4. Using your formula, make a table that shows the temperature Fahrenheit from –20 degrees to 120 degrees and the predicted Celsius temperature for each of these. If you can use a spreadsheet for this, produce a table that goes in increments of 1 degree. If you are doing it by hand, produce a table that goes in increments of 10 degrees.
5. Graph this relationship.
4. In 1991, the number of outlet shopping centers in the US was 142. By 1993, the number had increased to 249.
(Hint: Let t = years since 1991 and then solve the problem using t.)
1. If the number of outlet shopping centers continued to increase in a linear pattern, what would have been the number in 1994? Find a linear model and use it to make the prediction.
2. In fact, the actual number of outlet shopping centers in 1994 was 300. Do you think that the increase in the number of outlet shopping centers was approximately linear?
3. Make a graph of the data given in the initial set-up of the problem. Draw the line. Extend the line to 1994. What does your line predict the number of outlet shopping centers will be in 1994? Does that agree with the prediction your formula gave in part a?

For problems 11–14, write an algebraic linear model, interpret the slope and y-intercept, use the linear model to answer the question, and make a graph to check your work.

1. A cellular phone company has equipment that can service 80 thousand customers. In 2000 they had 57 thousand customers and, over the last few years, they have been adding about 3,000 customers per year. How many customers will they have in 2006? If this rate of increase continues, when will they need additional equipment?
2. The manager of a supermarket finds that she can sell 1130 gallons of milk per week at $3.99 per gallon and 1470 gallons of milk per week at$3.79. Assume that the sales, s, is a linear formula of the price, p. How many gallons would she expect to sell at $3.92 per gallon? (Hint: When you interpret the slope, it may seem strange to you. You might want to re-work the problem using cents instead of dollars for the price. That will make it easier to understand the interpretation of the slope.) 3. At 680 Fahrenheit, a certain species of cricket chirps 124 times per minute. At 400 Fahrenheit, the same cricket chirps 86 times per minute. Assume the chirps per minute, C, is linearly related to the temperature Fahrenheit, T. How many times per minute will the cricket chirp at 700 Fahrenheit? If you count the cricket chirps for a minute and find that it is 110 chirps, what is the temperature, to the nearest whole degree? 4. A bicycle manufacturer has daily fixed costs of$1500 and each bicycle costs $80 to manufacture. What is the cost of manufacturing 16 bicycles in a day? How many bicycles could be manufactured in one day for$3220?
5. Recall the example from Topic B. Formulas on “break-even” analysis. A company sells a catnip cat toy for $3 each and sells all that are produced. The fixed cost of production is$6000 and the variable cost is $1.20 each. 1. Write a formula for the cost of producing x toys. [ANSWER:Cost = 6000 + 1.2 x] 2. Write another formula for the revenue produced by selling x toys. [ANSWER:Revenue = 3 x] 3. Use a spreadsheet to graph both formulas. 4. Look at your graph to find the value of x for which the cost is equal to the revenue? (The point on the graph is called the “break-even” point.) [ANSWER: Breakeven is where cost and revenue lines cross.] 5. Use algebra to find the x-value of the break-even point and then use one of the formulas to find the y-value of the break-even point. Write your conclusion in a sentence. 6. A contractor purchases a piece of equipment for$65,000. The operating cost is $4.63 per hour (electricity, maintenance, etc.) and this year the operator is paid$15.37 per hour. That means that the total operating cost is $(4.63 + 15.37) per hour. 1. Find a formula for the cost of the running the machine, C, where the input variable is t = number of hours run. (Be sure to include the purchase cost as the amount it will cost to run it zero hours. Do you see why that makes sense?) 2. If the product generated by the machine in per hour is sold for$50, write a formula for the revenue, R, where the input variable is the number of hours run.
3. If the machine is run for 1500 hours, what will the cost of running it be?
4. If the machine is run for 1500 hours, what will the revenue from running it be?
5. Using a spreadsheet, graph both the cost and the revenue formulas on the same axes. (You will need to decide on an appropriate set of t-values to use for your graph. You may need to do some and then extend it to more t-values.)
6. For what t-value do the graphs of the formulas intersect? (Find it on the graph. Then use algebra to confirm that you have found it correctly.) Write a sentence to answer the question “How long will they have to run the machine to ‘break even,’ meaning that the revenue will equal the total cost?”

• Mathematics for Modeling. Authored by: Mary Parker and Hunter Ellinger. License: CC BY: Attribution

## Targeted exercises against hip fragility

Summary: Compared to high-impact exercises, moderate-magnitude impacts from odd-loading directions have similar ability to thicken vulnerable cortical regions of the femoral neck. Since odd-impact exercises are mechanically less demanding to the body, this type of exercise can provide a reasonable basis for devising feasible, targeted bone training against hip fragility.

Introduction: Regional cortical thinning at the femoral neck is associated with hip fragility. Here, we investigated whether exercises involving high-magnitude impacts, moderate-magnitude impacts from odd directions, high-magnitude muscle forces, low-magnitude impacts at high repetition rate, or non-impact muscle forces at high repetition rate were associated with thicker femoral neck cortex.

Methods: Using three-dimensional magnetic resonance imaging, we scanned the proximal femur of 91 female athletes, representing the above-mentioned five exercise-loadings, and 20 referents. Cortical thickness at the inferior, anterior, superior, and posterior regions of the femoral neck was evaluated. Between-group differences were analyzed with ANCOVA.

Results: For the inferior cortical thickness, only the high-impact group differed significantly (approximately 60%, p = 0.012) from the reference group, while for the anterior cortex, both the high-impact and odd-impact groups differed (approximately 20%, p = 0.042 and p = 0.044, respectively). Also, the posterior cortex was approximately 20% thicker (p = 0.014 and p = 0.006, respectively) in these two groups.

Conclusions: Odd-impact exercise-loading was associated, similar to high-impact exercise-loading, with approximately 20% thicker cortex around the femoral neck. Since odd-impact exercises are mechanically less demanding to the body than high-impact exercises, it is argued that this type of bone training would offer a feasible basis for targeted exercise-based prevention of hip fragility.

## Effects of 24 weeks of whole body vibration training on body composition and muscle strength in untrained females

The aim of this study was to investigate and to compare the effect of 24 weeks "whole body vibration" training and fitness training on body composition and on muscle strength. Forty-eight untrained females (21.3 +/- 2.0 yr) participated in the study. The whole body vibration group (N = 18) performed unloaded static and dynamic exercises on a vibration platform (35 - 40 Hz, 2.5 - 5.0 mm Power Plate). The fitness group (N = 18) followed a standard cardiovascular (15 - 40 min) and resistance training program including dynamic leg press and leg extension exercises (20 - 8 RM). Both groups trained 3 times weekly. The control group (N = 12) did not participate in any training. Body composition was determined by means of underwater weighing. Additionally 12 skinfolds were assessed. Isometric (0 degrees /s) and isokinetic (50 degrees /s, 100 degrees /s, 150 degrees /s) knee-extensor strength was measured by means of a motor-driven dynamometer (Technogym). Over 24 weeks there were no significant changes (p > 0.05) in weight, in percentage body fat, nor in skinfold thickness in any of the groups. Fat free mass increased significantly in the whole body vibration group (+ 2.2 %) only. A significant strength gain was recorded in the whole body vibration group (24.4 +/- 5.1 % 5.9 +/- 2.1 % 8.3 +/- 4.4 % 7.6 +/- 1.5 %) and in the fitness group (16.5 +/- 1.7 % 12.0 +/- 2.7 % 10.4 +/- 2.3 % 10.2 +/- 1.9 %), at 0 degrees /s, 50 degrees /s, 100 degrees /s and 150 degrees /s respectively. In conclusion, 24 weeks whole body vibration training did not reduce weight, total body fat or subcutaneous fat in previously untrained females. However, whole body vibration training induces a gain in knee-extensor strength combined with a small increase in fat free mass. The gain in strength is comparable to the strength increase following a standard fitness training program consisting of cardiovascular and resistance training.

## 20.8: H1.08: Exercises

What is state ? The English meaning of state is the particular condition that someone or something is in at a specific time.

Let us see some states being something - Are you happy or sad? - Is light on or off ? Is present or absent ? - Is full or empty ? For instance, I am happy because I am enjoying creating 30 Days Of React challenge. I believe that you are happy too.

State is an object in react which let the component re-render when state data changes.

We set an initial state inside the constructor or outside the constructor of a class based component. We do not directly change or mutate the state but we use the setState() method to reset to a new state. . As you can see below in the state object we have count with initial value 0. We can access the state object using this.state and the property name. See the example below.

If you run the above code you will see zero on the browser. We can increase or decrease the value the state by changing the value of the state using JavaScript method.

Resetting a state using a JavaScript method

Now, let's add some methods which increase or decrease the value of count by clicking a button. Let us add a button to increase and a button to decrease the value of count. To set the state we use react method this.setState. See the example below

If you understand the above example, adding minus one method will be easy. Let us add the minus one method on the click event.

Both button work well, but we need to re-structure the code well. Let us create separate methods in the component.

Let us do more example about state, in the following example we will develop small application which shows either a dog or cat. We can start by setting the initial state with cat then when it is clicked it will show dog and alternatively. We need one method which changes the animal alternatively. See the code below. If you want to see live click here.

Now, let's put all the codes we have so far and also let's implement state when it is necessary.

I believe that now you have a very good understanding of state. After this, we will use state in other sections too because state and props is the core of a react application.

## High Intensity Interval Training

As you become more advanced in the gym and feel you are ready for the next step in lowering your BMI, high intensity interval training, or HIIT, may be just what you're looking for. HIIT is a training method commonly used by college and professional athletes to help build muscle, increase endurance and lower overall body fat levels.

This training regimen consists of a "rest" and a "work" interval. For instance, you would jog for one minute and then sprint for another minute you then repeat this cycle five to 10 times in a row. The advantage of this type of training is that it requires very little time out of your day, and it will help lower your BMI relatively quickly--you should see significant results within four weeks.

## Thought Questions

13: Figure 1 shows a reddish glow around the star Antares, and yet the caption says that is a dust cloud. What observations would you make to determine whether the red glow is actually produced by dust or whether it is produced by an H II region?

14: If the red glow around Antares is indeed produced by reflection of the light from Antares by dust, what does its red appearance tell you about the likely temperature of Antares? Look up the spectral type of Antares in Appendix J. Was your estimate of the temperature about right? In most of the images in this chapter, a red glow is associated with ionized hydrogen. Would you expect to find an H II region around Antares? Explain your answer.

15: Even though neutral hydrogen is the most abundant element in interstellar matter, it was detected first with a radio telescope, not a visible light telescope. Explain why. (The explanation given in Analyzing Starlight for the fact that hydrogen lines are not strong in stars of all temperatures may be helpful.)

16: The terms H II and H2 are both pronounced “H two.” What is the difference in meaning of those two terms? Can there be such a thing as H III?

17: Suppose someone told you that she had discovered H II around the star Aldebaran. Would you believe her? Why or why not?

18: Describe the spectrum of each of the following:

1. starlight reflected by dust,
2. a star behind invisible interstellar gas, and
3. an emission nebula.

19: According to the text, a star must be hotter than about 25,000 K to produce an H II region. Both the hottest white dwarfs and main-sequence O stars have temperatures hotter than 25,000 K. Which type of star can ionize more hydrogen? Why?

20: From the comments in the text about which kinds of stars produce emission nebulae and which kinds are associated with reflection nebulae, what can you say about the temperatures of the stars that produce NGC 1999? ([link to textbook image of this nebulae] or external link to this reflection nebula https://apod.nasa.gov/apod/ap131128.html

21: One way to calculate the size and shape of the Galaxy is to estimate the distances to faint stars just from their observed apparent brightnesses and to note the distance at which stars are no longer observable. The first astronomers to try this experiment did not know that starlight is dimmed by interstellar dust. Their estimates of the size of the Galaxy were much too small. Explain why.

22: New stars form in regions where the density of gas and dust is relatively high. Suppose you wanted to search for some recently formed stars. Would you more likely be successful if you observed at visible wavelengths or at infrared wavelengths? Why?

23: Thinking about the topics in this chapter, here is an Earth analogy. In big cities, you can see much farther on days without smog. Why?

24: Stars form in the Milky Way at a rate of about 1 solar mass per year. At this rate, how long would it take for all the interstellar gas in the Milky Way to be turned into stars if there were no fresh gas coming in from outside? How does this compare to the estimated age of the universe, 14 billion years? What do you conclude from this?

25: The 21-cm line can be used not just to find out where hydrogen is located in the sky, but also to determine how fast it is moving toward or away from us. Describe how this might work.

26: Astronomers recently detected light emitted by a supernova that was originally observed in 1572, just reaching Earth now. This light was reflected off a dust cloud astronomers call such a reflected light a “light echo” (just like reflected sound is called an echo). How would you expect the spectrum of the light echo to compare to that of the original supernova?

27: We can detect 21-cm emission from other galaxies as well as from our own Galaxy. However, 21-cm emission from our own Galaxy fills most of the sky, so we usually see both at once. How can we distinguish the extragalactic 21-cm emission from that arising in our own Galaxy? (Hint: Other galaxies are generally moving relative to the Milky Way.)

28: We have said repeatedly that blue light undergoes more extinction than red light, which is true for visible and shorter wavelengths. Is the same true for X-rays? Look at [link]. The most dust is in the galactic plane in the middle of the image, and the red colour in the image corresponds to the reddest (lowest-energy) light. Based on what you see in the galactic plane, are X-rays experiencing more extinction at redder or bluer colours? You might consider comparing [link] to [link].

29: Suppose that, instead of being inside the Local Bubble, the Sun were deep inside a giant molecular cloud. What would the night sky look like as seen from Earth at various wavelengths?

30: Suppose that, instead of being inside the Local Bubble, the Sun were inside an H II region. What would the night sky look like at various wavelengths?

## Brain Training Exercise Gives Athletes 'Super Vision'

SAN FRANCISCO — Baseball players who participated in a visual training program achieved ultrasharp vision well above "perfect" 20/20 vision, new research suggests.

Baseball players typically have sharp eyes to start, but by spending a total of 12 hours training their eyes to spot contrast, they can improve that vision to about 20/7.5, said Aaron Seitz, who runs the Brain Games Center for Mental Fitness and Wellbeing at the University of California, Riverside. That would mean they could clearly see something at 20 feet away (6.1 meters) that mere mortals could only make out from a distance of 7.5 feet (2.3 m).

The players also reported better peripheral and low-light vision, Seitz said. [Optical Illusions: A Gallery of Visual Tricks]

Even when catching balls flying through the air at lightning speed, "some said they could see the stitching on the ball and the direction of spin," Seitz said here at the NeuroGaming conference last week (May 6).

Vision training

Though 20/20 is sometimes called "perfect" vision, people can actually do much better than that. Baseball players tend to have extraordinary vision — in fact, one of the greatest baseball players in history, Babe Ruth, was thought to have 20/8 vision, Seitz said. That type of super sight plays an important role in helping players figure out where the ball is going, and can provide a critical edge in high-level gameplay, Seitz said.

To see if brain training could improve not only vision but also playing ability, Seitz and his colleague Jenni Deveau, director of research at the Brain Game Center, subjected 17 of the UC Riverside Highlanders baseball players to daily 25-minute sessions over the course of a month. As a control, the pitchers on the team did visual assessment tests but were not given the training.

During the training, the team had to distinguish the shape of a so-called Gabor patch, in which a circle is made out of a grating with light and dark colors. The patches have been shown to strongly stimulate the brain cells responsible for visual perception, Deveau told Live Science. (Scientists believe that the brain processes visual stimuli at its most basic level by detecting and interpreting the contrast levels between adjacent pixels, so the researchers think the task is honing the brain's vision processing ability, Deveau said.)

As the players' ability to distinguish the contrast improved, the contrast in the grating got fainter and the task got harder. At the end of the task, the players' eyesight had improved by about 30 percent on a visual acuity test, and many of them reported subjective improvements in their vision, Seitz said.

Early stats suggest the training improved their play. The Highlanders won an average of 4.7 more games in their 54-game season , Seitz said. Individual players who took the training improved their performance on certain baseball stats compared with the year before training, and that improvement was sustained in the year after training. The players who received the training also improved more than players on other teams in their division, the Big West Conference, he added.

It's not clear exactly why the baseball team improved. It could be that the team simply has better vision now — or it could be that the training also improved some other aspects of mental processing relevant to the game, Seitz said.

While super vision may be feasible for high-level athletes, they probably won't be able to get much better than about 20/7 vision — the limit of what the eye's hardware can probably process, Deveau said.

And although the training would likely work for anyone, people who, can't find their glasses in the morning if they don't already have them on their face, are unlikely to see much use for it. That's because the training doesn't improve the eye's optics, which are largely the cause of nearsightedness and farsightedness, Deveau said.

"We can expect a one- to two-line difference on an eye chart, so that depends on where you start," Deveau told Live Science.

Still, the vision training could have applications beyond sports. The team is also working with people who have recently undergone cataract surgery to remove the big, cloudy spots in their field of vision, Deveau said. The training could help them interpret their clear, postsurgery field of view more quickly, Deveau said.

## Java String: Exercises, Practice, Solution

1. Write a Java program to get the character at the given index within the String. Go to the editor

2. Write a Java program to get the character (Unicode code point) at the given index within the String. Go to the editor

3. Write a Java program to get the character (Unicode code point) before the specified index within the String. Go to the editor

4. Write a Java program to count a number of Unicode code points in the specified text range of a String. Go to the editor

5. Write a Java program to compare two strings lexicographically. Two strings are lexicographically equal if they are the same length and contain the same characters in the same positions. Go to the editor

6. Write a Java program to compare two strings lexicographically, ignoring case differences. Go to the editor

7. Write a Java program to concatenate a given string to the end of another string. Go to the editor

8. Write a Java program to test if a given string contains the specified sequence of char values. Go to the editor

9. Write a Java program to compare a given string to the specified character sequence. Go to the editor

10. Write a Java program to compare a given string to the specified string buffer. Go to the editor

11. Write a Java program to create a new String object with the contents of a character array. Go to the editor

12. Write a Java program to check whether a given string ends with the contents of another string. Go to the editor

13. Write a Java program to check whether two String objects contain the same data. Go to the editor

14. Write a Java program to compare a given string to another string, ignoring case considerations. Go to the editor

15. Write a Java program to print current date and time in the specified format. Go to the editor

N.B. : The current date and time will change according to your system date and time.

16. Write a Java program to get the contents of a given string as a byte array. Go to the editor

17. Write a Java program to get the contents of a given string as a character array. Go to the editor

18. Write a Java program to create a unique identifier of a given string. Go to the editor

19. Write a Java program to get the index of all the characters of the alphabet. Go to the editor

Sample string of all alphabet: "The quick brown fox jumps over the lazy dog."

20. Write a Java program to get the canonical representation of the string object. Go to the editor

21. Write a Java program to get the last index of a string within a string. Go to the editor

Sample string of all alphabet: "The quick brown fox jumps over the lazy dog."

22. Write a Java program to get the length of a given string. Go to the editor

23. Write a Java program to find whether a region in the current string matches a region in another string. Go to the editor

24. Write a Java program to replace a specified character with another character. Go to the editor

25. Write a Java program to replace each substring of a given string that matches the given regular expression with the given replacement. Go to the editor

Sample string : "The quick brown fox jumps over the lazy dog."

In the above string replace all the fox with cat.

26. Write a Java program to check whether a given string starts with the contents of another string. Go to the editor

27. Write a Java program to get a substring of a given string between two specified positions. Go to the editor

28. Write a Java program to create a character array containing the contents of a string. Go to the editor

29. Write a Java program to convert all the characters in a string to lowercase. Go to the editor

30. Write a Java program to convert all the characters in a string to uppercase. Go to the editor

31. Write a Java program to trim any leading or trailing whitespace from a given string. Go to the editor

32. Write a Java program to find longest Palindromic Substring within a string. Go to the editor

33. Write a Java program to find all interleavings of given strings. Go to the editor

34. Write a Java program to find the second most frequent character in a given string. Go to the editor

35. Write a Java program to print all permutations of a given string with repetition. Go to the editor

36. Write a Java program to check whether two strings are interliving of a given string. Assuming that the unique characters in both strings. Go to the editor

37. Write a Java program to find length of the longest substring of a given string without repeating characters. Go to the editor

38. Write a Java program to print after removing duplicates from a given string. Go to the editor

39. Write a Java program to find first non repeating character in a string. Go to the editor

40. Write a Java program to divide a string in n equal parts. Go to the editor

41. Write a Java program to remove duplicate characters from a given string presents in another given string. Go to the editor

42. Write a Java program to print list items containing all characters of a given word. Go to the editor

43. Write a Java program to find the maximum occurring character in a string. Go to the editor

44. Write a Java program to reverse a string using recursion. Go to the editor

45. Write a Java program to reverse words in a given string. Go to the editor

46. Write a Java program to reverse every word in a string using methods. Go to the editor

47. Write a Java program to rearrange a string so that all same characters become d distance away. Go to the editor

48. Write a Java program to remove "b" and "ac" from a given string. Go to the editor

49. Write a Java program to find first non-repeating character from a stream of characters. Go to the editor

50. Write a Java program to find lexicographic rank of a given string. Go to the editor

N.B.: Total possible permutations of BDCA are(lexicographic order) :
1&emsp&emsp&emsp2&emsp&emsp&emsp3&emsp&emsp 4&emsp&emsp 5&emsp&emsp 6&emsp&emsp 7&emsp&emsp&emsp8&emsp&emsp 9&emsp&emsp 10&emsp&emsp 11&emsp&emsp 12
The BDCA appear in 12 position of permutation (lexicographic order).

51. Write a Java program to count and print all the duplicates in the input string. Go to the editor

52. Write a Java program to check if two given strings are rotations of each other. Go to the editor

53. Write a Java program to match two strings where one string contains wildcard characters. Go to the editor

54. Write a Java program to find the smallest window in a string containing all characters of another string. Go to the editor

55. Write a Java program to remove all adjacent duplicates recursively from a given string. Go to the editor

56. Write a Java program to append two given strings such that, if the concatenation creates a double characters then omit one of the characters. Go to the editor

57. Write a Java program to create a new string from a given string swapping the last two characters of the given string. The length of the given string must be two or more. Go to the editor

58. Write a Java program to read a string and return true if it ends with a specified string of length 2. Go to the editor

59. Write a Java program to read a string,if the string begins with "red" or "black" return that color string, otherwise return the empty string. Go to the editor

60. Write a Java program to read two strings append them together and return the result. If the strings are different lengths, remove characters from the beginning of longer string and make them equal length. Go to the editor

61. Write a Java program to create a new string taking specified number of characters from first and last position of a given string. Go to the editor

62. Write a Java program to read a string and return true if "good" appears starting at index 0 or 1 in the given string. Go to the editor

63. Write a Java program to check whether the first two characters present at the end of a given string. Go to the editor

64. Write a Java program to read a string and if a substring of length two appears at both its beginning and end, return a string without the substring at the beginning otherwise, return the original string unchanged. Go to the editor

65. Write a Java program to read a given string and if the first or last characters are same return the string without those characters otherwise return the string unchanged. Go to the editor

66. Write a Java program to read a string and return the string without the first two characters. Keep the first character if it is 'g' and keep the second character if it is 'h'. Go to the editor

67. Write a Java program to read a string and if one or both of the first two characters is equal to specified character return without those characters otherwise return the string unchanged. Go to the editor

68. Write a Java program to read a string and returns after removing a specified character and its immediate left and right characters. Go to the editor

69. Write a Java program to return the substring that is between the first and last appearance of the substring 'toast' in the given string,or return the empty string if substirng 'toast' does not exists. Go to the editor

70. Write a Java program to check whether a string is pq-balanced or not.A String is pq-balanced if for all the p's in the string atleast one 'q' must exists right of the p's.But 'q' before the 'p' makes the pq-balanced false. Go to the editor

71. Write a Java program to check two given strings whether any one of them appear at the end of the other string (ignore case sensitivity). Go to the editor

72. Write a Java program to return true if a given string contain the string 'pop', but the middle 'o' also may other character. Go to the editor

73. Write a Java program to check whether a substring appears before a period(.) within a given string. Go to the editor

74. Write a Java program to check whether a prefix string creates using the first specific characters in a given string, appears somewhere else in the string. Go to the editor

75. Write a Java program to check whether a given substring presents in the middle of another given string. Here middle means difference between the number of characters to the left and right of the given substring not more than 1. Go to the editor

76. Write a Java program to count how many times the substring 'life' present at anywhere in a given string. Counting can also happen for the substring 'li?e', any character instead of 'f'. Go to the editor

77. Write a Java program to add a string with specific number of times separated by a substring. Go to the editor

78. Write a Java program to repeat a specific number of characters for specific number of times from the last part of a given string. Go to the editor

79. Write a Java program to create a new string from a given string after removing the 2nd character from the substring of length three starting with 'z' and ending with 'g' presents in the said string. Go to the editor

80. Write a Java program to check whether the character immediately before and after a specified character is same in a given string. Go to the editor

81. Write a Java program to check whether two strings of length 3 and 4 appear in same number of times in a given string. Go to the editor

82. Write a Java program to create a new string repeating every character twice of a given string. Go to the editor

83. Write a Java program to make a new string from two given string in such a way that, each character of two string will come respectively. Go to the editor

84. Write a Java program to make a new string made of p number of characters from the first of a given string and followed by p-1 number characters till the p is greater than zero. Go to the editor

85. Write a Java program to make a new string with each character of just before and after of a non-empty substring whichever it appears in a non-empty given string. Go to the editor

86. Write a Java program to count the number of triples (characters appearing three times in a row) in a given string. Go to the editor

87. Write a Java program to check whether a specified character is happy or not. A character is happy when the same character appears to its left or right in a string. Go to the editor

88. Write a Java program to return a string where every appearance of the lowercase word 'is' has been replaced with 'is not'. Go to the editor

89. Write a Java program to calculate the sum of the numbers appear in a given string. Go to the editor

90. Write a Java program to check the number of appearances of the two substrings appear anywhere in the string. Go to the editor

91. Write a Java program to count the number of words ending in 'm' or 'n' (not case sensitive) in a given text. Go to the editor

92. Write a Java program to return a substring after removing the all instances of remove string as given from the given main string. Go to the editor

93. Write a Java program to find the longest substring appears at both ends of a given string. Go to the editor

94. Write a Java program to find the longest mirror image string at the both ends of a given string. Go to the editor

95. Write a Java program to return the sum of the digits present in the given string. If there is no digits the sum return is 0. Go to the editor

96. Write a Java program to create a new string after removing a specified character from a given string except the first and last position. Go to the editor

97. Write a Java program to return a string with the characters of the index position 0,1,2, 5,6,7, . from a given string. Go to the editor

98. Write a Java program to check whether the first instance of a given character is immediately followed by the same character in a given string. Go to the editor

99. Write a Java program to return a new string using every character of even positions from a given string. Go to the editor

100. Write a Java program to check if a given string contains another string. Return true or false. Go to the editor

101. Write a Java program to test if a given string contains only digits. Return true or false. Go to the editor

102. Write a Java program to convert a given String to int, long, float and double. Go to the editor

103. Write a Java program to remove a specified character from a given string. Go to the editor

104. Write a Java program to sort in ascending and descending order by length of the given array of strings. Go to the editor

105. Write a Java program to count the occurrences of a given string in another given string. Go to the editor

106. Write a Java program to concatenate a given string with itself of a given number of times. Go to the editor

107. Write a Java program to counts occurrences of a certain character in a given string. Go to the editor

## Aldar Properties unveils new e-procurement portal

Aldar Properties, Abu Dhabi's leading listed property development, investment and management company, announced the launch of a new online e-procurement portal - BravoAdvantage - in partnership with Tejari, a strategic procurement company.

The platform will enable Aldar to automate routine procurement tasks and facilitate supplier on-boarding, allowing the group's procurement team to reallocate resources to focus on more strategic and valuable supply management activities. The portal supports Aldar's commitment to maintaining consistent, strategic engagement with its supplier community in order to enhance its registration process visibility.

M. Nader Saleh Al Awlaqi, executive director of procurement at Aldar Properties, said: "Aldar is a significant contributor to developing and reshaping the fabric of urban life in Abu Dhabi in line with the vision of the emirate. As such it is important that we continue to set new standards for our performance, which contributes in facilitating the suppliers' registration and evaluation functions and contract operations."

Richard Hogg, CEO of Tejari, said: "Forward-thinking organisations such as Aldar Properties recognise the tremendous impact procurement can make on an organisation's overall growth and profitability. By adopting a transformative approach to procurement, Aldar will be able to unlock procurement's full power and drive excellence that will shape the direction of the organisation."

Tejari played a key role in the implementation of the application, providing end-user training and support to Aldar Properties.

Aldar Properties, a leading real estate developer in Abu Dhabi, UAE, has delivered a resilient underlying performance across its businesses for the first half of 2018 compared to the same period last

Leading UAE developer Aldar Properties said work is progressing well on all its projects at Yas Island in Abu Dhabi with the delivery of the first 300 homes under way at the island’s first villa comm

Aldar Properties, a leading developer in Abu Dhabi, UAE, said it has signed up global hospitality giant Marriott International to manage one of its most strategically located hotels on Yas Island.
Price: AED 1.98 0.07 (3.66

## Error traps

### Watch out how you connect X2 terminal on a delta high leg setup

Do not tie all X2’s to the ground as shown in the image below. I’ve done it once and it blew the high side fuses. The theory is by tying all X2’s to ground, you are reducing the counter magnetomotive force (MMF) that’s developed in the core (Lenz’s law). The induced current (in the core) ends up being more in-phase with the voltage, leading to a short-circuit.

### Re-landing different phases after establishing vectors

Notice how, in this exercise, we ended with C-phase on the H1 terminal of the transformer T1. Would you like A-phase on H1? The fix is simple. Keep the A-B-C and a-b-c text fixed and rotate all vectors (HV & LV) simultaneously until the H1 of T1 meets the letter A. The final vector config would look like below.