Question

In: Computer Science

Write anoutput(number)functionthat printsout information according to the requirements below.-If numberis a multiple of 3and 4, print"Multiple...

Write anoutput(number)functionthat printsout information according to the requirements below.-If numberis a multiple of 3and 4, print"Multiple of 3 and 4". -If numberis onlya multiple of 4, print "Multiple of 4".-If numberis onlya multiple of 3, print "Multiple of 3". -If numberis not a multiple of 3or 4, print "Not a multiple of 3or 4"

>>output(12)'Multiple of 3 and 4'>>>output(8)'Multiple of 4'>>>output(5)'Not a multiple of 3 or 4

Solutions

Expert Solution

The output shows that the program should be written on python. Please find the program below.

def output (number):
if number%3==0 and number%4==0 :
return (str(number)+" is multiple of 3 and 4")
elif number%3==0 :
return (str(number)+" is multiple of 3")
elif number%4==0 :
return (str(number)+" is multiple of 4")
else:
return(str(number)+" is not a multiple of 3 or 4")

# Getting user input
number=int(input("Enter a number : "))
# Calling thefunction and printing the output
print(output(number))



Related Solutions

You are required to write an abstract and title using the below information. Submission requirements: -...
You are required to write an abstract and title using the below information. Submission requirements: - Word length: 300 words (strictly enforced) - -Information - A number of case studies using data about disasters that had significant economic consequences were undertaken by the researchers, and these studies looked at the investment advice provided by the Home Budget Management System and whether it actually proved to be accurate. - In this paper a new Domestic Budget Management System called the Home...
Program Requirements: Write a C++ program according to the following requirements: 1.   Open the data file...
Program Requirements: Write a C++ program according to the following requirements: 1.   Open the data file Electricity.txt and read each column into an array (8 arrays total). 2.   Also create 2 arrays for the following: Total Fossil Fuel Energy (sum of all fossil fuels) Total Renewable Energy (sum of all renewable sources) Electricity.txt: Net generation United States all sectors monthly https://www.eia.gov/electricity/data/browser/ Source: U.S. Energy Information Administration All values in thousands of megawatthours Year   all fuels   coal       natural gas   nuclear  ...
Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future"...
Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century". Else, if givenYear is 1901 or greater (1901-2000), print "20th century". Else (1900 or earlier), print "Long ago". Do NOT end with newline C++
how to write a cpp program that takes a number from a user, and print the...
how to write a cpp program that takes a number from a user, and print the sum of all numbers from one to that number on screen? using loop interation as basic as possible.
Write a javascript program according to the follow requirements: Create a function that converts Fahrenheit to...
Write a javascript program according to the follow requirements: Create a function that converts Fahrenheit to Celsius. It takes a single argument which represents degrees in Fahrenheit. It converts it and returns the degrees in Celsius. Create another function that converts Celsius to Fahrenheit. It takes a argument in Celsius and returns the degrees in Fahrenheit. Implement the function convert(isFtoC, from, to) below. It takes the following three arguments: isFtoC: a boolean that is true if degrees must be converted...
What probably happened that a government decided it needed to print the below banknote? (Write a...
What probably happened that a government decided it needed to print the below banknote? (Write a minimum of 100 words in your answer)
write a program that uses exactly four for loops to print the sequence of letters below...
write a program that uses exactly four for loops to print the sequence of letters below A A A A A A A A A A B B B B B B B C C C C C C E E E E E
Create an ER diagram for the requirements below. - Parts have a unique number, name, and...
Create an ER diagram for the requirements below. - Parts have a unique number, name, and production year. - Car company has a unique number, name and country information -Automakers make multiple cars. It has a serial number and a name. but, There can be no more than two companies making one car. -Parts are used in many cars. When a part is used in a car, Save the part usage date and quantity information.
Requirements: Code in C++. With given information, write the solution to this problem so that it...
Requirements: Code in C++. With given information, write the solution to this problem so that it is understandable to someone with basic knowledge of C++ (ex: only keep basic libraries, keep coding shortcuts to a minimum). Also leave comments in the code (plz), the logic behind solving this problem if possible, and explanation of what the keys to solving this problem is and how to run test cases to ensure correctness of code. Problem: For this problem you will compute...
Come up with 4 reliability requirements for each requirements listed below. 1.0 AAS shall general clearance...
Come up with 4 reliability requirements for each requirements listed below. 1.0 AAS shall general clearance for domestic flights 2.0 The displays of the AAS shall be able to accept controller inputs 3.0 The AAS shall be able to manage air traffic sequences
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT