Question

In: Computer Science

write a statement to guarantee that the initial will be a capital letter. write the code...

write a statement to guarantee that the initial will be a capital letter.
write the code in jsGraph

Solutions

Expert Solution

Statement to check if inital letter will be a capital : string.charAt(0).toUpperCase()

JS Code that converts the inputted string's initial letter to capital :

<!DOCTYPE html> 
<html> 
        <head> 
                <title></title> 
        </head> 
                
        <body style = "text-align:left;"> 
        
                <h1 style = "color:black;" > 
                        Capital Initializer 
                </h1> 
                        
                <input id = "input" type="text" name="input"/> 
                <button onclick="Capital_Changer()"> 
                        Click to capitalize 
                </button> 
                <h3 id = "div" style="color: red"> 
                </h3> 
                        
                <script> 
                
                function Capital_Changer() { //Declaring function capital_changer
                var inp = document.getElementById("input");  //input variable
                var a = document.getElementById("div"); //returns value having id attribute
                var str = inp.value; 
                a.innerHTML = str.charAt(0).toUpperCase() +  //converting first letter to uppercase
                str.slice(1); 
                } 
                </script> 
        </body> 
</html>                                   

Code picture:

Output:

Summary : JS program that guarentees that the inputted string will start with capital letter. and I have also added the required statement at the beginning of the solution that guarentees the initial of a string to be a capital letter. This is all required by you in the question.

P.S. Hope you are satisfied with the provided solution, please give a thumbs up, Good Day !


Related Solutions

Using your language, write about the difference between the letter of credit and letter of guarantee...
Using your language, write about the difference between the letter of credit and letter of guarantee Word Limit for the assignment: Upper word limit: 1200 words Lower word limit: 600 words
Using your language, write about the difference between the letter of credit and letter of guarantee...
Using your language, write about the difference between the letter of credit and letter of guarantee Word Limit for the assignment: Upper word limit: 1200 words Lower word limit: 600 words
For the side-chains of the 20 amino acids. Write the 1-letter code and the 3-letter code...
For the side-chains of the 20 amino acids. Write the 1-letter code and the 3-letter code for each, in groups according to side-chain characteristics (eg. hydrophobic, polar with S or O containing functional groups, and polar with N containing functional groups).  For the amino acids listed, state whether the amino group, the acid group and the side-chain group will be significantly protonated, unprotonated or ~50% protonated at the following pH values: pH= 2.6, 4.8, 6.6, 7.4, 8.4, 9.2, 10.0. Also indicate...
Write a code to find the following in a text file (Letter). language: Python (a) Find...
Write a code to find the following in a text file (Letter). language: Python (a) Find the 20 most common words (b) How many unique words are used? (c) How many words are used at least 5 times? (d) Write the 200 most common words, and their counts, to a file. text file: Look in thy glass and tell the face thou viewest, Now is the time that face should form another, Whose fresh repair if now thou not renewest,...
code in python write a code where the initial value is compounded by a multiplier, rounded...
code in python write a code where the initial value is compounded by a multiplier, rounded to the nearest tenth Output: Initial Value: 10 Multiplier: 1.4 Number of compounds: 10 Your Values are: 10 , 14, 19.6 , 27.4, 38.4, 53.8, 75.3, 105.4, 147.6, 206.6
Write a complain letter to a company that is known globally post as your initial response....
Write a complain letter to a company that is known globally post as your initial response. Your letter should clearly describe the problem, your attempts to solve the problem, and what adjustment or compensation you want. Pay attention to tone and to relationship – you are writing to a person and they may not be responsible for your problem.
1. Write a Formal Letter: SOLICITED LETTER: Write a cover letter for an advertised job, or...
1. Write a Formal Letter: SOLICITED LETTER: Write a cover letter for an advertised job, or a job about which you have specific knowledge (perhaps a new opening at your current place of employment).
write a matlab code to find the following: initial position, initial velocity, and acceleration using the...
write a matlab code to find the following: initial position, initial velocity, and acceleration using the algorithm and information below time(seconds). height(m) velocity(m/s) 0. 0.2. 2.95 algorithm: 1. Enter data in to arrays. 2. Fit the height data to a 2nd order polynomial. 3. Evaluate the polynomial at enough points to get a smooth curve. 4. Find the velocity model by taking derivative of the height polynomial. 5. Evaluate the velocity polynomial at enough times to get a smooth curve
Write out code for a nested if statement that allows a user to enter in a...
Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called product name and checks to see if that product exists in your nested if statement. You must include 5 product names to search for. If it is then assign the price of the item to a variable called amount and then print the product name and the cost of the product to the console. If...
Letter # 1: Routine Request Assignment: Write a letter to your instructor requesting a letter of...
Letter # 1: Routine Request Assignment: Write a letter to your instructor requesting a letter of recommendation. You may be applying to graduate school, for a scholarship, for an internship, or for a full-time job. You select the scenario that is most applicable to your current situation. Preparation: Review Chapter 7: Writing Routine and Positive Messages (Especially pgs. 169-170) Format: Use the modified block letter format for this assignment. Please refer to page 421-423 for an explanation of the block...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT