Write a program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 50 temperatures. Use typedef to declare the array type. The average should be displayed to two decimal places

Answers

Answer 1

Answer:

#include <iostream>  

using namespace std;

typedef double* temperatures;

double avg(array t, int length);

double min(array t, int length);

double max(array t, int length);

int main()

{

   cout << "Please input the number of temperatures to be read." << endl;

   int num;

   cin >> num;

   temperatures = new double[num];

   for(int i = 0; i < num; i++)

   {

       cout << "Input temperature " << (i+1) << ":" << endl;

       cin >> temperatures[i];

   }

   cout << "The average temperature is " << avg(temperatures, num) << endl;

   cout << "The highest temperature is " << max(temperatures, num) << endl;

   cout << "The lowest temperature is " << min(temperatures, num) << endl;

}

double avg(array t, int length)

{

   double sum = 0.0;

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

       sum += t[i];

   return sum/length;

}

double min(array t, int length)

{

   if(length == 0)

       return 0;

    double min = t[0];

   for(int i = 1; i < length; i++)

       if(t[i] < min)

           min = t[i];

   return min;

}

double max(array t, int length)

{

   if(length == 0)

       return 0;

      double max = t[0];

   for(int i = 1; i < length; i++)

       if(t[i] > min)

           max = t[i];

   return max;

}

Explanation:

The C++ program get the array of temperatures not more than 50 items and displays the mean, minimum and maximum values of the temperature array.


Related Questions

5. In an array-based implementation of the ADT list, the getEntry method locates the entry by a. going directly to the appropriate array element b. searching for the entry starting at the beginning of the array working to the end c. searching for the entry starting at the end of the array working to the beginning d. none of the above

Answers

Expert Answer for this question-

Explanation:

Answer- C

Is there SUM in Small basic? ​

Answers

Answer:

no

Explanation:

All operations used to construct algorithms belong to one of three categories: sequential, conditional, or iterative. Below is a list of steps from a variety of algorithms. Determine which category to which each of the steps belong (sequential, conditional, or iterative). If the value of test_grade is between 90 and 100, assign a letter grade of A.
Prompt the user for a number, get number from user
Sequential Repeat steps 3-5 until count = 10
If divisor = 0, print error_message
Complete step 1, complete step 2, complete step 3

Answers

Answer:

Answered

Explanation:

1) Conditional category because it uses an IF statement: If value of test grade is between 90-100 assign A.

2) Sequential category: Prompt user for number and get number from user.

3) Iterative category because it is looping: Repeat steps 3-5 until count equals 10.

4)Conditional category: If divisor equals zero print error.

5) Sequential category.

What is picture ..............​

Answers

Answer:

In its most general sense, a picture is a visual representation of something, especially in the form of a painting, drawing, photograph, or the like. A picture can also refer to a mental image, among other senses.

Consider the following code: x = 9 y = -3 z = 2 print ((x + y) * z) What is output?

Answers

The answer will be 3

The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC value is either the next sequential microcode instruction in the control store (PROM), or a microcode instruction in the control store pointed to by the ADDR bits in the current executing microinstruction. What part of the current executing microcode instruction determines the value placed in the MPC

Answers

Answer:

MAR bit

Explanation:

The MPC computers area set of software and hardware standards that was developed by the consortium of computer firms which is led by Microsoft. It contains the address of a next microcode for the Mic1 emulator foe execution.

The part of the executing microcode instruction that determines the value which is placed in the MOC is the MAR bit. The MAR is the memory address register in the CPU which stores the memory address or such addresses to which some data will be sent and also stored.

What will happen if there is no reply to the email confirmation?

A.The account will not be activated
B.The account will be Activated
C.The screen will display the message registration form available
D. The screen will display the message registration form unavailable

Answers

Answer:

A. the account will not be activated

What is output given the user input? >three blind mice System.out.print("Enter info: "); Scanner keyboard = new Scanner(System.in); String info = keyboard.nextLine(); Scanner inputScnr = new Scanner(info); int item1 = inputScnr.nextInt(); String item2 = inputScnr.next(); String item3 = inputScnr.next(); System.out.println(item1 + " " + item2 + " " + item1); A. blind mice3 B. 3 mice C. 3 blind miceD. Error: input mismatch exception

Answers

Answer:

Probably would be D.

In the print statement...

System.out.println(item1 + " " + item2 + " " + item1)

this would mean the pattern of the output is "ABA". There is no answer that matches that pattern.

We would see a number at the start, something in the middle and then the number again at the end. Because this is not an option in our answers, by process of elimination, we can determine that the only answer which must be correct is D.

Somewhere along there is also input mismatch exception apparently.

Which of the following parameters is optional sample(a,b,c,d=7

Answers

Parameter D is Optional as it is already assigned to an integer value: 7.

The optional Parameter is D as it is said to be assigned  an integer value of 7.

What are optional parameters?

This is known to be a process  that  is made up of optional choices that one do  not need to push or force so as to pass arguments at their set time.

Note that The optional Parameter is D as it is said to be assigned  an integer value of: 7 because it implies that one can use the call method without pushing the arguments.

Learn more about Parameter from

https://brainly.com/question/13151723

#SPJ2

3 uses of Microsoft word in hospital

Answers

Explanation:

You can write, edit and save text in the program.

A disk has 4000 cylinders, each with 8 tracks of 512 blocks. A seek takes 1 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e. follow one another in the file) will require an average seek, which takes 5 msec. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders and the seek time reduced to 100 microsec. How long does it take to read a 100 block file in both cases, if the rotational latency is 10 msec and the transfer time is 20 microsec per block

Answers

Answer:

The answer is below

Explanation:

a)

If the blocks of a file are not put together, that is for nonadjacent block of files to each other, the time (t) taken to read a 100 block file is:

t = (average seek + rotational latency + transfer time) * 100 block

Average seek = 5 msec, rotational latency = 10 msec and transfer time = 20 microsec = 0.02 msec

t = (5 + 10 + 0.02) * 100 = 1502 msec

b)

If the blocks of a file are put together, that is for adjacent block of files to each other, the time (t) taken to read a 100 block file is:

t = (seek time * mean interblock distance + rotational latency + transfer time) * 100 block

seek time = 100 microsec = 0.1 msec, rotational latency = 10 msec and transfer time = 20 microsec = 0.02 msec, mean interblock distance = 2 cylinders

t = (0.1*2 + 10 + 0.02) * 100 = 1022 msec

Draw the Abstract Syntax Trees for the following statements and represent them in text form. i) 1+2+3 ii) 6÷3×4+3

Answers

Answer:

your a legend you can do it just pleave

Explanation:

:)

Which component of an email gives the recipient an idea of the email’s purpose and urgency?

A.
signature
B.
salutation
C.
CC and BCC
D.
subject line

Answers

Answer:

subject line

Explanation:

it is a brief description of what the email subject is.

, ¿hacia dónde crees que va el hombre en su afán permanente de mejorar e innovar? ¿será que mejora nuestra condición humana, o será que nos deshumaniza?

Answers

Responder:

Por favor, consulte la explicación.

Explicación:

La pregunta aquí puede verse desde una perspectiva diferente basada en la noción individual. Desde mi propia perspectiva, el deseo de innovar es algo que debe promoverse por varias razones que incluyen; Evitar el estancamiento, impulsar la economía y el comercio, promover la relajación y reducir el estrés humano, entre otros. Sin embargo, la innovación ha visto realmente un aumento drástico en el nivel de automatización utilizando varias herramientas tecnológicas como la inteligencia artificial, el aprendizaje automático, Internet de las cosas, etc., lo que ha provocado una predicción generalizada de que la demanda de humanos se reducirá. Desde mi propio punto de vista, los humanos crearon y programaron estos sistemas y creo que es hora de que más humanos se vuelvan cada vez más conocedores de la tecnología, ya que este aumento en la capacidad innovadora ha ayudado a multiplicar el número y la velocidad a la que se están resolviendo los problemas. Por tanto, creo que el deseo humano de innovar mejora nuestra condición humana.

Open excel program then use the (IF) function to fill the column of (Expensive/Cheap) then save your

I need help in this computer homework send me it as excel

Answers

Answer:

(7,6)12>34=Mc²

Explanation:

AB

MA

B

F

с

AAB=BC,AM=MC

BM IAC , EF I BC

__________ type of storage is very popular to store music, video and computer programs.
i am doing my homework plzz fast​

Answers

Answer:

Optical storage devices.

Explanation:

Optical storage device are those devices that read and store data using laser. To store data in optical storage devices low-power laser beams are used. It is a type of storage that stores data in an optical readability medium.

Examples of the optical storage device includes Compact disc (CD) and DVD.

The optical storage device is popular in storing data of music, videos, and computer program. Therefore, the optical storage device is the correct  answer.

# 1) Complete the function to return the result of the conversion
def convert_distance(miles):
km = miles * 1.6 # approximately 1.6 km in 1 mile

my_trip_miles = 55

# 2) Convert my_trip_miles to kilometers by calling the function above
my_trip_km = ___

# 3) Fill in the blank to print the result of the conversion
print("The distance in kilometers is " + ___)

# 4) Calculate the round-trip in kilometers by doubling the result,
# and fill in the blank to print the result
print("The round-trip in kilometers is " + ___)

Answers

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)          return km

 

return km returns the result of the computation

2)  = convert_distance(my_trip_miles)

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + str(my_trip_km)

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

Computer programming

Answers

Here is the answer for the question

what is secondary memory?

Answers

Answer:

Secondary memory refers to storage devices, such as hard drives and solid state drives. It may also refer to removable storage media, such as USB flash drives, CDs, and DVDs. ... Additionally, secondary memory is non-volatile, meaning it retains its data with or without electrical power.

1
Select the correct answer from each drop-down menu.
What Is DHTML?
DHTML Is
It allows you to add functionality such as
Reset
Next

Answers

Answer:

DHTML (Dynamic HTML) is a collection of a few different languages

Explanation:

Dynamic HTML is a collection of HTML, DOM, JavaScript, and CSS.

It allows for more customizability than regular HTML. It allows scripts (JavaScript), webpage styling (CSS), manipulation of static objects (DOM), and building of the initial webpage (HTML).

Since the question is incomplete, I'm not really sure what all you need answered - please leave a comment if you would like something else explained. :)

What are recommended CPUs?

Answers

INTEL:

It does vary depending on your PC use, however, for office work, the i5 8th Gen is a recommended CPU as it can handle the requirements for office use without stress. For Gaming and high-end use, the i9 is a recommended CPU as it can handle games easily without stress.

AMD:

AMD Ryzen 3 3300X is good for office work and can handle office scenarios and the AMD Ryzen 7 3800x is good for gaming and high-end use.

Hope this helps,

Azumayay

What may make it easy for cybercriminals to commit cybercrimes? Select 2 options.

Cybercrimes are not classified as real crimes, only as virtual crimes.

They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

The United States has no law enforcement that acts against them.

Law enforcement agencies lack the expertise to investigate them.

Answers

Answer: They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

Explanation:

edg

Answer:

They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

Explanation:

Computer programming 5

Answers

Good luck this is the last one

