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
arlik [135]
4 years ago
9

How do I write a program in Pascal that finds the index of the minimum number of an array(using Function) and replaces it to a n

umber inputted from the keyboard ?(Input and output of the array is a Procedure).
Computers and Technology
1 answer:
nordsb [41]4 years ago
5 0

Answer:

program arraysminfinder;

procedure minreplace();

var

no: array [1..10] of integer;  (*no is an array of integers, 10 in all *)

a: integer= 0;

i: integer= 0;

c: integer= 0;

k: integer=0;

N: integer=0;

begin

(* We need to first initialize the array no with 0 values *)

for a := 1 to 10 do

no[a]:=0;

c:=no[1];

for a := 1 to 10 do

begin

  if (no[i]<c) then

  begin

   c:=no[i];

   k:=i;

  end

  else

  begin

      i:=i+1;

  end

 end;

  writeln('Enter the new number:');

  read(N);

  no[k]:=N;

  for a := 1 to 10 do

  begin

     writeln('The array elements are:',no[a]);

   end;

end;

begin

end.

Explanation:

The program is as above.  I have used a function, a for loop, an array of integers, and the if then else ladder for getting the desired output as mentioned in the program. If in case you want procedure for input and output, create a procedure like:

procedure replacenum():integer;

Begin

 writeln("Enter the new number:" N);

    no[k]:=N;

   for a := 1 to 10 do

         writeln("The array elements are:"no[a]);

 end.

Similarly you can make a procedure for input.

You might be interested in
In python 3.17 LAB: Convert to dollars
krok68 [10]

To convert the inputs to dollars and cents, we make use of a combination of multiplication and addition.

The program written in Python where comments are used to explain each line is as follows:

<em />

<em>#This gets input for the number of quarters</em>

quarters = int(input("Quarters: "))

<em>#This gets input for the number of dimes</em>

dimes = int(input("Dimes: "))

<em>#This gets input for the number of nickels</em>

nickels= int(input("Nickels: "))

<em>#This gets input for the number of pennies</em>

pennies= int(input("Pennies: "))

<em>#This converts the amount to dollars and cents</em>

dollars = quarters * 0.25 + dimes * 0.10 + nickels * 0.05 + pennies * 0.01

<em>#This prints the amount to 2 decimal places</em>

print("Amount ${:.2f}".format(dollars))

Read more about Python programs at:

brainly.com/question/22841107

7 0
3 years ago
Which part of the ethernet address is assigned to vendors to identify the equipment?
Nitella [24]

First three bytes of the ethernet address exists assigned to vendors to identify the equipment.

<h3>What is Ethernet address?</h3>

A media access control address stands for a unique identifier allocated to a network interface controller for usage as a network address in communications within a network segment. This use exists as standard in most IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth.

This address exists as the identifying mark that allows a networked computer to communicate with the Internet. The ethernet address exists how we can associate an “IP address” to an individual computer — without this– number, there's no form to access any servers, websites, email, etc.

The first three bytes (pairs of hexadecimal characters) of any unicast address include that vendor address component of the MAC address. The staying three bytes carry the serial number of that vendor's interface card. Dell, Inc. Apple, Inc.

Hence, first three bytes of the ethernet address exists assigned to vendors to identify the equipment.

To learn more about Ethernet address refer to:

brainly.com/question/7284219

#SPJ4

4 0
1 year ago
Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
Alchen [17]

Answer:

? Read on to learn about the possible reasons and resolutions. ... Check whether you have the latest update installed for InDesign. ... InDesign cannot open the file when your system does not have enough memory ... Copy page elements into a new document.

Explanation:

4 0
3 years ago
Which icons allows you to add a style to a chart
ZanzabumX [31]
Click on your chart and go under Table Tools, Design... then you should see the different styles. ;)
5 0
3 years ago
Subscribe to (Thicc sickqueen) and like 2 vids and the claim your prize
lara [203]

Answer:

done

Explanation:

5 0
4 years ago
Other questions:
  • Software engineering design teams use ________, which are grounded in mathematical concepts of sets and relations, for their sof
    13·1 answer
  • A ________ is hardware or software that acts as a filter to prevent unwanted packets from entering a network.
    9·2 answers
  • What image format should be used to keep the file size manageable​
    14·1 answer
  • Which of the following are examples of jobs in the allied health profession? select all that apply.
    8·1 answer
  • Which attribute defines the file name for the specific image in an image tag??
    13·1 answer
  • I need help with writing the code in Python that draws an arrow pointing to the right.
    15·1 answer
  • Write an algorithm that accepts two numbers,
    7·1 answer
  • 1. Software that is designed to intentionally cause harm to a device, server, or network is A. outware B.loggerware C.
    12·1 answer
  • Given an initialized variable fileName, write a sequence of statements that create a file whose name is given by the variable an
    15·1 answer
  • Where else can the computer send the results of processing other than to output​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!