Write a program that will: 1. Call a function to input temperatures for consecutive days in an array. The temperatures are to be integer numbers. 2. The user will input the number of temperatures. There will be no more than 10 temperatures. 3. Call a function to sort the array by ascending order. You can use any sorting algorithm you wish as long as you can explain it. 4. Call a function that will return the average of the temperatures. The average should be displayed to two decimal places.

Answers

Answer 1

Answer:

Following are the program to the given question:

#include<iostream>//defining header file  

using namespace std;

float temperatures()//defining a method temperatures

{

int a[10],i,j,n,min,max,sum=0,temp;//defining integer variable

float avg;//defining floating point variable

cout<<"Please input the number of temperatures to be read: ";//print message

cin>>n;//input integer value

if(i>10)//use if to check array length greater than 10

return -1;//return integer value -1

for(j=0;j<n;j++)//defining loop to input value

{

cout<<"Input temperature: "<<endl;//print message

cin>>a[j];//holding value in loop

}

for(i=0;i<n-1;i++)//defining loop to compare array value

{

for(j=i+1;j<n-1;j++)//defining loop to compare array value

{

if(a[i]>a[j])//use if to compare array values

{

   //swapping

temp=a[j];//holding array value in temp

a[j]=a[i];//holding value in first index of array  

a[i]=temp;//holding temp value

}

}

}

max=min=a[0];//holding max value  

for (i = 0; i < n; i++)//defining loop to compare array value

{

if (a[i] > max)//use if to compare max array value

{

max = a[i];//holding max array value

}

else if (a[i] < min)//use else if to compare min array value

{

min = a[i];//holding min array value

}

}

for(i=0;i<n;i++)//use loop to add array value

sum=sum+a[i];//adding array value

avg=(float) sum/n;//calculating avg of the array

std::cout.setf(std::ios::fixed);//using namespace

std::cout.precision(2);//using precision method

cout<<"The average temperature is: "<<avg<<endl;//print avg value with message

cout<<"The highest temperature is: "<<max<<endl;//print max value with message

cout<<"The lowest temperature is: "<<min<<endl;//print min value with message

return avg;//return avg value

}

int main()//defining main method

{

float k;//defining float variable

k=temperatures();//calling method  

}

Output:

Please find the attached file.

Explanation:

In this code, a method "temperatures" is declared that defines the integer and float variable in which "n, array" is used to store the array value and inside the method min and max variable is declared that use the conditional statement to store its value.

Outside the main method, a floating-point variable "k" is declared that calls the method and stores its value.  

Write A Program That Will: 1. Call A Function To Input Temperatures For Consecutive Days In An Array.

Related Questions

Explain why Thompson's Construction Algorithm is considered to be a proof by induction. Hint: consider what the inductive steps and base cases are. What does Thompson's Construction Algorithm prove

Answers

Answer:

We assume that the NFA for the expression S is theorem by using the expressions given below.

Cases as

NFA for empty-expression is ε NFA for symbol is a  NFA for union expression is a|b NFA for concatenation expression is ab NFA for Kleene star expression is a*

Thompson's Construction Algorithm proves that any expression can be expressions in the NFA's.

_ is a term used for license like those issues by creative commons license as an alternative to copyright

Answers

, . , .

Explanation:

'

Used for monitoring web activity by users to make sure that sensitive information won't leave the building.

A, Web server
B, FTP server
C, POP server
D, Proxy server ​

Answers

Answer: PROXY

Explanation:

The basic objective of the web server is to store, process and deliver web pages to the users.

FTP server is to allow users to upload and download files. An FTP server is a computer that has a file transfer protocol (FTP) address and is dedicated to receiving an FTP connection. FTP is a protocol used to transfer files via the internet between a server (sender) and a client (receiver)

pop provides access via an Internet Protocol (IP) network for a user client application to a mailbox (maildrop) maintained on a mail server

proxy server is a system that isolates internal clients from the servers by downloading and storing files on behalf of the clients. it intercepts requests for web-based or other resources that come from

Write an algorithm that accepts two numbers,
divide the first number by the second and display the
quotient

Answers

Let’s write the algorithm in the form of a pseudocode!

Pseudocode:Quotient_of_Two_Number
Declare: num1, num2, quotient
START
Display (Enter a number)
Read num1
Display (Enter a number)
Read num2
quotient = num1/num2
Print (“Quotient”)
STOP

What is computer code?
A. Java Script
B. XML
C. HTML
D. Any programming language

Answers

Answer:

D

Explanation:

Write an application that inputs a five digit integer (The number must be entered only as ONE input) and separates the number into its individual digits using MOD, and prints the digits separated from one another. Your code will do INPUT VALIDATION and warn the user to enter the correct number of digits and let the user run your code as many times as they want (LOOP). Submit two different versions: Using the Scanner class (file name: ScanP2)

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 int n, num;

 Scanner input = new Scanner(System.in);

 System.out.print("Number of inputs: ");

 n = input.nextInt();

 LinkedList<Integer> myList = new LinkedList<Integer>();

 for(int i = 0; i<n;i++){

     System.out.print("Input Integer: ");

     num = input.nextInt();

     while (num > 0) {

     myList.push( num % 10 );

     num/=10;

     }

     while (!myList.isEmpty()) {

         System.out.print(myList.pop()+" ");

     }

     System.out.println();

     myList.clear();

 }

}

}

Explanation:

This declares the number of inputs (n) and each input (num) as integer

 int n, num;

 Scanner input = new Scanner(System.in);

Prompt for number of inputs

 System.out.print("Number of inputs: ");   n = input.nextInt();

