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
monitta
2 years ago
11

CS902 Module3 Homework1

Computers and Technology
1 answer:
egoroff_w [7]2 years ago
3 0
That’s a Great question
You might be interested in
What is the effect of this program?
Mrac [35]

Answer:

The answer is (C)

Let’s run the algorithm on a small input to see the working process.

Let say we have an array {3, 4, 1, 5, 2, 7, 6}. MAX = 7

  • Now for i=0,  i < 7/2, here we exchange the value at ith index with value at (MAX-i-1)th index.
  • So the array becomes {6, 4, 1,  5, 2, 7, 3}. //value at 0th index =3 and value at (7-0-1)th index is 6.
  • Then for i=1, i < 7/2, the value at index 1 and (7-1-1)=5 are swapped.
  • So the array becomes {6, 7, 1,  5, 2, 4, 3}.
  • Then for i=2, i < 7/2, the value at index 2 and (7-2-1)=4 are swapped.
  • So the array becomes {6, 7, 2,  5, 1, 4, 3}.
  • Then for i=3, i not < 7/2, so stop here.
  • Now the current array is {6, 7, 2,  5, 1, 4, 3} and the previous array was{3, 4, 1, 5, 2, 7, 6}.

Explanation:

So from the above execution, we got that the program reverses the numbers stored in the array.

8 0
3 years ago
Oxnard Casualty wants to ensure that their e-mail server has 99.98 percent reliability. They will use several independent server
sattari [20]

Answer:

The smallest number of servers required is 3 servers

<em />

Explanation:

Given

Reliability = 99.98\%

Individual Servers = 95\%

Required

Minimum number of servers needed

Let p represent the probability that a server is reliable and the probability that it wont be reliable be represented with q

Such that

p = 95\%\\

It should be noted that probabilities always add up to 1;

So,

p + q = 1'

Subtract p from both sides

p - p + q = 1 - p

q = 1 - p

Substitute p = 95\%\\

q = 1 - 95\%

Convert % to fraction

q = 1 - \frac{95}{100}

Convert fraction to decimal

q = 1 - 0.95

q = 0.05

------------------------------------------------------------------------------------------------

<em>To get an expression for one server</em>

The probabilities of 1 servers having 99.98% reliability is as follows;

p = 99.98\%

Recall that probabilities always add up to 1;

So,

p + q = 1

Subtract q from both sides

p + q - q = 1 - q

p = 1 - q

So,

p = 1 - q = 99.98\%

1 - q = 99.98\%

Let the number of servers be represented with n

The above expression becomes

1 - q^n = 99.98\%

Convert percent to fraction

1 - q^n = \frac{9998}{10000}

Convert fraction to decimal

1 - q^n = 0.9998

Add q^n to both sides

1 - q^n + q^n= 0.9998 + q^n

1 = 0.9998 + q^n

Subtract 0.9998 from both sides

1 - 0.9998 = 0.9998 - 0.9998 + q^n

1 - 0.9998 = q^n

0.0002 = q^n

Recall that q = 0.05

So, the expression becomes

0.0002 = 0.05^n

Take Log of both sides

Log(0.0002) = Log(0.05^n)

From laws of logarithm Loga^b = bLoga

So,

Log(0.0002) = Log(0.05^n) becomes

Log(0.0002) = nLog(0.05)

Divide both sides by Log0.05

\frac{Log(0.0002)}{Log(0.05)} = \frac{nLog(0.05)}{Log(0.05)}

\frac{Log(0.0002)}{Log(0.05)} = n

n = \frac{Log(0.0002)}{Log(0.05)}

n = \frac{-3.69897000434}{-1.30102999566}

n = 2.84310893421

n = 3 (Approximated)

<em>Hence, the smallest number of servers required is 3 servers</em>

6 0
3 years ago
A research team is studying parallel computing. They want to run parallel process without having to use multiple processors. How
aleksandr82 [10.1K]
I wanna say threads bc cores r processors. And one can run multiple threads. Double check tht :)
5 0
3 years ago
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
The option to add the date and time to a document is located in the
Tomtit [17]

Answer:

The option to add the date and time to a document is located in the

text grouping on the Insert tab.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • What were precomputed tables and why were they necessary?​
    12·2 answers
  • At the beginning of this month, the balance of Reed's checking account was $692.35. So far this month, he has received a paychec
    13·2 answers
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • Describe the 3 different types of authentication
    6·2 answers
  • Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga
    12·2 answers
  • Describe advantages and disadvantages for microprocessor controlled devices in the household.
    7·1 answer
  • Help
    7·1 answer
  • What is an aspect ratio?
    6·1 answer
  • 1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
    12·1 answer
  • Which insert image option allows a user to compile, modify, and add captions to images?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!