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
denis-greek [22]
3 years ago
10

How would you describe by adding comments to the coding explaining that you know what int num1 = 10; int ave = (num1+num2+num3)/

3; means? Is it declaring that num1 = 10?
Computers and Technology
1 answer:
Radda [10]3 years ago
8 0

Answer:

//declaring variable num1 and intializing it to 10

int num1 = 10;

//declaring variable ave and assigning average of 3 numbers num1,num2,num3

int ave = (num1+num2+num3)/3;

Explanation:

//declaring variable num1 and intializing it to 10

int num1 = 10;

//declaring variable ave and assigning average of 3 numbers num1,num2,num3

int ave = (num1+num2+num3)/3;

You might be interested in
Combination lock uses three numbers beween 1 and 36 with repetition , how mant combinations are possiable
artcher [175]
There are 46656 possible combinations.

6 0
3 years ago
Assuming a computer has a single processor and a single core with no support for parallel execution, explain why running a multi
IRISSAK [1]

Answer:

Explanation:

Before we go deep into this question lets have some brief knowledge on parallel execution, parallel processing and multi tasking.

Parallel Execution : in this two or more tasks or program can be executed parallel or simultaneously.

For example if there are two processors and four programs to be executed then it executes two at a time.

Multi tasking: in this two or more tasks can be performed simultaneously switching between them without exiting any application.

For example we use notepad, word pad, excel sheet, chrome all at a time switching between each other.

Multi Threading: It is splitting up the program into different threads.If the contents in the program are independent on each other then the program can be split into multi threads and can be processed.

Multi threading in multi core or processing unit : In this threads are executed parallel or simultaneously in different processes.

For example if there are two processors then one multi threaded program can execute two threads in two different processors.

Multi threaded program in single core unit : In this, program is multi threaded where as threads cannot execute parallel or simultaneously. they sholud be executed by the same processor. So they should wait in queue

Ex: consider three tasks of 6 secs each and multi threaded each into three threads of two seconds.

Task1 3secs > task2 3secs > task3 3 secs it repeats until each task is completed

Total time taken is 3+3+3+3+3+3+3+3+3 is 18seconds...

If they are executed one by one without multi threading total execution time has no change..

Where as multi threading program has its advantages if different threads are executed at different place..

If one thread executes at network, another at printer and other processor then these three can execute at same time at different processors. Multi threading has its advantages but in single core systems it doesn't affect the performance.

Inter process communication consists of

Information Sharing, message passing, Modularity.

In shared memory inter process communication processes shares the memory between each other.

In message passing communication process communicates like request and replies for information and resources.

Interlocking is due to error in resource sharing and information sharing. It results in system collapse.

Al these process communication is required if there are two or more.processes but in single core it is not much useful and advisable.

In single core there will be a single processor, processing multi threaded program as it can access all the memory contents there will be no problem of process communication. Where as in multi core systems different processes may compete for same memory or resource.

In single core systems inter process communication makes things complex and these complexity is not much useful in any of the improvement in performance.

4 0
3 years ago
Alex's woodworking shop is trying to design a web page with Cascading Style Sheets (CSS). Alex would like create the new design
guajiro [1.7K]

Answer:

1. C) Embedded Style

2. C) User Agent Style

Explanation:

1. Alex will use Embedded style to create styles that apply only to the HTML document that the style was created. With Embedded styling; the rules can be embedded into the HTML document using the <style> element.

2. Since Alex has forgotten to give any style for all of his pages, the style that will be applied to his pages is User Agent Style. User Agent Style is the default style of a browser. The browser has a basic style sheet that gives a default style to any document and this style is called User Agent.

8 0
2 years ago
Which of these is an example of gathering secondary data?
Soloha48 [4]

Answer:

searching for a chart

Explanation:

:)

7 0
3 years ago
Create an array of numbers filled by the random number generator. (value = (int)(Math.random() * 100 + 1);) Print the array and
Y_Kistochka [10]

Answer:

Explanation:

the following is the code to run this (JAVA)

