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
Dominik [7]
3 years ago
6

In the following shell scripting extract, the initial values of variables s, c and p are 0, 1, 1 respectively. What will be the

final value of s, at the end of the while loop?

Computers and Technology
1 answer:
____ [38]3 years ago
3 0

Answer:

The first example simply counts the number of lines in an input file. It does so by iterating over all lines of a file using a while loop, performing a read operation in the loop header. While there is a line to process, the loop body will be executed in this case simply increasing a counter by ((counter++)). Additionally the current line is written into a file, whose name is specified by the variable file, by echoing the value of the variable line and redirecting the standard output of the variable to $file. the current line to file. The latter is not needed for the line count, of course, but demonstrates how to check for success of an operation: the special variable $? will contain the return code from the previous command (the redirected echo). By Unix convention, success is indicated by a return code of 0, all other values are error code with application specific meaning.

Another important issue to consider is that the integer variable, over which iteration is performed should always count down so that the analysis can find a bound. This might require some restructuring of the code, as in the following example, where an explicit counter z is introduced for this purpose. After the loop, the line count and the contents of the last line are printed, using echo. Of course, there is a Linux command that already implements line-count functionality: wc (for word-count) prints, when called with option -l, the number of lines in the file. We use this to check wether our line count is correct, demonstrating numeric operations on the way.

You might be interested in
On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance
lesantik [10]

Answer:

In C:

#include <stdio.h>

#include <math.h>

int main(){

   float f0,r,temp;

   r = pow(2.0,1.0/12);

   printf("f0: ");    scanf("%f", &f0);

   temp = f0;

   for(int i = 0; i<=4;i++){

       f0 = f0 * pow(r,i);

       printf("%.2lf ", f0);

       f0 = temp;    }

   return 0;

}

Explanation:

This declares f0, r and temp as float

   float f0,r,temp;

This initializes r to 2^(1/12)

   r = pow(2.0,1.0/12);

This prompts the user for f0

   printf("f0: ");    scanf("%f", &f0);

This saves f0 in temp

   temp = f0;

This iterates the number of keys from 0 to 4

   for(int i = 0; i<=4;i++){

This calculates each key

       f0 = f0 * pow(r,i);

This prints the key

       printf("%.2lf ", f0);

This gets the initial value of f0

       f0 = temp;    }

   return 0;

8 0
3 years ago
Bulldog Holdings is a U.S.-based consumer electronics company. It owns smaller firms in Japan and Taiwan where most of its cell
GenaCL600 [577]

Answer:

The answer to the following question is the parent company subsidiary relationship.

Explanation:

This relationship exists when a company controlling another by owning the majority voting of stock.

Generally, a Parent company subsidiary relationship means the relationship which exists when a corporation indirectly or directly owns shares by possessing more than the 50 percent of the voting power of another corporation.

In Parent companies, they can either hands-off or hands-on owners of subsidiaries.

It is virtually same as the holding companies.

5 0
3 years ago
Use the following cell phone airport data speeds​ (Mbps) from a particular network. Find P10. 0.1 0.1 0.3 0.3 0.3 0.4 0.4 0.4 0.
sasho [114]

Answer:

P_{10} =0.1

Explanation:

Given

0.1, 0.1, 0.3, 0.3, 0.3, 0.4, 0.4, 0.4, 0.6, 0.7, 0.7, 0.7, 0.8, 0.8

Required

Determine P_{10}

P_{10} implies 10th percentile and this is calculated as thus

P_{10} = \frac{10(n+1)}{100}

Where n is the number of data; n = 14

P_{10} = \frac{10(n+1)}{100}

Substitute 14 for n

P_{10} = \frac{10(14+1)}{100}

P_{10} = \frac{10(15)}{100}

Open the bracket

P_{10} = \frac{10 * 15}{100}

P_{10} = \frac{150}{100}

P_{10} = 1.5th\ item

This means that the 1.5th item is P_{10}

And this falls between the 1st and 2nd item and is calculated as thus;

P_{10} = 1.5th\ item

Express 1.5 as 1 + 0.5

P_{10} = (1 +0.5)\ th\ item

P_{10} = 1^{st}\ item +0.5(2^{nd} - 1^{st}) item

From the given data; 1st\ item = 0.1 and 2nd\ item = 0.1

P_{10} = 1^{st}\ item +0.5(2^{nd} - 1^{st}) item becomes

P_{10} =0.1 +0.5(0.1 - 0.1)

P_{10} =0.1 +0.5(0)

P_{10} =0.1 +0

P_{10} =0.1

3 0
3 years ago
The term used to describe an electronic device, operating under the control of instructions stored in its own memory, that can a
nlexa [21]
The answer to this is Computer!!
3 0
3 years ago
FREE 25 POINTS
shtirl [24]

Answer:

55⁵5555⁵55555555555555555

4 0
3 years ago
Read 2 more answers
Other questions:
  • ________ hackers break into systems for non-malicious reasons such as to test system security vulnerabilities. black-hat gray-ha
    10·1 answer
  • Which of the following could be defined as a general-purpose computing device that enables workers to create, manage, store, sea
    12·1 answer
  • Which term describes the situation wherein a jury fails to reach a unanimous verdict? A occurs when a jury cannot reach a unanim
    14·1 answer
  • Software that helps users to communicate with family, friends and business colleagues by posting personal information, status up
    13·2 answers
  • In computer logic what is order of instructions
    13·1 answer
  • A commercial depicts a teenager on a skateboard vandalizing a brick wall. This is an example of:
    11·2 answers
  • Vhich economic impact of computers was mentioned in this lesson?
    6·1 answer
  • Help me please. I'LL MARK BRAINIEST
    15·1 answer
  • Aranjează următoarele cuvinte din documentul word Proiect, într-o scrisoare în care soliciți directorului școlii sprijin în priv
    8·1 answer
  • The disk you inserted was not readable by this computer
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!