answer.
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
Norma-Jean [14]
2 years ago
14

Write the prototype for a function named showValues. It should accept an array of integers and an integer for the array size as

arguments. The function should not return a value.
Computers and Technology
3 answers:
Morgarella [4.7K]2 years ago
6 0

Answer:

void showValues(int * array, int array_size){

int i;

for(i = 0; i < array_size; i++){

printf("%d\n", array[i]);

}

}

Explanation:

I am going to write the prototype of a function as a c code.

array is the array as an argument, and array_size is the argument for the size of the array.

void showValues(int * array, int array_size){

int i;

for(i = 0; i < array_size; i++){

printf("%d\n", array[i]);

}

}

aalyn [17]2 years ago
4 0

Answer:

void showValues(int [<em>maximum</em><em> </em><em>volume</em>],int);

Guest1 year ago
0 0

void showValues(int[],int);

You might be interested in
What is a key differentiator of Conversational AI? It implements Natural Language Understanding (NLU) and other human-like behav
Pavel [41]

Answer:

c

Explanation:

4 0
1 year ago
8.Change the following IP addresses from binary notation to dotted-decimal notation: a.01111111 11110000 01100111 01111101 b.101
Andrews [41]

Answer:

a. 01111111 11110000 01100111 01111101 dotted decimal notation:

(127.240.103.125)

b. 10101111 11000000 11111000 00011101 dotted decimal notation: (175.192.248.29)

c. 11011111 10110000 00011111 01011101 dotted decimal notation:

(223.176.31.93)

d. 11101111 11110111 11000111 00011101 dotted decimal notation:

(239.247.199.29)

a. 208.34.54.12 class is C

b. 238.34.2.1 class is D

c. 242.34.2.8 class is E

d. 129.14.6.8 class is B

a.11110111 11110011 10000111 11011101 class is E

b.10101111 11000000 11110000 00011101 class is B

c.11011111 10110000 00011111 01011101 class is C

d.11101111 11110111 11000111 00011101 class is D

Explanation:

8 a. 01111111 11110000 01100111 01111101

we have to convert this binary notation to dotted decimal notation.

01111111 = 0*2^7 + 1*2^6 + 1*2^5 + 1*2^4 + 1*2^3 + 1*2^2 + 1*2^1 + 1*2^0

           = 0 + 1*64 + 1*32 + 1*16 + 1*8 + 1*4 + 1*2 + 1

           = 64 + 32 + 16 + 8 + 4 + 2 + 1

           = 127

11110000 = 1*2^7 + 1*2^6 + 1*2^5 + 1*2^4 + 0*2^3 + 0*2^2 + 0*2^1 + 0*2^0

               = 1*128 + 1*64 + 1*32 + 16 + 0 + 0 + 0 + 0

               = 128 + 64 + 32 + 16

               = 240

01100111 = 0*2^7 + 1*2^6 + 1*2^5 + 0*2^4 +0*2^3 + 1*2^2 + 1*2^1 + 1*2^0

               = 0 + 1*64 + 1*32 + 0 + 0 + 4 + 2 + 1

               = 64 + 32 + 4 + 2 + 1

               = 103

01111101   = 0*2^7 + 1*2^6 + 1*2^5+ 1*2^4 +1*2^3 +1*2^2 + 0*2^1 + 1*2^0

               = 0 + 1*64 + 1*32 + 1*16 + 1*8 + 1* 4 + 0 + 1

               = 64 + 32 + 16 + 8 + 4 + 1

               = 125

So the IP address from binary notation 01111111 11110000 01100111 01111101 to dotted decimal notation is : 127.240.103.125

b) 10101111 11000000 11111000 00011101

10101111 = 1*2^7 + 0*2^6 + 1*2^5 + 0*2^4 + 1*2^3 + 1*2^2 + 1*2^1 + 1*2^0

             = 175

11000000 = 1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 + 0*2^3 + 0*2^2 + 0*2^1 + 0*2^0

                 = 192

11111000 = 1*2^7 + 1*2^6 + 1*2^5 + 1*2^4 +1*2^3 + 0*2^2 + 0*2^1 + 0*2^0

              = 248

00011101 = 0*2^7 + 0*2^6 + 0*2^5 + 1*2^4 +1*2^3 + 1*2^2 + 0*2^1 + 1*2^0

               = 29

So the IP address from binary notation 10101111 11000000 11111000 00011101  to dotted decimal notation is : 175.192.248.29

c) 11011111 10110000 00011111 01011101

11011111 = 1*2^7 + 1*2^6 + 0*2^5 + 1*2^4 +1*2^3 + 1*2^2 + 1*2^1 + 1*2^0

           = 223

10110000 =  1*2^7 + 0*2^6 + 1*2^5 + 1*2^4 +0*2^3 + 0*2^2 + 0*2^1 + 0*2^0

                = 176

00011111 = 0*2^7 + 0*2^6 + 0*2^5 + 1*2^4 +1*2^3 + 1*2^2 + 1*2^1 + 1*2^0

              = 31

01011101 = 0*2^7 + 1*2^6 + 0*2^5 + 1*2^4 +1*2^3 + 1*2^2 + 0*2^1 + 1*2^0

              = 93

So the IP address from binary notation 11011111 10110000 00011111 01011101 to dotted decimal notation is :223.176.31.93

d) 11101111 11110111 11000111 00011101

11101111 = 1*2^7 + 1*2^6 + 1*2^5 + 0*2^4 +1*2^3 + 1*2^2 + 1*2^1 + 1*2^0

            = 239

11110111 = 1*2^7 + 1*2^6 + 1*2^5 + 1*2^4 +0*2^3 + 1*2^2 + 1*2^1 + 1*2^0

           = 247

