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
Use the drop-down menus to complete statements about the two formats for importing contacts.
oee [108]

Answer:

The PST file format can only be imported into contacts by the outlook

program.

The CSV file type can be created from a document or spreadsheets

and can be imported by multiple email programs.

Explanation:

6 0
2 years ago
Read 2 more answers
Which tab automatically becomes available after inserting a text box? Drawing Tools Insert Text Box Tools Shape Tools
In-s [12.5K]

Answer:

insert text box

Explanation:

6 0
3 years ago
Read 2 more answers
In powerpoint, what is line thickness measured in?
katrin [286]
Impasto. Hope this helps!
5 0
2 years ago
How do you jumpstart a car in the middle of nowhere??? Explain using 2 paragraphs.
Julli [10]
Is there another car around? If not the best way would be to put the car in neutral, get the car moving, than pop the clutch (or slam into drive if it's not a manual) the key should be on to do this. This has the same effect as a starter just doesn't require a battery.<span />
7 0
3 years ago
Read 2 more answers
To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save. What is t
Inessa [10]

Answer:

The answer to this question is given below in the explanation section

Explanation:

To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save.

If you want to save the file in word using shortcut. Then, for saving the file, you need to press Ctrl+S. If you want to save the file as (Save as), then you need to press F12.

3 0
3 years ago
Other questions:
  • Which type of architecture places a firewall in front of the VPN to protect it from Internet-based attacks as well as behind a f
    6·1 answer
  • What are the three fundamental elements of an effective security program for information systems?
    11·2 answers
  • The two types of objects responsible for collecting data are
    14·1 answer
  • Themes are applied from which tab?
    6·1 answer
  • To print data sideways on a piece of paper, use the _______ page orientation setting.
    6·2 answers
  • Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a subli
    13·1 answer
  • Before using large downloaded files that are in a compressed format, it is necessary to_____ them. A) Copy B) Extract C) Open D)
    9·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • Adam is an Engineering student but has decided that he does not want to work in that field, but in the Manufacturing career clus
    11·2 answers
  • RTOS stands for ______ Time Operating System.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!