answer.
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]
2 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]2 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
Consider the following class definitions: class smart class superSmart: public smart { { public: public: void print() const; voi
arsen [322]

Answer:

a) There is no any private member of smart which are public members of superSmart.

Explanation:

5 0
2 years ago
thermal energy is being added to steam at 475.8 kPa and 75% quality. determine the amount of thermal energy to be added to creat
eduard

Answer:

q_{in} = 528.6\,\frac{kJ}{kg}

Explanation:

Let assume that heating process occurs at constant pressure, the phenomenon is modelled by the use of the First Law of Thermodynamics:

q_{in} = h_{g} - h_{mix}

The specific enthalpies are:

Liquid-Vapor Mixture:

h_{mix} = 2217.2\,\frac{kJ}{kg}

Saturated Vapor:

h_{g} = 2745.8\,\frac{kJ}{kg}

The thermal energy per unit mass required to heat the steam is:

q_{in} = 2745.8\,\frac{kJ}{kg} - 2217.2\,\frac{kJ}{kg}

q_{in} = 528.6\,\frac{kJ}{kg}

7 0
2 years ago
Toeboards are usually ___ inches high and used on landings and balconies.
Ksju [112]

Answer:4 inches

Explanation:

Google told me

6 0
2 years ago
A curve in a speed track has a radius of 1000 ft and a rated speed of 120 mi/h. (From Sample Prob. 12.7 is the definition of rat
forsale [732]

Answer:

tan \theta = \frac{(176ft/s)^2}{1000 ft 32.2 ft/s^2}= 0.962

\theta = tan^{-1} (0.962) = 43.89

Explanation:

If the question is: Determine the banking angle θ

We have the forces involved on the figure attached.

For this case we know that the weight is given by:

W = mg

And for this case the centripetal acceleration would be given by:

a=\frac{v^2}{r}

If we analyze the sum of forces on x and y we have:

\sum F_x = m a_x

F + W sin \theta = ma cos theta

And if we solve for the force we got:

F = ma cos \theta - mg sin \theta = \frac{mv^2}{r} cos \theta - mg sin \theta

\sum F_y = m a_y

N - W cos \theta = ma sin \theta

If we solve for the normal force we got:

N =W cos \theta + ma sin \theta = \frac{mv^2}{r} sin \theta + mg cos \theta

In order to find the banking angle we use the fact that F =0

0 = \frac{mv^2}{r} cos \theta - mg sin \theta

tan \theta= \frac{v^2}{rg}

The velocity on this case is 120 mi/h if we convert this into ft/ s we got:

120 mi/h * \frac{5280 ft}{1mi} *\frac{1hr}{3600 s}= 176 ft/s

And then we have this:

tan \theta = \frac{(176ft/s)^2}{1000 ft 32.2 ft/s^2}= 0.962

\theta = tan^{-1} (0.962) = 43.89

5 0
2 years ago
If the current on your power supply exceeds 500 mA it can damage the supply. Suppose the supply is set for 37 V. What is the sma
lilavasa [31]

Answer:

74 Ω

Explanation:

Data provided in the question:

Maximum value of the current that can be provided = 500 mA

= 500 × 10⁻³ A  

Applied voltage set for the system = 37 V

Now,  

The smallest resistance that can be measured    

= [ Applied voltage ] ÷ [ Maximum current that can be applied ]

= 37 ÷ (  500 × 10⁻³ )

= 74 Ω

4 0
2 years ago
Other questions:
  • 5. A typical paper clip weighs 0.59 g and consists of BCC iron. Calculate (a) the number of
    5·1 answer
  • 1. Which type of sketch most accurately represents what the finished product will look like?
    11·1 answer
  • Oil in an engine is being cooled by air in a cross-flow heat exchanger, where both fluids are unmixed. Oil (cp = 2000 J/kg. K) f
    12·1 answer
  • A driver traveling at 65 mi/h rounds a curve on a level grade to see a truck overturned across the roadway at a distance of 350
    13·1 answer
  • A flexural member is fabricated from two flange plates 7-1/2 x ½ and a web plate 17 x 3/8. The yield stress of steel is 50 ksi.
    8·1 answer
  • The Gill Art Gallery wishes to maintain data on their customers, artists and paintings. They may have several paintings by each
    7·1 answer
  • The molecular weight of a 10g rubber band
    12·1 answer
  • Thermal energy generated by the electrical resistance of a 5-mm-diameter and 4-m-long bare cable is dissipated to the surroundin
    12·1 answer
  • 11 Notează, în caiet, trăsăturile personajelor ce se pot
    13·1 answer
  • A dryer is shaped like a long semi-cylindrical duct of diameter 1.5 m. The base of the dryer is occupied with water-soaked mater
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!