11000111 =  1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 +0*2^3 + 1*2^2 + 1*2^1 + 1*2^0

              = 199

00011101 = 0*2^7 + 0*2^6 + 0*2^5 + 1*2^4 +1*2^3 + 1*2^2 + 0*2^1 + 1*2^0

               = 29

So the IP address from binary notation 11101111 11110111 11000111 00011101 to dotted decimal notation is : 239.247.199.29

9. In order to the find the class check the first byte of the IP address which is first 8 bits and check the corresponding class as follows:                

Class A is from 0 to 127

Class B is from 128 to 191

Class C is from 192 to 223

Class D is from 224 to 239

Class E is from 240 to 255

a. 208.34.54.12

If we see the first byte of the IP address which is 208, it belongs to class C as class C ranges from 192 to 223.

b. 238.34.2.1

If we see the first byte of the IP address which is 238, it belongs to class D as Class D ranges from 224 to 239.

c. 242.34.2.8

If we see the first byte of the IP address which is 242, it belongs to class E as Class E ranges from 240 to 255.

d. 129.14.6.8

If we see the first byte of the IP address which is 129, it belongs to class B as Class B ranges from 128 to 191.

10. In order to find the class of the IP addresses in easy way, start checking bit my bit from the left of the IP address and follow this pattern:

0 = Class A

1 - 0 = Class B

1 - 1 - 0 = Class C

1 - 1 - 1 - 0 = Class D

1 - 1 - 1 - 1 = Class E

a. 11110111 11110011 10000111 11011101

If we see the first four bits of the IP address they are 1111 which matches the pattern of class E given above. So this IP address belongs to class E.

b. 10101111 11000000 11110000 00011101

If we see the first bit is 1, the second bit is 0 which shows that this is class B address as 1 0 = Class B given above.

c. 11011111 10110000 00011111 01011101

The first bit is 1, second bit is 1 and third bit is 0 which shows this address belongs to class C as 110 = Class C given above.

d. 11101111 11110111 11000111 00011101

The first bit is 1, the second bit is also 1 and third bit is also 1 which shows that this address belongs to class D.

3 0
1 year ago
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than m
Sever21 [200]

Answer:

The solution is written using Python as it has a simple syntax.

  1. def getHighScores(gameScores, minScore):
  2.    meetsThreshold = []
  3.    for score in gameScores:
  4.        if(score > minScore):
  5.            meetsThreshold.append(score)
  6.    return meetsThreshold
  7. gameScores = [2, 5, 7, 6, 1, 9, 1]
  8. minScore = 5
  9. highScores = getHighScores(gameScores, minScore)
  10. print(highScores)

Explanation:

Line 1-8

  • Create a function and name it as <em>getHighScores</em> which accepts two values, <em>gameScores</em> and <em>minScore</em>. (Line 1)
  • Create an empty list/array and assign it to variable <em>meetsThreshold</em>. (Line 2)
  • Create a for loop to iterate through each of the score in the <em>gameScores</em> (Line 4)
  • Set a condition if the current score is bigger than the <em>minScore</em>, add the score into the <em>meetsThreshold</em> list (Line 5-6)
  • Return <em>meetsThreshold</em> list as the output

Line 11-12

  • create a random list of <em>gameScores</em> (Line 11)
  • Set the minimum score to 5 (Line 12)

Line 13-14

  • Call the function <em>getHighScores()</em> and pass the<em> gameScores</em> and <em>minScore </em>as the arguments. The codes within the function <em>getHighScores()</em>  will run and return the <em>meetsThreshold </em>list and assign it to <em>highScores.</em> (Line 13)
  • Display <em>highScores</em> using built-in function print().
8 0
1 year ago
Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
serious [3.7K]

Answer:

// import the Scanner class

// to allow the program receive user input

import java.util.Scanner;

// The class Solution is defined

public class Solution{

   // main method to begin program execution

   public static void main(String[] args) {

       // scanner object scan is declared

       Scanner scan = new Scanner(System.in);

       // Prompt the user to enter a number

       System.out.println("Enter the number of stars you want: ");

       // user input is assigned to numOfStar

       int numOfStar = scan.nextInt();

       // call the makeStars method

       makeStars(numOfStar);

   }

   

   // makeStars method print stars using recursion

   // the method call itself till starNum == 0

   public static void makeStars(int starNum){

       if (starNum != 0){

           System.out.print("*");

           makeStars(starNum -1);

       }

   }

}

Explanation:

The code is well comment and solve the problem using recursion.

6 0
2 years ago
Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
juin [17]

The answer is B: Yahoo! mail

Donna is able to install Yahoo! mail as an app on her portable devices like phones and tablets and be able to organize her Google mails, Outlook, and yahoo accounts. The beauty of it is that you are able to sign in with any account (non-Yahoo emails). anywhere and at any time. It also provides 1000 GB of free secure cloud storage.



6 0
2 years ago
Read 2 more answers
Other questions:
  • What is the major function of the network access layer?
    5·1 answer
  • In the game Beehive, you play the role of a worker bee who must watch over her hive. Your duties include (among others) directin
    12·2 answers
  • Identify the normalized form of the mantissa in 111.01.
    14·1 answer
  • The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
    5·1 answer
  • Write a recursive method called printNumPattern() to output the following number pattern. Given a positive integer as input (Ex:
    5·1 answer
  • The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
    9·1 answer
  • During the name resolution process, which technique is used to avoid congestion when querying a server
    8·1 answer
  • Ishaan is confused between the terms webpage and website help him in understanding the difference between both​
    11·1 answer
  • Describe copyright statute, disclaimers, and filing procedures.
    5·1 answer
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!