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

Answers

Answer 1

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

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

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

This calls the swap function and print their values after swap

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


Related Questions

Jobs with only 7 letters

Answers

Answer:

nursing

Explanation:

it's needs 20 words so don't mind thisssss part hehe

Answer: Teacher!!!!!!

Select the correct statement(s) regarding direct sequence spread spectrum (DSSS) and orthogonal frequency division multiplexing (OFDM).
a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum
b. OFDM has greater spectral efficiency compared to DSSS
c. DSSS relies upon a PN code that is only shared by the transmitter and receiver pair
d. all statements are correct

Answers

Answer:

a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum.

Explanation:

Orthogonal Frequency Division Multiplexing is a technique in which large digital data is sent over radio waves by splitting it into multiple subcarriers. The data is then transmitted to different users who can access the files. OFDM is not a spread spectrum technique, it is based on large frequency spectrum.

Which of the following characterizes how an enabled security program might react to a new program installation on a computer system?


It might alert you to space requirement excesses.

It might report an error or tell you that the file is corrupted.

It might protect the new installation from getting viruses.

It might automatically set a restore point for the computer system.

Answers

Answer:

It might automatically set a restore point for the computer system

Answer:

It might report an error or tell you that the file is corrupted.

Explanation:

Rupesh wants to try programming with Eclipse. What is the first step he should take to make that happen?


download the Eclipse IDE

download the current Java Development Kit

create a restore point

disable his security program

Answers

Answer:

create a restore point

Explanation:

Define the Database ​

Answers

A structured base in a computer

Write a function charInWord that takes in two parameters, a char (character) and a word (string). The program will return true if the character is in the word and false if it is not. If word is not a string type, or if char is not a string type, or if the length of char is greater than 1, the function should return None. Your main program should call the function and print char is in word if the function returns true, or char is not in word if the function returns false, using the user-supplied values instead of char and word. The program should print incorrect input provided if the function returns None. Ex: If the input is: a cat the output is: a is in cat Ex: If the input is: a club the output is: a is not in club Ex: If the input is: ab horse the output is:

Answers

Answer:

The program in Python, is as follows:

def charInWord(chr,word):

   if len(chr)>1:

       print("None")

   elif not(chr.isalpha() and word.isalpha()):

       print("None")

   else:

       if word.find(chr) == -1:

           print(chr+" is not in "+word)

       else:

           print(chr+" is in "+word)

chr = input("Character: ")

word = input("Word: ")

print(charInWord(chr,word))

Explanation:

This defines the function

def charInWord(chr,word):

This checks if the length of character is greater than 1

   if len(chr)>1:

If yes, it prints None

       print("None")

This checks if the character or the word contains invalid character

   elif not(chr.isalpha() and word.isalpha()):

If yes, it prints None

       print("None")

This is executed for valid parameters

   else:

If the character is not present, this is executed

       if word.find(chr) == -1:

           print(chr+" is not in "+word)

If the character is present, this is executed

       else:

           print(chr+" is in "+word)

The main begins here

This gets the character

chr = input("Character: ")

This gets the word

word = input("Word: ")

This calls the method and prints the required output

print(charInWord(chr,word))

PLEASE SOMEONE ANSWER THIS
If the old code to a passcode was 1147, and someone changed it, what would the new code be?

(I already tried 4117)



[I forgot my screen time passcode please someone help I literally can’t do anything on my phone.]

Answers

Answer:

Any of these?

Explanation:

1147. 4117. 7411

1471. 4171

1714. 4711

1741. 7114

1417. 7141

Answer:

1417

Explanation:

What are some common uses of Excel?

Answers

Answer:

to make a spread sheet and to make sure you have all of the sum and didn[t miss a number

Explanation:

Other Questions
69468403075295555033768038758X78684821900000057636843904983756930 What was it like when Amiras family left her village in Syria? how does the sun rise and seta.earth orbit around the sunb.The sun is center of solar systemc.earth rotates on it tilted axis and orbit around the sun at the same time Find the measure of 2.50 2.1130< 2 =[?] Solve: -4x = 20A.) x = 5B.) x = 24C.) x = -5D.) x = 16 1. Look back at the pirate web site provided in this lesson to answer this question: which group of pirates attacked villages as well as ships?ChineseVikingsBarbaryPortuguese 2What does the author describe in the passage?Athe history of the Hoover Dam and its impachon the Southwest regionBthe development of different types of hydropowerC the political environment in America during the construction of the HooverDamimprovements in irrigation along the Colorado River before the HooverDam was built Read the excerpt. The United States and China are the two largest consumers of energy in the world. . . . Neither of us profits from a growing dependence on foreign oil, nor can we spare our people from the ravages of climate change unless we cooperate. Common sense calls upon us to act [together]. President Obama, 2009 Based on this excerpt, which form of foreign policy implementation was President Obama advocating between the two countries According to the model proposed by geophysicist J. Tuzo Wilson, hot spots are caused by a. friction due to the lithosphere sliding atop the asthenosphere. b. unusually dense concentrations of radioactive isotopes at various points in the crust. c. hot plumes of mantle material that rise up through cooler, denser surrounding rock. d. zones of localized subduction that produce melting of the mantle. What are the terms in 4(2x + 3) 5y Can someone help please. You are traveling down a country road at a rate of 95 feet/sec when you see a large cow 300 feet in front of you and directly in your lane. The cow is fearless, and staring you down. (Or perhaps she does not understand the gravity of the situation.) Regardless, if you simply hit your brakes, after t seconds, the car will be j(t) = 95t - 9t^2 feet from the point where the brakes were first applied. 1) Must you steer to avoid the cow, or can you rely solely on your brakes? Explain. 2) Graph J(t), j'(t), and j"(t) and Interpret their meanings in context. 3) Is there a time t after which the graphs in part (ii) probably do not accurately model the path of the car? 4) Write a piece-wise function using j(t) that would more accurately model the path of the car on the interval [0, 10], assuming the car did not move after it stopped. Sketch this graph and its derivative. What is the significance of the term, we didnt cross the border, the border crossed us? What country did not want to getinvolved with World War I?A. GermanyB. FranceC. the United States PLS HELP (50 POINTS) I WILL ALSO MARK BRAINLIEST!!! due before 2:30 !! help !! Why was Stalin able to establish such a strong communist presence inEastern Europe following World War II? Give the most specific name for each quadrilateral. Please help with this, oh and bungee gum contains both the properties of rubber AND gum you see? Read the paragraph Jamal has written about bearhibernation.Where would this paragraph fit best in an informationalessay?ALO cover pagethe endThe bear goes into hibernation for one major reason.During the winter, there is not a lot of food to eat, soduring the cold winter months, the bear hibernates sothat it doesn't starve. Bears are large animals and needto eat a lot of food, and there just is not enough forthem to live on during the winter. A bear will come outof hibernation during the spring, when there is a betterfood supply A Cover page B the end C the beginningD the middle