You are working for a company that is responsible for determining the winner of a prestigious international event, Men’s Synchronized Swimming. Scoring is done by eleven (11) international judges. They each submit a score in the range from 0 to 100. The highest and lowest scores are not counted. The remaining nine (9) scores are averaged and the median value is also determined. The participating team with the highest average score wins. In case of a tie, the highest median score, among the teams that are tied for first place, determines the winner.
Scoring data is be provided in the form of a text file. The scoring data for each team consists of two lines; the first line contains the team name; the second line contains the eleven (11) scores. You will not know ahead of time how many teams will participant. Your program will:
Prompt the user for the name and location of the scoring data file.
Process the sets of records in the file.
Read and store the team name in a string variable.
Read and store the scores in an array.
Display the team name followed by the complete set of scores on the next line.
Calculate and display to two decimal places the average of the nine qualifying scores, dropping the lowest and highest scores.
Determine and display the median value among the qualifying scores.
Display the count of the number of participating teams.
Display the winning team name and their average score. Indicate if they won by breaking a tie with a higher median score value.
A sample data file has been provided to allow you to test your program before submitting your work. Records in the sample data file look like this:
Sea Turtles
11 34 76 58 32 98 43.5 87 43 23 22
Tiger Sharks
85 55 10 99 35 5 65 75 8 95 22
The Angry Piranhas
30 10 80 0 100 40 60 50 20 90 70
The average score for the Sea Turtles was 46.5. The Angry Piranhas and the Tiger Sharks both had an average score of 50.0. The tiger sharks had a median value of 55.0, making them the winners of the competition.
You will define and use at least one function in your solution. As a suggestion, you should consider calling a function that sorts the array of judge’s score values into ascending order (lowest to highest). The advantage of doing this is that after being sorted, the lowest value is the first entry in your array and the highest value is the last entry in your array.
The average or arithmetic mean is a measure of central tendency. It is a single value that is intended to represent the collection of values. For this problem, you will only use nine of the values to determine the average. You will not include the highest score and the lowest score.
The median is another measure of central tendency. The median is often referred to as the middle value. In a set of values, half the values are less than the median and the other half are greater than the median. In a sorted array of five elements, the median is the third element. There are two values that are less then it and there are two values that are greater than it. In a sorted array of six values, the median is the simple average of the third and fourth values. In some cases, the median is a better representative value than the average.
You are encouraged to read the article entitled "Mixing getline with cin".
To receive full credit for this programming assignment, you must:
Use the correct file name.
Submit a program that executes correctly.
Interact effectively with the user.
Grading Guideline:
Correctly name the file submitted.
Create a comment containing the student’s full name.
Document the program with other meaningful comments.
Prompt the user for a file name and location.
Open, read, and process all the data in the input file.
Store the judge’s scores in an array.
Correctly display the team name and all scores.
Calculate and display the average score correctly.
Calculate and display the median score correctly.
Correctly count and display the number of competing teams.
Correctly determine and display the winning team and score.

Answers

Answer:

my sql

Explanation:

try with mysql

and database build

discuss the term business information SYSTEMS ​

Answers

Answer:

Business information systems provide information that organizations use to manage themselves efficiently and effectively, typically using computer systems and technology. Primary components of business information systems include hardware, software, data, procedures (design, development, and documentation) and people.

Explanation:

Hope It Help you

Write a program that prompts the user to enter two positive integers less than 1,000,000,000 and the program outputs the sum of all the prime numbers between the two integers. Two prime numbers are called twin primes, if the difference between the two primes is 2 or -2. Have the program output all the twin primes and the number of twin primes between the two integers.

Answers

Answer:

In Python:

low = int(input("Low: "))

high = int(input("High: "))

if low >= 1000000000 or high >=1000000000:

   print("Out of range")

else:

   mylist = []

   for num in range(low,high+1):

       flag = False

       if num > 1:

           for i in range(2, num):

               if (num % i) == 0:

                   flag = True

                   break

       if not flag:

           mylist.append(num)

           print(num, end = " ")

   print()

   print("The twin primes are: ",end="")

   count = 0

   for i in range(1,len(mylist)):

       if mylist[i] - mylist[i-1] == 2:

           print(str(mylist[i])+" & "+str(mylist[i-1]),end=", ")

           count+=1

   print()

   print("There are "+str(count)+" twin primes")

Explanation:

See attachment for complete program where comments were used to explain each line

steps on how to install a mouse​

Answers

Answer:

Verify that the mouse you're thinking of purchasing is compatible with your laptop model. ...

Plug the mouse's USB cable into the matching port on the side of your laptop.

Restart your computer while the mouse is connected. ...

Move your mouse a few times to confirm that the cursor responds.

1) Plug in your mouse's receiver.

2) Make sure that your mouse has batteries or is charged.

3) Turn on your mouse.

4) Press your mouse's "Connect" button.

