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
cThe Mars Rover Spirit got stuck in the Martian sand. The wheels kept slipping. Attempts to free it were futile. Discuss the typ
IgorC [24]

Answer:

Improved/ advanced types of Actuators include servo systems, create a large range of actuator motion in response to the changing needs of the operational environment or process.

Actuators are local or automated suppliers of working motion.

Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

Explanation:

An actuator control system is referred to as any electronic, electrical, or electromechanical system often used to activate an actuator, control the direction as well as extent and duration of its output. Actuator control systems could take the form of extremely simple, manually-operated, start-and-stop stations, either sophisticated or programmable computer systems. The more improved/ advanced types include servo systems that produce a large range of actuator motion in response to the changing needs of the operational environment or process. This type of actuator control system uses an interface arrangement that assimilates feedback from the process or mechanism and adjusts the actuator in the right way. Most actuator systems will include at least a set of travel limits that prevent the actuator destroying itself or the secondary mechanism.

Actuators are local or automated suppliers of working motion. They are used to changes, adjust, or move a secondary mechanism, where a physical operator cannot intervene directly. They are denoted by a large range of varying types using electrical and electromagnetic, hydraulic, or pneumatic power sources to create linear or rotary outputs. One element they all have in common is the actuator control system used to start, stop, and adjust the range, speed, and duration of the working motion.

Actuators can produce a linear motion, rotary motion or oscillatory motion which means they can create motion in one direction, in a circular motion or in opposite directions at regular intervals. Hydraulic and air cylinders can be classified as single-acting cylinders, meaning that the energy source result in movement in one direction and a spring is used for the other direction.

7 0
4 years ago
Write a program that uses a function called Output_Array_Info. Output_Array_Info Properties: Input Parameters: 1. A pointer to a
Artyom0805 [142]

Answer:

C++ code explained below

Explanation:

Please note the below program has been tested on ubuntu 16.04 system and compiled using g++ compiler. This code will also work on other IDE's

-----------------------------------------------------------------------------------------------------------------------------------

Program:

-----------------------------------------------------------------------------------------------------------------------------------

//header files

#include<iostream>

//namespace

using namespace std;

//function defintion

void Output_Array_Info(int *array_ptr, int size)

{

//display all array elements

cout<<"Array elements are: "<<endl;

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

{

cout<<*(array_ptr+i)<<endl;

}

//display address of each element

cout<<endl<<"memory address of each array elemnt is: "<<endl;

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

{

cout<<array_ptr+i<<endl;

}

}

//start of main function

int main()

{

//pointer variables

int *pointer;

//an array

int numbers[] = { 5, 7, 9, 10, 12};

//pointer pointing to array

pointer = numbers;

//calculate the size of the array

int size = sizeof(numbers)/sizeof(int);

//call to function

Output_Array_Info(numbers, size);

return 0;

}

//end of the main program

8 0
3 years ago
Steam enters a two-stage adiabatic turbine at 8 MPa and 5008C. It expands in the first stage to a state of 2 MPa and 3508C. Stea
Nataly [62]

Answer:

1) The exergy of destruction is approximately 456.93 kW

2) The reversible power output is approximately 5456.93 kW

Explanation:

1) The given parameters are;

P₁ = 8 MPa

T₁ = 500°C

From which we have;

s₁ = 6.727 kJ/(kg·K)

h₁ = 3399 kJ/kg

P₂ = 2 MPa

T₂ = 350°C

From which we have;

s₂ = 6.958 kJ/(kg·K)

h₂ = 3138 kJ/kg

P₃ = 2 MPa

T₃ = 500°C

From which we have;

s₃ = 7.434 kJ/(kg·K)

h₃ = 3468 kJ/kg

P₄ = 30 KPa

T₄ = 69.09 C (saturation temperature)

From which we have;

h₄ = h_{f4} + x₄×h_{fg} = 289.229 + 0.97*2335.32 = 2554.49 kJ/kg

s₄ =  s_{f4} + x₄×s_{fg} = 0.94394 + 0.97*6.8235 ≈ 7.563 kJ/(kg·K)

The exergy of destruction, \dot X_{dest}, is given as follows;

\dot X_{dest} = T₀ × \dot S_{gen} = T₀ × \dot m × (s₄ + s₂ - s₁ - s₃)

\dot X_{dest} = T₀ × \dot W×(s₄ + s₂ - s₁ - s₃)/(h₁ + h₃ - h₂ - h₄)

∴ \dot X_{dest} = 298.15 × 5000 × (7.563 + 6.958 - 6.727 - 7.434)/(3399 + 3468 - 3138  - 2554.49) ≈ 456.93 kW

The exergy of destruction ≈ 456.93 kW

2) The reversible power output, \dot W_{rev} = \dot W_{} + \dot X_{dest} ≈ 5000 + 456.93 kW = 5456.93 kW

The reversible power output ≈ 5456.93 kW.

6 0
3 years ago
What is one thing a person should do to stay safe when exercising
elixir [45]
Staying hydrated at all times
7 0
3 years ago
Read 2 more answers
What was the first prototype of the artificial tree like?
olga_2 [115]

Answer:

An artificial Christmas tree is an artificial pine or fir tree manufactured for the specific purpose of use as a Christmas tree. The earliest artificial Christmas trees were wooden, tree-shaped pyramids or feather trees, both developed by Germans. Most modern trees are made of polyvinyl chloride (PVC) but many other types of trees have been and are available, including aluminum Christmas trees and fiber-optic illuminated Christmas trees.

Explanation:

7 0
4 years ago
Other questions:
  • A cable in a motor hoist must lift a 700-lb engine. The steel cable is 0.375in. in diameter. What is the stress in the cable?
    12·1 answer
  • Why is my lawn mower not starting?
    9·1 answer
  • Two technicians are discussing solder wire repair. Technician A says that electrical tape can be used to cover the joint. Techni
    10·1 answer
  • Write a single statement that prints outsideTemperature with 2 digits in the fraction
    8·1 answer
  • The design specifications of a 1.2-m long solid circular transmission shaft require that the angle of twist of the shaft not exc
    15·1 answer
  • A digital Filter is defined by the following difference equation:
    11·1 answer
  • A simple ideal Rankine cycle with water as the working fluid operates between the pressure limits of 4 MPa in the boiler and 20
    12·1 answer
  • Durante el segundo trimestre de 2001, Tiger Woods fue el golfista que más dinero ganó en el PGATour. Sus ganancias sumaron un to
    9·1 answer
  • What is the name for a program based on the way your brain works?
    13·2 answers
  • In the construction of a large reactor pressure vessel, a new steel alloy with a plane strain fracture toughness of 55 MPa-m1/2
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!