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
I am Lyosha [343]
3 years ago
13

Write a program that will read two floating point numbers (the first read into a variable called first and the second read into

a variable called second) and then calls the function swap with the actual parameters first and second. The swap function having formal parameters number1 and number2 should swap the value of the two variables
Computers and Technology
1 answer:
Elenna [48]3 years ago
3 0

Answer:

In Python:

def swap(number1,number2):

   a = number1

   number1 = number2

   number2 = a

   return number1, number2

   

first = float(input("First Number: "))

second = float(input("Second Number: "))

print("After Swap: "+str(swap(first,second)))

Explanation:

The swap function begins here

def swap(number1,number2):

This saves number1 into variable a

   a = number1

This saves number2 into number1

   number1 = number2

This saves a (i.e. the previous number1) to number2

   number2 = a

This returns the numbers (after swap)

   return number1, number2

   

The main begins here

The next two lines prompt the user for first and second numbers

<em>first = float(input("First Number: "))</em>

<em>second = float(input("Second Number: "))</em>

This calls the swap function and print their values after swap

print("After Swap: "+str(swap(first,second)))

You might be interested in
Because of the abundance of water on planet Earth, hydrogen gas (H2) is a candidate in the search for a replacement for petroleu
Dennis_Churaev [7]

The reason why plants are considered to be one step ahead in the utilization of hydrogen as an alternative fuel source is because; Plant cells possess water-splitting enzymes

<h3>What are splitting Enzymes?</h3>

Splitting Enzyme’s are like aldolases that catalyze the conversion of a molecule into two smaller molecules without the addition or removal of any atoms.

Now in plant biology, plants make use of he light-driven water-splitting/oxygen-evolving enzyme known as Photosystem II in photosynthesis to split water.

Read more about splitting enzymes at; brainly.com/question/14713715

3 0
2 years ago
The________ format is usually used to store data
Nikitich [7]
The answer is BCD; The BCD format is usually used to store data
5 0
3 years ago
The ____ of a variable is the location in memory where it’s value is stored. A. Value B. Address C. Data type D. Number
fomenos

Answer: C. Data type

Explanation:

data types are defined as the data storage format that a variable can store a data to perform a specific operation. Data types are used to define a variable before its use in a program. Size of variable, constant and array are determined by data types.

3 0
3 years ago
CAN SOMEONE PLEASE write about the evolution of music IN PETAL FORM PLEASE I NEED IT DUE TMR PLEASE I GIVE 15 POINTS AND BRAINLY
vitfil [10]

Answer:

Music can evolve by the process of natural selection, the same way species evolve in the natural world. They found that the loops quickly evolved into music attributable, in part, to the evolution of aesthetically pleasing chords and rhythms.

4 0
2 years ago
Combinations of spaces and special characters can be used in domain names of uniform resource locators (urls).
iris [78.8K]

A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.

The statement that combinations of spaces and special characters can be used in domain names of uniform resource locators (URLs) is false. Correct answer: B

The specifications for URLs are clealy defined by The Internet Engineering Task Force (IETF).

7 0
3 years ago
Read 2 more answers
Other questions:
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • Click to move a stacked object to the top of the stack?
    8·1 answer
  • Which of the following statements is false? People tend to shortcut security procedures because the procedures are inconvenient.
    13·1 answer
  • Write a method body for the static method isDivisibleBy5 shown below. The only NaturalNumber methods you are allowed to use are
    12·1 answer
  • What gaming PC should I get
    14·2 answers
  • An attacker gained remote access to a user's computer by exploiting a vulnerability in a piece of software on the device. The at
    14·1 answer
  • What is gained by increasing the ritation speed of a disk or cd?​
    9·1 answer
  • What is computer assisted translation​
    9·1 answer
  • How do you get The gold chip on Megaman x3 snes I want To know
    11·1 answer
  • The concepts of ________________, _________________, and _________________ for covert acts are pivotal to understanding state-on
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!