Answer:
Curly Braces {}.
Explanation:
The syntax for writing a CSS is as following:-
selector {
property : value;
}
CSS is used for providing the style to the HTML page.Such as fonts,background,height,width etc.
For example:
h1{
font:20px;
background:red;
}
The above written CSS is for the h1 tag in HTML.The font size will be 20 pixels and background color will be red.
So we can say that we need to enclose properties and values in curly braces.
In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)
then, each time you find that charat, spc++.
also, the string must be declared in the main method, not the spaces count method.
The actual code:
public class CountSpaces{
public static void main(String[] args){
String instring = "(your quote here)";
int spaces = calculateSpaces(instring);
System.out.println("The number of spaces is " + spaces);
}
public static int calculateSpaces(String in){
int spc = 0;
for(int i= 0; i<in.length; i++){
if(in.charAt(i)== ' '){
spc++;
}
}
return spc;
}
}
that should be it. If you have any questions, feel free to reach out.
Answer:
a. Ill only
Explanation:
This is because, for option III, in inserting an element, one only need the array key for the position in which to insert the element and this is irrespective of whether the array is sorted or not.
Whereas, options I and II are easier done in a sorted array than in an unsorted array.
Answer: isalpha()
Explanation:
isalpha() is the library function that is used for algorithm and programs for checking whether the given character is alphabet or any other character such as numbers,etc.It can take a integer value for checking character and then return a integer value.
- The passed character for checking gets converted into integer form for evaluation.If the returned integer is zero then ,given character is not alphabet otherwise a non- zero return value indicated alphabet.
- isalpha() Function Prototype :-int isalpha(int argument);