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
Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
Fantom [35]

Answer:The 2009-M57-Patents scenario tracks the first four weeks of corporate history of the M57 Patents company. The company started operation on Friday, November 13th, 2009, and ceased operation on Saturday, December 12, 2009. As might be imagined in the business of outsourced patent searching, lots of other activities were going on at M57-Patents.

Two ways of working the scenario are as a disk forensics exercise (students are provided with disk images of all the systems as they were on the last day) and as a network forensics exercise (students are provided with all of the packets in and out of the corporate network). The scenario data can also be used to support computer forensics research, as the hard drive of each computer and each computer’s memory were imaged every day.

Explanation:

4 0
3 years ago
How many answers do you need to be able to write messages on here??
Kipish [7]

1,000

Hope this helps!



~Courtney

3 0
2 years ago
I really want to know the best way to deal as much heart as possible plz tell me
Natasha2012 [34]

Answer:

Set aside time every day for doing something that feels positive, whether that’s journaling, meeting up with a close friend, or watching a show that makes you laugh. Scheduling in moments that bring you joy is vital for healing a broken heart. It’s important to talk about your feelings with others and not numb yourself out.

Explanation:

7 0
2 years ago
Read 2 more answers
Where is NumPy used?
Svetradugi [14.3K]

Explanation:

The ndarray (NumPy Array) is a multidimensional array used to store values of same datatype. These arrays are indexed just like Sequences, starts with zero.

7 0
3 years ago
Read 2 more answers
1.
saul85 [17]

Answer:

1. Speakers

2. Software

3. C.P.U

4. ROM

5. Hard drive

6. RAM

7 0
2 years ago
Other questions:
  • When inside a closed work environment, its okay to openly talk with co-workers about PII
    6·1 answer
  • what is the software that controls the storage, retrieval and manipulation of database stored in a database
    14·1 answer
  • What is constructive criticism?
    9·1 answer
  • Use the drop-down menus to describe how Adnan can add shapes to his presentation.
    11·1 answer
  • linela Insurance needs to hire twenty accountants immediately to support its accounts receivable process. The hiring and trainin
    10·1 answer
  • How do I start conversations with ppl??? If u answer right I will try send u more points... So please help me
    7·1 answer
  • S.B. manages the website for the student union at Bridger College in Bozeman, Montana. The student union provides daily activiti
    7·1 answer
  • Only cool people answer this question.<br><br><br><br><br> are you cool?
    11·2 answers
  • Guidewords for the word “serpent” may be
    8·2 answers
  • Multiple Select Which of these are ways a hacker might learn someone's password? Select 3 options. o social engineering keylogge
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!