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
bekas [8.4K]
3 years ago
6

Find the largest number. The process of finding the maximum value (i.e., the largest of a group of values) is used frequently in

computer applications. For example, an app that determines the winner of a sales contest would input the number of units sold by each salesperson. The sales person who sells the most units wins the contest. Write pseudocode, then a C# app that inputs a series of 10 integers, then determines and displays the largest integer. Your app should use at least the following three variables:
Counter: Acounter to count to 10 (i.e., to keep track of how many nimbers have been input and to determine when all 10 numbers have been processed).
Number: The integer most recently input by the user.
Largest: The largest number found so far.
Engineering
1 answer:
salantis [7]3 years ago
8 0

Answer:

See Explanation

Explanation:

Required

- Pseudocode to determine the largest of 10 numbers

- C# program to determine the largest of 10 numbers

The pseudocode and program makes use of a 1 dimensional array to accept input for the 10 numbers;

The largest of the 10 numbers is then saved in variable Largest and printed afterwards.

Pseudocode (Number lines are used for indentation to illustrate the program flow)

1. Start:

2. Declare Number as 1 dimensional array of 10 integers

3. Initialize: counter = 0

4. Do:

4.1 Display “Enter Number ”+(counter + 1)

4.2 Accept input for Number[counter]

4.3 While counter < 10

5. Initialize: Largest = Number[0]

6. Loop: i = 0 to 10

6.1 if Largest < Number[i] Then

6.2 Largest = Number[i]

6.3 End Loop:

7. Display “The largest input is “+Largest

8. Stop

C# Program (Console)

Comments are used for explanatory purpose

using System;

namespace ConsoleApplication1

{

   class Program

   {

       static void Main(string[] args)

       {

           int[] Number = new int[10];  // Declare array of 10 elements

           //Accept Input

           int counter = 0;

           while(counter<10)

           {

               Console.WriteLine("Enter Number " + (counter + 1)+": ");

               string var = Console.ReadLine();

               Number[counter] = Convert.ToInt32(var);

               counter++;                  

           }

           //Initialize largest to first element of the array

           int Largest = Number[0];

           //Determine Largest

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

           {

               if(Largest < Number[i])

               {

                   Largest = Number[i];

               }

           }

           //Print Largest

           Console.WriteLine("The largest input is "+ Largest);

           Console.ReadLine();

       }

   }

}

You might be interested in
An old refrigerator consumes 247 W of power. Assuming that the refrigerator operates for 19 hours everyday, what is the annual o
german

Answer:

The annual operating cost of the refrigerator is $102.78.

Explanation:

Power consumed by the refrigerator = 247 W = 247/1000 = 0.247 kW

Daily operation of the refrigerator = 19 hours

Annual operation of the refrigerator = 365 × 19 = 6,935 hours

Annual energy consumed = 0.247 kW × 6,935 hours = 1712.945 kWh

1 kWh of electricity cost $0.06

1712.945 kWh will cost 1712.945 × $0.06 = $102.78

Annual operating cost = $102.78

6 0
3 years ago
Read 2 more answers
What are difference between conic sectional and solids?
Murljashka [212]

Answer:

Conic Sections

a conic section is a curve which is obtained when a surface performs an intersection with a plane. The types of conic sections include hyperbola, parabola and ellipse. A circle can also be considered as a conic section.

Conic Solids on the other hand are the set of points on any segment between a region and a point which is not present in the plane of the base. They are solids with one base.

3 0
3 years ago
Lynx eat snowshoe hares, and snowshoes hears eat plants. Which term can be applied to the lynx in this food chain example? Prima
erastova [34]

Answer:

primary consumer because YES

3 0
2 years ago
Compare a series circuit powered by six 1.5-volt batteries to a series circuit powered by a single 9-volt battery. Make sure the
lana [24]

Answer:

Both series circuits provide a total voltage of 9 volts to the two bulbs connected in series and the voltage will be equally divided among two bulbs and they will have same brightness. Therefore, both circuits will have same characteristics.

Explanation:

We are asked to compare two series circuits having equal number of light bulbs.

1st circuit is powered by 6 batteries each having a voltage of 1.5V

2nd circuit is powered by a single battery having a voltage of 9V.

The six batteries in the 1st circuit can be connected together in series or in parallel.

When the batteries are connected in series (positive terminal of one battery connected to negative terminal of another battery) their voltage gets added which means

Voltage of pack = number of batteries*voltage of each battery

Voltage of pack = 6*1.5

Voltage of pack = 9 volts

But the current remains same in the series connection since there is only path for the current to flow.

On the other hand, when the batteries are connected in parallel, the voltage remains same but the current increases.

Circuit 1:

In this circuit, we have 6 batteries each of 1.5 volts connected in series to provide a voltage of 9 volts.

We have connected 2 bulbs in this series circuit.

The voltage will be equally divided between two bulbs if both bulbs are identical in construction.

So there will be 4.5 volts across each bulb and both bulbs will have same brightness.

Circuit 2:

In this circuit, we have 1 battery which provide a voltage of 9 volts.

We have connected 2 bulbs in this series circuit just like in circuit 1.

The voltage will be equally divided between two bulbs if both bulbs are identical in construction.

So there will be 4.5 volts across each bulb and both bulbs will have same brightness.

Conclusion:

Both series circuits provide a total voltage of 9 volts to the two bulbs connected in series and the voltage will be equally divided among two bulbs and they will have same brightness. Therefore, both circuits will have same characteristics.

3 0
3 years ago
What is a combination circuit? A combination circuit:
Anon25 [30]

Answer:

Combination circuit; The basic strategy for the analysis of combination circuits involves using the meaning of equivalent resistance for parallel branches to transform the combination circuit into a series circuit.

Example:

The use of both series and parallel connections within the same circuit. In this case, light bulbs A and B are connected by parallel connections and light bulbs C and D are connected by series connections. This is an example of a combination circuit.

7 0
3 years ago
Other questions:
  • More discussion about seriesConnect(Ohm) function In your main(), first, construct the first circuit object, called ckt1, using
    10·1 answer
  • Talc and graphite are two of the lowest minerals on the hardness scale. They are also described by terms like greasy or soapy. B
    14·1 answer
  • Fuel Combustion and CO2 Sequestration [2016 Midterm Problem] Long-term storage of carbon dioxide in underground aquifers or old
    5·1 answer
  • At the instant shown car A is travelling with a velocity of 24 m/s and which is decreasing at 4 m/s2 along the highway. At the s
    14·1 answer
  • 5. The pin support at A allows _______. Select the one that applies. (a) displacement in the x direction (b) rotation about its
    15·1 answer
  • WHAT IS MEANT BY BJT AND FUNCTION OF BJT
    8·1 answer
  • Select the correct answer.
    6·1 answer
  • How do i play Fortnite on controller?
    6·2 answers
  • Technician A says that to depressurize high-pressure components of the electronic brake control (EBC) system, research the proce
    13·1 answer
  • a storage tank contains liquid with a density of 0.0361 lbs per cubic inch. the height of liquid in the tank is 168 feet. what i
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!