Answer:
h
Explanation:
A new computer virus attacks a folder consisting of 200 files. Each file gets damaged with probability 0.2 independently of other files. What is the probability that fewer than 50 files will get damaged? g
Answer:
0.95345
Explanation:
Given that :
Number of files (n) = 200
Probability of getting damaged (p) = 0.2
q = 1 - p = 1 - 0.2 = 0.8
using normal approximation:
Mean (m) = np = 200 * 0.2 = 40
Standard deviation (s) = √n*p*q= √(200 * 0.2 * 0.8) = 5.6568542
P(X < 50)
X = 50 - 0.5 = 49.5
Find the standardized score :
Z = (x - m) / s
Z = (49.5 - 40) / 5.6568542
Z = 9.5 / 5.6568542
Zscore = 1.6793786
P(Z < 1.6793) = 0.95345 ( using Z probability calculator)
Write a program that asks the user to enter 2 words, then prints "Great!" if the two words are identical, "Close enough" if they are the same length and all but the last letter matches, and "Try again" otherwise.
java, desperate fr
Answer:
System.out.println("Enter 2 strings:");
Scanner scan = new Scanner(System.in);
String a = scan.nextLine();
String b = scan.nextLine();
int c = a.length();
int d = b.length();
String e = a.substring(0, a.length()-1);
String f = b.substring(0, b.length()-1);
if (a.equals(b)){
System.out.println("Great!");
}
else if (c== d && e.equals(f)){
System.out.println("Close enough");
}
else{
System.out.println("Try again");
}
}
}
Explanation:
Following are the java program to comparing the words:
Program Explanation:
Import package.Defining the main class.Defining the main method.Inside the main method two string "f,s" is declared that uses input method to input value.After input value multiple conditional statement is declared that checks inputs value.In the if block, it checks first string value equal to second value, if it is true it will print a message "Great!".In the else if block it checks string value that has same length, for this it uses "l" variable that checks length value, and the print the message "Close enough".In the else block, it will print the message "Try again".Program:
import java.util.*;//import package public class Main //defining a class { public static void main(String[] ars) //defining main method { String f,s;//defining String variable Scanner obc=new Scanner(System.in);//creating Scanner class object System.out.print("Enter First word: ");//print message f=obc.next();//input value System.out.print("Enter Second word: ");//print message s=obc.next();//input value if(f.equals(s))//use if to check input string value are equal System.out.println("Great!");//print message else if(f.length()==s.length())//using else if block that checks string value has same length { int c=0;//defining integer variable int l=f.length();//defining integer variable l that holds first string length value for(int i=0;i<l;i++) //using for loop to compare string value { if(f.charAt(i)==s.charAt(i))//use if to compare string by using charAt method c++;//incrementing c value } if(c==l-1 && f.charAt(l-1)!=s.charAt(l-1)) //comparing string { System.out.println("Close enough");//print message } } else //defining else { System.out.println("Try again");//print message } } }
Output:
Please find the attached file.
Learn more:
brainly.com/question/20875119
bvbmb
what are output devices ?
name them
Answer:
Monitor.
Printer.
Headphones.
Computer Speakers.
Projector.
GPS.
Sound Card.
Video Card.
Explanation: