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
Air enters a compressor steadily at the ambient conditions of 100 kPa and 22°C and leaves at 800 kPa. Heat is lost from the comp
telo118 [61]

Answer:

a) 358.8K

b) 181.1 kJ/kg.K

c) 0.0068 kJ/kg.K

Explanation:

Given:

P1 = 100kPa

P2= 800kPa

T1 = 22°C = 22+273 = 295K

q_out = 120 kJ/kg

∆S_air = 0.40 kJ/kg.k

T2 =??

a) Using the formula for change in entropy of air, we have:

∆S_air = c_p In \frac{T_2}{T_1} - Rln \frac{P_2}{P_1}

Let's take gas constant, Cp= 1.005 kJ/kg.K and R = 0.287 kJ/kg.K

Solving, we have:

[/tex] -0.40= (1.005)ln\frac{T_2}{295} ln\frac{800}{100}[/tex]

-0.40= 1.005(ln T_2 - 5.68697)- 0.5968

Solving for T2 we have:

T_2 = 5.8828

Taking the exponential on the equation (both sides), we have:

[/tex] T_2 = e^5^.^8^8^2^8 = 358.8K[/tex]

b) Work input to compressor:

w_in = c_p(T_2 - T_1)+q_out

w_in = 1.005(358.8 - 295)+120

= 184.1 kJ/kg

c) Entropy genered during this process, we use the expression;

Egen = ∆Eair + ∆Es

Where; Egen = generated entropy

∆Eair = Entropy change of air in compressor

∆Es = Entropy change in surrounding.

We need to first find ∆Es, since it is unknown.

Therefore ∆Es = \frac{q_out}{T_1}

\frac{120kJ/kg.k}{295K}

∆Es = 0.4068kJ/kg.k

Hence, entropy generated, Egen will be calculated as:

= -0.40 kJ/kg.K + 0.40608kJ/kg.K

= 0.0068kJ/kg.k

3 0
3 years ago
For each resource, list 3 examples of how it would be used to produce a hamburger. Think outside of the “hamburger” box!
Olin [163]

Answer:

love

Explanation: you

/////////////////////

7 0
3 years ago
To revise a monthly budget, changes in which categories might need to be addressed? Check all that apply.
GREYUIT [131]

Income

amount budgeted

expenses

5 0
2 years ago
The depletion in the Ozone layer is caused by:
andrew11 [14]
D. Chlorofluorocarbon

This is a man-made carbon that causes the gradual thinning(deception) in the earth’s Ozone layer.

Hope this helped and pls mark as brainliest!

~ Luna
3 0
2 years ago
Read 2 more answers
What happen to the clutch system when you step-on and releasing the clutch pedal?​
soldi70 [24.7K]

Answer:

Step On: Your foot forces the clutch pedal down and then causes it to take up the slack. This, in turn, causes the clutch friction disk to slip, creating heat and ultimately wearing your clutch out.

Step Off: When the clutch pedal is released, the springs of the pressure plate push the slave cylinder's pushrod back, which forces the hydraulic fluid back into the master cylinder.

7 0
3 years ago
Other questions:
  • If you know that the change in entropy of a system where heat was added is 12 J/K, and that the temperature of the system is 250
    10·1 answer
  • A wastewater treatment plant discharges 1.0 m3/s of effluent having an ultimate BOD of 40.0 mg/ L into a stream flowingat 10.0 m
    11·1 answer
  • A piston-cylinder device contains 0.8 kg of steam at 300°C and 1 MPa. Steam is cooled at constant pressure until one-half of the
    9·1 answer
  • 10. When an adhesion bond is made by melting a filler metal and allowing it to spread into the pores of the
    7·1 answer
  • Burn in hell i watched your stupid video and i still could not get the answer
    14·1 answer
  • assume a five layer network model. There are 700 bytes of application data. There is a 20 bye header at the transport layer, a 2
    5·1 answer
  • Mining is an example of this type of business
    7·1 answer
  • Steam at 1400 kPa and 350°C [state 1] enters a turbine through a pipe that is 8 cm in diameter, at a mass flow rate of 0.1 kg⋅s−
    15·1 answer
  • 5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
    6·1 answer
  • ​please how to drawing mechanical drawing after connecting the all parts thanks
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!