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 organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been a
AnnZ [28]

Answer:

Web application Firewall (WAF)

Explanation:

The Web application Firewall (WAF) will be recommended. This will enormously help any organisation that is having a struggle of differentiating threats from normal traffic and access to systems.

WAF is also going to It aggregate data and provide metrics that will assist in identifying malicious actors. Another vital function of WAF will be to block unwanted web traffic from accessing your site. It will protect against hacks, brute force attacks, DDoS attacks, cross-site scripting, SQL injection, and zero-day exploits.

8 0
4 years ago
What does Clay say will happen if the system is rejected?
juin [17]

Answer:

the nation will suffer terrible consequences

Explanation:

I did that and got it right

6 0
3 years ago
Read 2 more answers
A structural element for a new bridge is designed for a constant load of 1000 psi. Its mean resistance is 1200 psi and the proba
andrew11 [14]

Answer:

i) SF = 0.83

ii) 10 psi

iii) 3.16 psi

iv) 0.0083

Explanation:

Constant load = 1000 Psi

mean resistance = 1200 psi

Probability of failure = 1.9 * 10^-3

<u>Determine </u>

<u>i) Safety factor </u>

S.F =  1 / (mean load / load design ) = 1 / ( 1200 / 1000 ) = 0.83

<u>ii) Standard deviation </u>

1.9 X 10^-3 = e  ( -1/2 ( μ / б) ^3  /  (2.5 * 6  )

0.004756 = e^- 20000 / б^3

hence std = 10 psi

<u>iii) Variance </u>

= \sqrt{10} = 3.16 psi

<u>iv) coefficient of variation </u>

Cv = std / mean resistance

    = 10 / 1200 = 0.0083

<u />

4 0
3 years ago
One of the best methods for understanding a company’s policies and procedures is
11Alexandr11 [23.1K]

Answer:

Usually a handbook or website

7 0
3 years ago
How are the particles moving and and arranged in a gas?
alexandr402 [8]

Answer:

The particles in gas do not have any particular arrangement and there are very, very weak forces between them. So, the particles in a gas can easily move around and fill the shape of the container they are in, meaning they have no fixed shape.

7 0
3 years ago
Other questions:
  • To reduce the drag coefficient and thus improve the fuel efficiency of cars,the design of side rearview mirrors has changed dram
    11·1 answer
  • What is the average linear (seepage) velocity of water in an aquifer with a hydraulic conductivity of 6.9 x 10-4 m/s and porosit
    13·1 answer
  • What is an air mass?​
    5·2 answers
  • What is the multiplicity of the root x = -4?
    14·1 answer
  • A schizophrenic disorder is characterized mostly by disturbed __________, while a mood disorder is characterized mostly by distu
    6·2 answers
  • Which option distinguishes the step in the engineering design phase described in the following scenario?
    8·1 answer
  • (D)<br> 13. Describe the differences between an impact socket and a conventional socket.
    6·1 answer
  • What is the number model for three families live in the same apartment
    8·2 answers
  • When operating a crane, which of the following is an important safety precaution? Select all that apply.
    8·1 answer
  • Phosphorus and nitrogen are included in which category of water pollutants?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!