1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
iragen [17]
3 years ago
5

Each of the following programs has errors. Find as many as you can. 65. // Find the error in this program. #include using namesp

ace std; int main() { int num1 = 0, num2 = 10, result; num1++; result = ++(num1 + num2); cout << num1 << " " << num2 << " " << result; return 0; }
Computers and Technology
1 answer:
Serggg [28]3 years ago
7 0

Answer:

There are two error in this program--

  1. In header file inclusion, file is not defined.
  2. In the statement "result = ++(num1 + num2);" , bracket is fixed after the increment operator.

Explanation:

  • For the first error, the user needs to add the file because "#include" is used to add the library for the program which states about the function and symbols used in the program.
  • The second error is because there must be a variable with the increment operator ( increment operator is being used to increase the value of a variable by 1), but there is a small brace fix in between the operator and operands.
You might be interested in
Which is NOT a way the network operating sys-
irakobra [83]

Answer: A user authentication

3 0
3 years ago
A computer retail store has 15 personal computers in stock. A buyer wants to purchase 3 of them. Unknown to either the retail st
Dima020 [189]

Answer:

a. 1365 ways

b. Probability = 0.4096

c. Probability = 0.5904

Explanation:

Given

PCs = 15

Purchase = 3

Solving (a): Ways to select 4 computers out of 15, we make use of Combination formula as follows;

^nC_r = \frac{n!}{(n-r)!r!}

Where n = 15\ and\ r = 4

^{15}C_4 = \frac{15!}{(15-4)!4!}

^{15}C_4 = \frac{15!}{11!4!}

^{15}C_4 = \frac{15 * 14 * 13 * 12 * 11!}{11! * 4 * 3 * 2 * 1}

^{15}C_4 = \frac{15 * 14 * 13 * 12}{4 * 3 * 2 * 1}

^{15}C_4 = \frac{32760}{24}

^{15}C_4 = 1365

<em>Hence, there are 1365 ways </em>

Solving (b): The probability that exactly 1 will be defective (from the selected 4)

First, we calculate the probability of a PC being defective (p) and probability of a PC not being defective (q)

<em>From the given parameters; 3 out of 15 is detective;</em>

So;

p = 3/15

p = 0.2

q = 1 - p

q = 1 - 0.2

q = 0.8

Solving further using binomial;

(p + q)^n = p^n + ^nC_1p^{n-1}q + ^nC_2p^{n-2}q^2 + .....+q^n

Where n = 4

For the probability that exactly 1 out of 4 will be defective, we make use of

Probability =  ^nC_3pq^3

Substitute 4 for n, 0.2 for p and 0.8 for q

Probability =  ^4C_3 * 0.2 * 0.8^3

Probability =  \frac{4!}{3!1!} * 0.2 * 0.8^3

Probability = 4 * 0.2 * 0.8^3

Probability = 0.4096

Solving (c): Probability that at least one is defective;

In probability, opposite probability sums to 1;

Hence;

<em>Probability that at least one is defective + Probability that at none is defective = 1</em>

Probability that none is defective is calculated as thus;

Probability =  q^n

Substitute 4 for n and 0.8 for q

Probability =  0.8^4

Probability = 0.4096

Substitute 0.4096 for Probability that at none is defective

Probability that at least one is defective + 0.4096= 1

Collect Like Terms

Probability = 1 - 0.4096

Probability = 0.5904

8 0
2 years ago
In a spreadsheet, there are many features that help you edit quickly. True False
9966 [12]

Answer:

True

Explanation:

There are many form a quick editing

i hoped this helped

;)

7 0
3 years ago
Which is the following is a valid email id<br><br>​
Minchanka [31]

Answer:

sorry there are no options available

6 0
2 years ago
Which are examples of copyrighted online materials? Check all that apply.
Stella [2.4K]
The answers are 1, 3, and 5.
7 0
2 years ago
Read 2 more answers
Other questions:
  • Use this option to view your presentation as your audience will see it. a.File menu b.Play button c.Slide Show button d.Tools me
    6·2 answers
  • A _____ defines what must take place, not how it will be accomplished.​
    12·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    6·1 answer
  • Which institution developed outside the limits of the written costitution of the united states ?
    14·1 answer
  • What can be the maximum possible length of an identifier 3163 79 can be of any length​
    5·1 answer
  • Aside from human user types, there are non human user groups. Known as account types, __________ are implemented by the system t
    10·1 answer
  • I need a utube name for a gaming channel....PLEASE HELP...BRAINLIEST
    5·1 answer
  • Question 2/21
    11·1 answer
  • Write any two disadvantage of First generations computers​
    14·1 answer
  • What are some legal issues that can arise from the use of social media?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!