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
geniusboy [140]
3 years ago
10

In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces o

f pie most people eat in a year. Set up an integer array that can hold responses from 30 people. For each person, enter the number of pieces they say they eat in a year. Then write a function that finds the mode of these 30 values. This will be the number of pie slices eaten by the most people. The function that finds and returns the mode should accept two arguments, an array of integers, and a value indicating how many elements are in the array.

Computers and Technology
1 answer:
Feliz [49]3 years ago
6 0

Answer:

  see below

Explanation:

The program of interest is the function "findMode[x, n]" in the attached. It is written the Wolfram Language of Mathematica.

The basic idea is that the data in the array is sorted. The sorted array is partitioned into sets of identical elements, and the number in each of those sets is counted. The maximum of those counts is the mode. The location of the maximum count corresponds to the location of the set having that count. We use that location information to pull out the mode value(s).

If there is more than one mode, all are reported.

__

An example data array is provided, along with the program output.

You might be interested in
Given two Strings String s1 = "11223351638791377189728193"; String s2 = "983763978669976862724569282405742578"; and String varia
inn [45]

Answer:

import java.math.BigInteger;  

public class Main {  

public static void main(String[] args)  {  

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

BigInteger num1 = new BigInteger(s1);  

BigInteger num2 = new BigInteger(s2);  

BigInteger product = num1.multiply(num2);  

String s3 = product.toString(10);

System.out.println(s3);  

}  

}  

Explanation:

Because s1 and s2 contain large integers, the program need the biginteger module in other to compute the products of s1 and s2 when converted to integers.

This line initializes the two string variables s1 and s2

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

The next two lines convert the two strings to BigInteger. This allows the program to multiply large integers

<em> BigInteger a = new BigInteger(s1);   </em>

<em>BigInteger b = new BigInteger(s2);  </em>

<em />

This computes the product of the two big integers

BigInteger product = num1.multiply(num2);  

This converts the product to String s3

String s3 = product.toString(10);

This prints s3

System.out.println(s3);  

}  

}  

7 0
3 years ago
Discuss the major differences in two approaches ofprogramming i.e. Object oriented programming and structuredprogramming.
Romashka-Z-Leto [24]

Answer:

Differences between Object Oriented Programming and Structured Programming

1. Structured programming focuses on process/logic then data while OOP(Object Oriented programming) focuses on data.

2.OOP supports Inheritance,Encapsulation,Abstraction,Polymorphism while structured programming does not supports these.

3.Structured programming follows top-down approach while OOP follows bottom-up approach.

4.OOP is more secured than structured programming because it supports Abstraction (data hiding).

7 0
3 years ago
Janice usually works on a particular workbook that contains all business related data. She decides to keep a backup of all the d
quester [9]

The answer is to use the Ctrl and C keys on the keyboard to copy content from one workbook to another.

The Ctrl and C key is the standard combination keys on the keyboard that is used to copy any selected text or objects while in a user interface environment. Janice is required to press the C key while holding down the Ctrl key to copy all the content to the new workbook.

Another way of doing it is to make sure that both source and target workbooks are open. Navigate the sheets you want to copy or move in the source workbook. Click the Home tab and select then format dropdown in the Cells group. Select move or copy sheet option in the Organize sheet option. Choose the target workbook from the To Book dropdown and click OK.

6 0
3 years ago
Read 2 more answers
Suppose you have a file of data of approximately 100,000 personnel records (FYI, 213 = 8192 and 214 = 16384) using Social Securi
Natali [406]

Answer:

See explaination

Explanation:

The reasons why indexed sequential search structure is better are:

1. In index sequential search any field of the records can be used as the key. This key field can be numerical or alphanumerical.

2. Since each record has its data block address, searching for a record in larger database is easy and quick. There is no extra effort to search records. But proper primary key has to be selected to make efficient.

3. This method gives flexibility of using any column as key field and index will be generated based on that. In addition to the primary key and its index, we can have index generated for other fields too. Hence searching becomes more efficient, if there is search based on columns other than primary key.

The reasons why 5 B-tree is better:

1.The B-tree Provides support for range of queries in an efficient manner and You can iterate over an ordered list of elements.

2. B-Tree algorithms are good for accessing pages (or blocks) of stored information which are then copied into main memory for processing. In the worst case, they are designed to do dynamic set operations in O(lg n) time because of their high "branching factor" (think hundreds or thousands of keys off of any node). It is this branching factor that makes B-Trees so efficient for block storage/retrieval, since a large branching factor greatly reduces the height of the tree and thus the number of disk accesses needed to find any key.

3. It is a generalization of a BST in that a node can have more than two children. These are self-balancing and hence the average and worst complexities is logarithmic. We opt for these when the data is too huge to fit in main memory. These structures are used in database indexing and help in faster operations on disk

the additional informations is we should first decide to choose which structure is suiatable for which algoritm in terms of space and time and then use the appropriate search algorithm.

8 0
3 years ago
Which of the following information sources was not directly affected by the Telecommunications Act of 1996?
RUDIKE [14]
The answer is 'D', as obvious as it seems...
4 0
2 years ago
Other questions:
  • Your mobile device files can be synchronized using ________. hdmi a secure digital transmission a display adapter a cloud servic
    11·1 answer
  • How do I cancel my membership or Subscription on here
    11·1 answer
  • Prove that for every nfa with an arbitrary number of final states there is an equivalent nfa with only one final state. Can we m
    8·1 answer
  • When configuring a vpn server to automatically assign ​ip addresses to remote clients, how many ip addresses are in a single poo
    10·1 answer
  • Potatocat2UwU da best
    12·1 answer
  • Why did Hunter gatherers moved into the<br>America's?​
    8·1 answer
  • Cheri needs to write a small program that interacts with the user. What step will allow her to do this?
    14·2 answers
  • Charlie does not think he will be able to finish his project by the deadline at this point in the decision making progress to so
    13·1 answer
  • the computer that communicate with each other are called ______please ask the answer in 15 minutes after 1 p.m. ​
    9·1 answer
  • What is the minimum ethernet frame size that will not be discarded by the receiver as a runt frame?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!