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
vredina [299]
3 years ago
11

Create a program to determine the largest and smallest number out of 15 numbers entered (numbers entered one at a time). This sh

ould be done in a function using this prototype: double larger (double x, double y); Make sure you use a for loop expression inside your function. Enter 15 numbers 11 67 99 2 2 6 8 9 25 67 7 55 27 1 1 The largest number is 99
Computers and Technology
1 answer:
Shkiper50 [21]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

double larger( double x, double y){

   if (x > y){

       return x;

   } else{

       return y;

   }

}

int main(){

   int n, max = 0;

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

       cout<< "Enter item"<< i+1 << ": ";

       cin>> n;

       cout<< "\n";

       max = larger( n, max);

   }

   cout<<"The maximum number is: "<< max;

   return 0;

}

Explanation:

The C++ program defines the function 'larger' that compares and returns the largest of two numbers. The main program prompts the user for 15 numbers and the larger function is called to return the largest of the fifteen numbers given.

You might be interested in
Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
KiRa [710]

Answer:

{"double", "char", "char", "double"} will be stored in word.

Explanation:

Given the word is an array of four strings,  {"algorithm", "boolean", "char", "double"}. Hence, the length of the word array is 4.

The for-loop will only run for two iterations due to i < word.length/2, with i = 0 (first loop) and i = 1 (second loop).

In the first loop,  

  • word[word.length - 1 - i]  =  word[4 - 1 - 0]  = word[3]  = "double"
  • Hence, the string "double" will be assigned to word[0] and overwrite "algorithm"

In the second loop,

  • word[word.length - 1 - i]  =  word[4 - 1 - 1]  = word[2]  = "char"
  • Hence, the string "char" will be assigned to word[1] and overwrite "boolean"

At last, the word array will hold {"double", "char", "char", "double"}

8 0
4 years ago
Read 2 more answers
Your son is complaining that his smartphone is broken. He tells you that he cannot connect to the internet, nor can he make or r
ycow [4]

Answer:

the correct and only reasonable answer is option B

3 0
2 years ago
A _____ movement tries to improve a part of society, usually through legal methods.
arlik [135]

Answer:

Don’t know lol but look it up on g00gle and she will have the answr

Explanation:

3 0
3 years ago
Read 2 more answers
Pls help me pls I’m struggling
evablogger [386]

Answer:Turn Right () Degrees (block)

The turn right () degrees block is a Motion block and a stack block. The block turns its sprite's direction the specified amount of degrees clockwise.

6 0
3 years ago
AYUDAAA..... DARÉ TODOS LOS PUNTOS QUE PUEDA.
Eddi Din [679]

Answer:

HELP ... I WILL GIVE ALL THE POINTS IT CAN.

THE QUESTIONS ARE:

1. ACCORDING TO THE SUBCLASSIFICATION OF EACH WEB SITE AS YOU WOULD DEFINE THE TYPES OF THE WEBSITE.

2. WHAT IS THE DIFFERENCE BETWEEN EACH SUBCLASSIFICATION OF THE WEBSITES

3. LIST EXAMPLES OF EACH SUBDIVISION

THE SUBCLASSIFICATIONS IN QUESTION ARE: SITE BY HEARING, BY DYNAMISM BY OPENING, BY DEPTH AND BY OBJECTIVE

Explanation:

What is the question needed to be answered?

3 0
3 years ago
Other questions:
  • How has the development of personal computer hardware and software reversed some of the trends brought on by the industrial revo
    15·1 answer
  • Customer A with a Bronze service level package calls in a Critical System Failure at 9:00 AM. Customer B with a Silver service l
    15·1 answer
  • Use the SAS dataset insure to create a dataset, work.insure10, that (a) only reads in the variables Name, Policy, Company, PctIn
    9·1 answer
  • If you want to adjust the width of a column manually, move your mouse over the _______ column boundary and click and drag until
    9·1 answer
  • All systems have ___________.
    9·2 answers
  • Which scenario could be represented by the given graph?
    14·1 answer
  • The security administrator for Corp.com wants to provide wireless access for employees as well as guests. Multiple wireless acce
    13·2 answers
  • The following shared data structures must be declared as global variables such that they are shared by all threads
    7·1 answer
  • What is added to brining liquid to add flavour​
    6·1 answer
  • The. Model has the disadvantage of high project cost due to creation several prototypes
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!