Answer:
// program in java.
import java.util.*;
// class definition
class Main
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read input
Scanner scr=new Scanner(System.in);
System.out.print("Enter the String:");
// read string from user
String str=scr.nextLine();
System.out.print("Enter the character:");
// read character
char ch=scr.next().charAt(0);
// variable to count the occurrence of character
int char_count=0;
for(int i=0;i<str.length();i++)
{
// find the character i string
if(ch==str.charAt(i))
// increase the count
char_count++;
}
// print the count
System.out.println("count of "+ch+" in the String is:"+char_count);
}catch(Exception ex){
return;}
}
}
Explanation:
Read a string from user and assign it to variable "str".Then read a character to and assign it to variable "ch".Then Declare a variable "char_count" to count the occurrence of character in the string.Find the count of character in the string. Here upper case character is different than lower case.
Output:
Enter the String:Monday
Enter the character:n
count of n in the String is:1
Enter the String:Nobody
Enter the character:n
count of n in the String is:0
Answer:
11,424,400 possible passwords
Explanation:
Since all characters are letters and only lowercase
we have 26∧4 = 456,976 possibilities
For a 5-character password which is still lower case sensitive.
we have 26∧5 = 11,881,376 possibilities
Many more possible passwords = (11881376-456976)
= 11,424,400 possible passwords
Image editing tools like photoshop and GIMP?
Answer:
a) bytes
b) hertz
c) 1) hertz and 2) bytes
Explanation:
A byte is the basic unit of information and data stored in a computer storage. Hence, the storage capability of a drive will be measured in Bytes. On the other hand speed of processor is measured in terms of number of cycles made per second i.e hertz. Hence, the higher the value of hertz the higher is the speed of the computer.