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
What may happen if a large number of computer users are attempting to access a web page
Misha Larkins [42]
If the computers where all trying to access the same website then that website might be slow to load or it could crash all together.
7 0
3 years ago
Information systems that support the sales process of B2C companies are typically Web storefronts that customers use to enter an
RoseWind [281]

Answer:

This statement is CORRECT in electronic commerce and Online stores

Explanation:

The term B2C is derived from e-commerce which means Business to Consumer which describes  the process of selling goods and services directly to consumers who are the end-users. The advent of the dot com web boom led to a huge increase in these kinds of companies that sell directly to consumers through their online (website) channels.

3 0
3 years ago
Which type of service offers a preconfigured testing environment for application developers to create new software applications?
Vaselesa [24]

A type of service which offers a preconfigured testing environment for application developers to create new software applications is: B - Platforms as a Service (PaaS).

<h3>What is cloud computing?</h3>

Cloud computing can be defined as a type of computing service that requires the use of shared computing resources over the Internet, rather than the use of local servers and hard drives.

<h3>The categories of cloud service.</h3>

Generally, cloud computing comprises three (3) service models which includes the following;

  • Infrastructure as a Service (IaaS).
  • Software as a Service (SaaS).
  • Platform as a Service (PaaS).

In conclusion, a type of service which offers application developers a preconfigured hosting and testing environment to create new software applications is Platforms as a Service (PaaS).

Read more on Platform as a Service here: brainly.com/question/24233315

#SPJ1

6 0
2 years ago
How many bits per pixel does a black and white image require?
allochka39001 [22]
Depends on the size of the image

Hope this is helpful
8 0
3 years ago
The specific gravity of gold is 19.3. Write a MATLAB program that will ask the user to input the mass of a cube of solid gold in
s344n2d4d5 [400]

Answer:

Check the explanation

Explanation:

<em>Cube.m:</em>

mass = input("Enter the mass of cube [kilograms]: ");

if(mass<=0)

disp("Error: Mass must be greater than zero grams")

else

fprintf("The length of one side of cube is %.2f inches",2.7*mass);

end

<em>Output1</em>

octave:2> source ( Cube.m Enter the mass of cube [kilograms]: octave:2>-3 Error: Mass must be greater than zero grams

<em />

7 0
4 years ago
Other questions:
  • An independent frame that holds a program, document, or folder contents in windows 7 is called a ____.
    11·1 answer
  • F=M×A<br> What is the acceleration of 50kg object pushed with a force of 500 newton?
    14·1 answer
  • write a function that counts the number of times the value of y occurs in the first n values in array x. y is an integer variabl
    15·1 answer
  • The instructions for the OS provided by application software
    14·2 answers
  • Explain the differences between kernel applications of the OS and the applications installed by an organization or user.
    6·1 answer
  • A printer is displaying no images on its LED panel. What can a technician do to troubleshoot the situation? Choose two answers.
    6·1 answer
  • How many pieces are there in a normal laptop??? Good luck and solve carefully
    9·1 answer
  • WHO SAYS BUP ALL THE TIME ​
    8·1 answer
  • Write a method named collapse that accepts an array of integers as a parameter and returns a new array where each pair of intege
    6·1 answer
  • What type of os must be installed on your machine to allow this type of action by another person?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!