The program uses linkedlist to store individual digits. This declares the linkedlist

 LinkedList<Integer> myList = new LinkedList<Integer>();

This iterates through n

 for(int i = 0; i<n;i++){

Prompt for input

     System.out.print("Input Integer: ");

This gets input for each iteration

     num = input.nextInt();

This while loop is repeated until the digits are completely split

     while (num > 0) {

This adds each digit to the linked list

     myList.push( num % 10 );

This gets the other digits

     num/=10;

     }

The inner while loop ends here

This iterates through the linked list

     while (!myList.isEmpty()) {

This pops out every element of thelist

         System.out.print(myList.pop()+" ");

     }

Print a new line

     System.out.println();

This clears the stack

     myList.clear();

 }

Frames control what displays on the Stage, while keyframes help to set up

Answers

Answer: A keyframe is a location on a timeline which marks the beginning or end of a transition. So for example, you have a movie and it transitions to another scene, keyframes tell it when and where to start the transition then when and where to stop the transition.

A capacitor of capacitance 102/π µF is connected across a 220 V, 50 Hz A.C. mains. Calculate the capacitive reactance, RMS value of current and write down the equations of voltage and current.

Answers

Answer:

The capacitive reactance will be "100Ω" and RMS value of current is "2.2 A". A further explanation is provided below.

Explanation:

Given:

[tex]C =\frac{10^2}{\pi}\times 10^{-6} \ F[/tex]

[tex]V_{RMS}=220 \ V[/tex]

[tex]f = 50 \ Hz[/tex]

Now,

The capacitive reactance will be:

⇒ [tex]X_c=\frac{1}{\omega C} =\frac{1}{2 \pi f C}[/tex]

                   [tex]=\frac{1}{2\times \pi\times 50\times \frac{10^{-4}}{\pi} }[/tex]

                   [tex]=100 \ \Omega[/tex]

RMS value of current will be:

⇒ [tex]I_{RMS}=\frac{V_{RMS}}{X_c}[/tex]

             [tex]=\frac{220}{100}[/tex]

             [tex]=2.2 \ A[/tex]

So that,

⇒ [tex]V_m=220\times \sqrt{2}[/tex]

         [tex]=311 \ V[/tex]

⇒ [tex]I_m=2.2\times \sqrt{2}[/tex]

         [tex]=3.1 \ A[/tex]

hence,

The equation will be:

⇒ [tex]\nu=311 sin31 \ 4t[/tex]

and,

⇒ [tex]i=3.1 sin(314t+\frac{\pi}{2} )[/tex]

What does the abbreviation BBC stands for?

Answers

Answer:

British Broadcasting Corporation Microcomputer System

Explanation:

The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by the Acorn Computer company in the 1980s for the BBC Computer Literacy Project.

Answer:

British Broadcasting Corporation

Explanation:

This is a UK company which provides television and radio news in over 40 languages. This is the computer related meaning, there are other meanings to the abbreviation but they seem irrelevant in this case.

Hope this information was of any help to you. (:

how to make an app according to peoples will

Answers

Answer:

Follow these steps to create your own app:

1)Choose your app name.

2)Select a color scheme.

3)Customize your app design.

4)Choose the right test device.

5)Install the app on your device.

6)Add the features you want (Key Section)

7)Test, test, and test before the launch.

8)Publish your app.

Explanation:

(!!_!!)

Other Questions
Is each statement true for OA? Drag true or false below each statement Which of the following correctly maps figure ABCD onto figure EFGH? Select two that apply. Mosa and her team find out that all the receivers in North America have moved west about an inch. What does this prove? show using dots to illustrate high population density and low population density in the boxes provided in answer to guide questions NEED HELP ASAP!!use the vertical line test to determine if the relation whose graph is provided is a function(graph and answers pictured) WHATS THE ANSWER ????? the value of each square root Please help i'm struggling with this! Suppose the population of a small town is 567 in 2011. The population DECREASES at arate of 5% every year. What will be the population of the town in 2021? Round your answerto the nearest whole number. Who became the emperor/leader of Japan after the emperor Go- Daigo was defeated during the Japanese civil war?A- Kublai Khan B- Ashi Hoto C- AshikaganD- Hirohito Ponds and lakes are part of marine ecosystem.True or false ? Marcus is testing a hair sample from the telogen stage. What is likely to be TRUE about this sample? A. There will be several medullas present. B. There will be mitochondrial DNA present. C. There will be nuclear DNA present. D. There will be very little DNA present. Please help!How did the narrator feel when he heard the strange cries, saw the wild eyes, and heard the growl from the side of the canal? Use evidence from the story to support your answer.Why wont the narrator return to Xochimilco, even though the canals are safe again? Use evidence from the text to support your answer.(passage: page 7, questions: page 11) What is the value of the expression 3^2 . (2^3 +4) _____________ 2^2 Who has the most blue sweets?chris 1/2sam 1/4raj 3/4jade 1/3 PLEASE HELPLibby flips a quarter 2 times in a row.What is the probability of the quarter landing on heads at least 1 time?A. 1/4B. 1/3C. 3/4D. 1/2 How does the cause-and-effect structure support the author's viewpoint that the United States has a false sense of isolation? write an essay on the effects of flood in nepal in about 150 words. A rectangle has a length of 9 mm. A similar rectangle is drawn using a scale of 1:3. What is the length of the second rectangle? Consider the following data. 15,4,10,8,14,10,2,11Step 1 of 3: Determine the mean of the given dataStep 2 of 3: Determine the median of the given data.Step 3 of 3: Determine if the data set is unimodal, bimodal, multimodal, or has no mode. Identify the mode(s), if any exist.