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
How does a USB flash drive get its files?
geniusboy [140]

Answer:

The flash drive is inserted into a computer's USB port, or type-A USB connector. The USB connector communicates between the drive and the computer. The computer recognizes the drive as a separate hard drive, allowing users to move files from the computer's hard drive to the flash drive.

6 0
3 years ago
What is the "key" to a Caesar Cipher that someone needs to know (or discover) to decrypt the message? a) A secret word only know
Tpy6a [65]

Answer:

The number of characters to shift each letter in the alphabet.

Explanation:

Caeser Cipher is the technique of encryption of data, to make it secure by adding characters between alphabets. These are the special characters that make the message secure while transmitting.

According to the standards, For Decryption, we remove these special characters between alphabets to make message understandable.

<em>So, we can say that,to de-crypt the message, the number of characters to shift each letter in the alphabet.</em>

3 0
3 years ago
The _____ contains the prerequisites for the new system, describes the alternatives that were considered, and makes a specific r
Step2247 [10]

Answer:

Option d

Explanation:

  • A Software Requirements Specification (SRS) is a depiction of a product framework to be created.  
  • SRS is a thorough evaluation of prerequisites before the more explicit framework configuration stages, and its objective is to decrease later upgrade. It ought to likewise give a reasonable premise to assessing item costs, dangers, and timetables.  
  • The product prerequisites detail report records adequate and vital necessities for the task advancement.
  • To infer the necessities, the designer needs to have clear and intensive comprehension of the items a work in progress.
  • This is accomplished through point by point and persistent correspondences with the venture group and client all through the product advancement process.
3 0
4 years ago
Which menu selection under Accessories will open a DOS-like window? A. Hyperterminal B. Command Prompt C. Remote Desktop Connect
Bezzdna [24]
B. Command Prompt, as if you were to open command prompt it is 1. Under Accessories and 2. DOS-Like
7 0
4 years ago
A hammer has an input distance of 2 cm and an output distance of 7 cm. What is its ideal mechanical advantage?
KATRIN_1 [288]

Answer: 4

What is its ideal mechanical advantage?

Explanation:

6 0
2 years ago
Other questions:
  • What risks, threats, and vulnerabilities are prominent with wlan infrastructures?
    7·1 answer
  • Is the cell phone changing our views about polite and impolite behavior? For example,
    9·2 answers
  • . the web is based on the ________ protocol
    6·1 answer
  • What is out put.what is data. what is microprocessor
    14·1 answer
  • Indexed sequential access, an index is more useful when the number of record is
    10·1 answer
  • What are the two reasons we analyze algorithims
    7·1 answer
  • ________ uses the signals transmitted over the phone to access the database, retrieve account information and input data. Group
    11·1 answer
  • In the following code: function drawCircle(radius, x, y, color) { var circle = new Circle(radius); circle.setPosition(x, y); cir
    7·1 answer
  • Your principal has hired you to design a drone that can monitor students in the hallways. Before you brainstorm design ideas, yo
    15·2 answers
  • In excel office How to create spreadsheets?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!