5) Move your mouse around to test the connection.


Hope that helps.

which type of secondary storage has a fast reading access among the secondary storage​

Answers

Answer:

RAM provides much faster accessing speed to data than secondary memory. By loading software programs and required files into primary memory(RAM), computer can process data much more quickly. Secondary Memory is slower in data accessing. Typically primary memory is six times faster than the secondary memory.

What is the full form of 'Rom

Answers

Answer:

Read-only memory

Explanation:

Read-only memory is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device.

A (n) ___ system can help a business alleviate the need for multiple information systems.

Answers

Answer:

Enterprise Resource Planning

Explanation:

ERP

Other Questions
Please help with #19 & #20 really struggling! he temperature at any random location in a kiln used in the manufacture of bricks is normally distributed with a mean of 925 and a standard deviation of 60 degrees. If bricks are fired at a temperature above 1150, they will crack and must be disposed of. If the bricks are placed randomly throughout the kiln, the proportion of bricks that crack during the firing process is closest to Help me please I need this ASAP A car travels a distance of 190 miles in a time of 4.4 hours.What is its average speed rounded to 1dp? A car has moved 6.8 m from when the driver saw the red light to come to a full stop. If the driver was moving with 31.7 m/s when they saw the traffic light, how long did it take forthem to come to stop? John is baking lemon cookies. The recipe calls fora half cup of flour per batch. John uses sevencups of flour. How many batches did John make? Indicate whether the sentence contains an adjective or a noun following the linking verb.The desert is dry.adjective following linking verbnoun following linking verb can someone help me although it alot How does the universe expanding support the Big Bang Theory?A. This piece of evidence indicates that once atoms formed, the first light was carried through space evenlyB. This piece of evidence indicates there was a huge explosion during the first stages of the universe,C. This piece of evidence indicates that the universe formed from hot plasma, forming the simplest and lightest elements firstD. This piece of evidence indicates that the expanding galaxies must have come from a single point. PLEASE HELP ME WITH THIS1.)What did many early American samplers show?pictures without special meaningsscenes from storybooksportraits and decorative scrollsalphabets and numbers2.)Who usually made early American samplers?womenschoolboysmenschoolgirls3.)Which statement about early American furniture is true?Frakturs on furniture were often religious messages or blessings for the home.Decorated pieces of furniture were used for display, not for storage.Chinese and Japanese immigrants made many pieces of decorated furniture.4.)Which statement about limner portraits is true?They were often painted by self-taught artists.Owners used them as signs of military strength.They included objects that tell about the artist.5.)Is this statement true or false?Artists stenciled designs by dabbing or brushing paint through cutout shapes.TrueFalse6.)Is this statement true or false?Stenciling was a very expensive way to decorate walls.TrueFalse7.)Which statement about folk art landscapes is true?They show more details in the background than the foreground.Many folk art landscapes show farm scenes.They are painted by artists trained in art academies. Find the coordinates of the intersection of the diagonals of parallelogram GHJK with vertices G (-2, 3), H (4, 4), J (2, -1), andK(-4, - 2). 5 x +4+=346y+3=458z - 7=5711t-16=392n -6=12+43z+4=22??? If u cant see it can I can post it again Need help pls help me will mark first Jill wants to solve the following system using the elimination method:Y = X + 8y = 3x - 11What number should the equation = x + 8 be multiplied by to eliminate x?3 Write an equation of the line that passes through the point (-4, -4) and is parallel to 2y - x = -6. Solve7 + x/3 = 2x - 5 Read the text and question. Then, choose the correct option that answers the questionAyer, mi tia Paula estaba cocinando y tuvo un incendio en la cocina. Ahora est en el hospital, No tiene heridas, pero tose mucho, le pican los ojos y tiene dolor de cabeza.Based on the text, what most likely affected Paula? (1 point)El aguaEl humoEl huracnEl maremoto 2, 3-diethyl4-octene what is structure of this pls help Mississippi's 1869 election was significant because it was the first toO include election of judges.O elect a Democratic governor.O occur after Mississippi rejoined the Union.O allow freedmen to vote.