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
A soil weighs 2,520 lbs/CY in its in situ condition, 1,970 lb/CY in its loose condition after excavation, and 3,025 lbs/CY in an
azamat

Answer:

load factor = 0.782

Shrink Factor = 0.833

no of truck is  62500

Explanation:

given data

soil weighs in situ condition  =  2,520 lbs/CY

soil weighs in loose condition  =  1,970 lb/CY

soil weighs in embanked state = 3,025 lbs/CY

average volume = 16 LCY

soil from a borrow pit = 1 million CCY

solution

first we get here Load Factor that is express as

load factor = \frac{1,970}{2550}

load factor = 0.782

and Shrink Factor will be as

Shrink Factor = \frac{2520}{3025}

Shrink Factor = 0.833

and

no of truck will be

no of truck = \frac{1000000}{16}

no of truck is  62500

6 0
3 years ago
Which of the following is an example of a civil engineer demonstrating problem sensitivity? (Select all that apply.)
zaharov [31]

Answer:

all of the above hidtsybkhitonp

Explanation:

nyppinnoxtstuity433ongdhfkgt

8 0
3 years ago
Write a program to control the operation of the RED/GREEN/BLUE LED (LED2) as follows: 1. If no button is pressed, the LED should
aalyn [17]

Answer:

See explaination

Explanation:

int RED=10; int BLUE=11; int GREEN=12; int BUTTON1=8; int BUTTON2=9; void setup() { pinMode(RED, OUTPUT); pinMode(BLUE, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BUTTON1, INPUT); pinMode(BUTTON2, OUTPUT); } void loop() { int BTN1_STATE=digitalRead(BUTTON1); int BTN2_STATE=digitalRead(BUTTON2); if(BTN1_STATE==HIGH) { digitalWrite(BLUE, HIGH); delay(1000); // Wait for 1 second digitalWrite(BLUE, LOW); } if(BTN2_STATE==HIGH) { digitalWrite(RED, HIGH); delay(4000); // Wait for 4 seconds digitalWrite(RED, LOW); } if(BTN1_STATE==HIGH && BTN2_STATE==HIGH) { digitalWrite(GREEN, HIGH); delay(2000); // Wait for 2 second digitalWrite(GREEN, LOW); } }

4 0
3 years ago
In urban area you can except
liberstina [14]

Answer:

eoidnfoejsdncodsnc

Explanation:

dfdjsncojnsdjcnsdojnvjsdvkjsdkjvnsdjvnskjnvkjdvkjnsdcjndkjndskjndskjndskjnsdvkjnvsdkjvsdkjnvskdjnvkjdsvkjsdnvkjsdnkjsvnkj

5 0
3 years ago
Why do cars have a push start button???​
QveST [7]
To be more easy for them
8 0
3 years ago
Other questions:
  • REM rebound involves the A) tendency for REM sleep periods to become increasingly longer and more frequent as a normal night of
    15·1 answer
  • Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands coul
    6·1 answer
  • Define the terms marker
    10·1 answer
  • Your application must generate: - an array of thirteen random integers from 1-99, - then prompt the user to select a sorting opt
    11·1 answer
  • 3 If, for a particular junction, the acceptor concentration is 1017/cm3 and the donor concentration is 1016/cm3 , find the junct
    6·1 answer
  • Con una tasa de interés de 8% por año, ¿a cuánto equivalen $10 000 de hoy, a) dentro de un año, y b) hace un año?
    6·1 answer
  • If aligned and continuous carbon fibers with a diameter of 9.90 micron are embedded within an epoxy, such that the bond strength
    11·1 answer
  • HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    11·1 answer
  • Driving alone without the distraction from passengers reduces the risks you face in driving.
    15·1 answer
  • A sprinter reaches his maximum speed in 2.5sec from rest with constant acceleration. He then maintains that speed and finishes t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!