Draw a flowchart for a computer program to receive 40 numbers
and output “yes” if number...
Draw a flowchart for a computer program to receive 40 numbers
and output “yes” if number of negative values among the first 10
inputs is equal to number of positive values among the last 10
inputs. Note. The 20 numbers in middle are ignored. For instance,
if the values are:
1,-1,1,1,-1,1,-2,5,1,1,4,4,5,-6,5,8,-12,0,2,0,1,2,3,7,7,-7,0,1,1,1,3,4,1,-1,-1,-1,-1,-1,-1,-1
the program should output “yes” since the number of negative values
in the first 10 numbers is 3, and the number of positive values in
the last 10 numbers...
Your assignment is to implement a computer program in C++ to
implement the below application.
According...
Your assignment is to implement a computer program in C++ to
implement the below application.
According to Dummies.com the following algorithm determines the
amount of paint you need to paint the walls of a four-sided
room:
1. Add together the length of each wall. (For example, if each
of the four walls are 14, 20, 14, 20 feet respectively then the
total length is 14 + 20 + 14 + 20 = 68 feet)
2. Multiply the sum by the...
Program P1
1) integer A, B;
2) input (A);
3) while (A > 0)
4) {...
Program P1
1) integer A, B;
2) input (A);
3) while (A > 0)
4) {
5) B = 1;
6) if (A < 10)
7) B = 0;
8) if (A < 20 or A > 25)
9) B = A * B;
10) else
11) B = A + B;
12) output (A, B);
13) input (A);
14) }
15) output (“Program ends.”);
16) end;
T = {t1=<1>, t2=<33>, t3=<‐1>} or T = {t1=,
t2=, t3=}
6. If...
A commuter crosses one of three bridges, A, B, or C, to go home
from work....
A commuter crosses one of three bridges, A, B, or C, to go home
from work. The commuter crosses A with probability 1/3, B with
probability 1/6, and C with probability 1/2. The commuter arrives
home by 6 p.m. 75%, 60%, and 50% of the time by crossing bridges A,
B, and C, respectively. If the commuter arrives home by 6 p.m.,
find the probability that bridge A was used. Also find the
probabilities for bridges B and C.
1) Suppose an algorithm has 6 types of input given by S = {I_1,
I_2, ...,...
1) Suppose an algorithm has 6 types of input given by S = {I_1,
I_2, ..., I_6}. Suppose the inputs occur with the following
probabilities: P(I_2) = P(I_3) = P(I_4) = 1/12, P(I_5)
= P(I_6) = 1/6, and P(I_1) = 5/12.
Suppose further that each input "I_n" (n = 1,2,3,4,5,6) causes
the algorithm to execute "5n" instructions. What is the expected
number of instructions executed by the algorithm?
2) When three fair dice are tossed, what is the probability that...
1. Within a computer program, the number of bugs (i.e., coding
errors) per lines of code...
1. Within a computer program, the number of bugs (i.e., coding
errors) per lines of code has a Poisson distribution with an
average of fifteen bugs per 1,000 lines.
a. Find the probability that there will be exactly eight bugs in
1,000 lines of code.
b. Find the probability that there will be at least eight bugs
in 1,000 lines of code.
c. Find the probability that there will be at least one bug in
1,000 lines of code.
d....
A computer system uses passwords that contain exactly 5
characters, and each character is 1 of...
A computer system uses passwords that contain exactly 5
characters, and each character is 1 of the 3 lowercase letters (a,
b, c) or 3 upper case letters (A, B, C) or the 5 odd digits (1, 3,
5, 7, 9).. Let Ω denote the set of all possible passwords, and let
A and B denote the events that consist of passwords with only
letters or only integers, respectively. Determine the number of
passwords for A′∩ B′. Report the exact...
A computer system uses passwords that contain exactly 5
characters, and each character is 1 of...
A computer system uses passwords that contain exactly 5
characters, and each character is 1 of the 26 lowercase letters
(a–z) or 26 uppercase letters (A–Z) or 10 integers (0–9). Let Ω
denote the set of all possible passwords, and let A and B denote
the events that consist of passwords with only letters or only
integers, respectively. Determine the probability that a password
contains at least 1 uppercase letter given that it contains only
letters.
The answer is not...