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
vodomira [7]
3 years ago
12

Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res

ult by the amount of numbers. She will use a variable, avg, to store this average. Which variable type would be most suitable for avg?
Computers and Technology
1 answer:
Andre45 [30]3 years ago
5 0

Answer:

a variable of type "double" is more suitable for finding average because average could be any number with decimal places. we can't use a variable of type "integer" because it will omit the value after the decimal and will not produce satisfactory results.  

Explanation:

an example of C++ code is given to find the average of two numbers a and b

#include <iostream>;

using namespace std;

int main() {

double a = 2.334;

double b = 34;

double average =  (a + b) / 2;

cout << average;

return 0;

}

You might be interested in
Write a program that uses the function strcmp() to compare two strings input by the user. The program should state whether the f
Andru [333]

user_str1 = str ( input ("Please enter a phrase: "))

user_str2 = str ( input("Please enter a second phrase: "))

def strcmp (word):

user_in1 = int (len(user_str1))

user_in2 = int (len(user_str2))

if user_in1 > user_in2:

return "Your first phrase is longer"

elif user_in1 < user_in2:

return "Your second phrase is longer"

else:

return "Your phrases are of equal length"

3 0
3 years ago
The birthday paradox says that the probability that two people in a room will have the same birthday is more than half, provided
poizon [28]

Answer:

The Java code is given below with appropriate comments for explanation

Explanation:

// java code to contradict birth day paradox

import java.util.Random;

public class BirthDayParadox

{

public static void main(String[] args)

{

   Random randNum = new Random();

   int people = 5;

   int[] birth_Day = new int[365+1];

   // setting up birthsdays

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

       birth_Day[i] = i + 1;

 

   int iteration;

   // varying number n

   while (people <= 100)

   {

       System.out.println("Number of people: " + people);

       // creating new birth day array

       int[] newbirth_Day = new int[people];

       int count = 0;

       iteration = 100000;

       while(iteration != 0)

       {

           count = 0;

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

           {

               // generating random birth day

               int day = randNum.nextInt(365);

               newbirth_Day[i] = birth_Day[day];

           }

           // check for same birthdays

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

           {

               int bday = newbirth_Day[i];

               for (int j = i+1; j < newbirth_Day.length; j++)

               {

                   if (bday == newbirth_Day[j])

                   {

                       count++;

                       break;

                   }

               }

           }

           iteration = iteration - 1;

       }

       System.out.println("Probability: " + count + "/" + 100000);

       System.out.println();

       people += 5;

   }

}

}

4 0
3 years ago
Which soft skill involves the ability to work harmoniously with your colleagues and improve productivity?
Lina20 [59]
B.Teamwork is a soft skill involves the ability to work harmoniously with your colleagues and improve productivity. It is the collaborative effort of a team to complete a task or to achieve a common goal in the most effective and efficient way.  

 


4 0
3 years ago
Agriscience in the United States?
Mrac [35]

Answer:

The history of agriculture in the United States covers the period from the first English settlers to the present day. In Colonial America, agriculture was the primary livelihood for 90% of the population, and most towns were shipping points for the export of agricultural products. Most farms were geared toward subsistence production for family use. The rapid growth of population and the expansion of the frontier opened up large numbers of new farms, and clearing the land was a major preoccupation of farmers. After 1800, cotton became the chief crop in southern plantations, and the chief American export. After 1840, industrialization and urbanization opened up lucrative domestic markets. The number of farms grew from 1.4 million in 1850, to 4.0 million in 1880, and 6.4 million in 1910; then started to fall, dropping to 5.6 million in 1950 and 2.2 million in 2008

Explanation:

8 0
3 years ago
Identify science and technology policies that could be adapted or implemented in the Philippines?​
mina [271]

Answer:

In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

The private sector may or may not adopt the research. If a research in UP finds a molecule that may kill cancer, we are not sure whether that research will be adopted or not.

We are not sure if that research will be continued to actual creation of a medicine of cancer. This is because our scientists are working in universities and not in actual pharma companies.

In other countries, the scientists build their own companies. So their research go from drug development to actual manufacturing and marketing of medicines.

So when they start a research, you know that in the next 5 to 10 years, these scientists will produce drugs which the public can benefit from.

This is why the Philippine research is not thriving as it should. Our government should support our start ups.

When scientists are given grants for research, they should also be given grants to start their company. Unfortunately, start up grant is not a function of the DOST. It is of the DTI.    

Explanation:

6 0
2 years ago
Other questions:
  • When parking ur vehicle facing downhill with a curb, you should point ur front wheels?
    7·2 answers
  • Given non-negative integers x and n, x taken to the nth power can be defined as: x to the 0th power is 1 x to the nth power can
    7·1 answer
  • Given a typical magnetic hard drive with five platters, answer the following:
    5·1 answer
  • How does adding additional light bulbs affect a series circuit?
    10·1 answer
  • The first documented use of work release was in the ____.
    13·1 answer
  • When preparing a document flowchart, the names of organizational departments or job functions should appear in theA) column head
    6·1 answer
  • What does the action tool allow you to do in Microsoft power point?
    9·1 answer
  • .true or false? one disadvantage of cloudware is that it is never free<br> A. true<br> B. false
    12·1 answer
  • Which term is defined as an exploit that takes place before the security community or software developer knows about the vulnera
    12·1 answer
  • Select all the correct answers
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!