MeanStandardDev.java

import java.util.Random;

import java.util.Scanner;

public class MeanStandardDev {

public static void main(String[] args) {

// Declaring variables

int N;

double lower, upper, min, max, mean, stdDev;

/*

* Creating an Scanner class object which is used to get the inputs

* entered by the user

*/

Scanner sc = new Scanner(System.in);

// Getting the input entered by the user

System.out.print(" How many Random Numbers you want to generate :");

N = sc.nextInt();

System.out.print("Enter the Lower Limit in the Range :");

lower = sc.nextDouble();

System.out.print("Enter the Upper Limit in the Range :");

upper = sc.nextDouble();

// Creating Random class object

Random rand = new Random();

double nos[] = new double[N];

// this loop generates and populates 10 random numbers into an array

for (int i = 0; i < nos.length; i++) {

nos[i] = lower + (upper - lower) * rand.nextDouble();

}

//calling the methods

min = findMinimum(nos);

max = findMaximum(nos);

mean = calMean(nos);

stdDev = calStandardDev(nos, mean);

//Displaying the output

System.out.printf("The Minimum Number is :%.1f\n",min);

System.out.printf("The Maximum Number is :%.1f\n",max);

System.out.printf("The Mean is :%.2f\n",mean);

System.out.printf("The Standard Deviation is :%.2f\n",stdDev);

}

//This method will calculate the standard deviation

private static double calStandardDev(double[] nos, double mean) {

//Declaring local variables

double standard_deviation=0.0,variance=0.0,sum_of_squares=0.0;

/* This loop Calculating the sum of

* square of eeach element in the array

*/

for(int i=0;i<nos.length;i++)

{

/* Calculating the sum of square of

* each element in the array    

*/

sum_of_squares+=Math.pow((nos[i]-mean),2);

}

//calculating the variance of an array

variance=((double)sum_of_squares/(nos.length-1));

//calculating the standard deviation of an array

standard_deviation=Math.sqrt(variance);

return standard_deviation;

}

//This method will calculate the mean

private static double calMean(double[] nos) {

double mean = 0.0, tot = 0.0;

// This for loop will find the minimum and maximum of an array

for (int i = 0; i < nos.length; i++) {

// Calculating the sum of all the elements in the array

tot += nos[i];

}

mean = tot / nos.length;

return mean;

}

//This method will find the Minimum element in the array

private static double findMinimum(double[] nos) {

double min = nos[0];

// This for loop will find the minimum and maximum of an array

for (int i = 0; i < nos.length; i++) {

// Finding minimum element

if (nos[i] < min)

min = nos[i];

}

return min;

}

//This method will find the Maximum element in the array

private static double findMaximum(double[] nos) {

double max = nos[0];

// This for loop will find the minimum and maximum of an array

for (int i = 0; i < nos.length; i++) {

// Finding minimum element

if (nos[i] > max)

max = nos[i];

}

return max;

}

}

the OUTPUT should give;

How many Random Numbers you want to generate :10

Enter the Lower Limit in the Range :1.0

Enter the Upper Limit in the Range :10.0

The Minimum Number is :1.1

The Maximum Number is :9.9

The Mean is :6.30

The Standard Deviation is :2.98

cheers i hope this helps!!!

4 0
3 years ago
Other questions:
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • WHEN COPYING EXISTING SPREADSHEET DATA TO A WORD DOCUMENT YOU NEED TO SELECT?
    12·1 answer
  • What occurs when you call a method on a reference variable that contains null? Select one: a. An ArrayIndexOutOfBoundsException
    11·1 answer
  • Ancestor(X,father(X)) and ancestor(david,george) is they unify or not
    11·1 answer
  • The benefit of host and guest operating system difference is:
    8·2 answers
  • Which feature of spreadsheet software will make it easier for you to find the average number of calls made per hour for each emp
    15·1 answer
  • A software update is also referred to as what?
    15·2 answers
  • SeleCT all correct text​
    5·1 answer
  • How do you code to find the surface area 6 s2, volume s3 in python
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!