1. Experiment with the arguments in the max() function in the program to determine if the function must have four arguments. Provide an example for your answer.
2. Write code that prompts the user for a floating point number and prints the smallest integer that is larger than the number the user entered.
3. Write the code to print a random number between one and six.
4. Assume that a user enters any number and that the number is stored in the variable userNumber.
Write a line of code that converts the input to an integer. Then write a line of code that prints the positive value of the user’s input.
5. Write a line of code that calculates the square root of 900 and stores the result in the variableanswer.
Code
1)
doAgain = True
while doAgain:
num1 = int(input("Total first number: "))
num2 = int(input("Total second number: "))
num3 = int(input("Total third number: "))
num4 = int(input("Total fourth number: "))
maxNum1 = max(num1, num2, num3, num4)
print("The largest of the four numbers is: ",maxNum1)
choice=input("Do you want to do again?(y/n): ")
if(choice=='n'):
doAgain=False
output

code snaps

2)
code
import math
number=float(input("Enter a float number: "))
print("the smallest integer that is larger than the number
",number," is ",math.ceil(number))
output


3)
code
import random
print("Random number between 1 to 6 is ",random.randint(1,6))
output
4)
code
userNumber=int(input("Enter a number: " ))
print("Positive number is ",abs(userNumber))
output

5)
code
import math
answer=math.sqrt(900)
print("Square root of 900 is :",answer)
output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.
Experiment with the arguments in the max() function in the program to determine if the function must have four arguments.
I am supposed to a pseudocode function named max that accepts two integer values as arguments and returns the value that is greater of the two. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is greater of the two. Is everything correct and complete? //Pseudocode //This function takes two integers as parameters: x and y Begin : Max(x,y) If(x>y) then MAX=x Else MAX=y End if Return...
Write a C or C++ program a pseudo C program (based on chapter 2 in the book) and then use these programs to develop a MIPS program that gets an integer input from the user, and based on the input returns the minimal or maximal value stored in a static initialized array. The following are detailed instructions: 1) The program generates a static initialized array with 10 integers (using the .word directive). 2) The program prompts the user to enter...
C++
Write a program that prompts the user to enter integers or a sentinel to stop. The program prints the highest and lowest numbers entered, the sum and the average. DO NOT USE ARRAYS, only variables and loops. Write a program the prompts the user to input a positive integer. Keep asking the user until a positive integer is entered. Once a positive integer is entered, print a message if the integer is prime or not. (NOTE: A number is...
Design a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. For example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two. Need Variable lists, Psuedocode, ipo chart, Flow Chart, and a python...
Language is C
1. Palindrome Write a program that prompts the user for a positive integer number and output whether the number is a palindrome or not. A palindrome number is a number that is the same when reversed. For example, 12321 is a palindrome; 1234 is not a palindromoe. You will write a function named as palindrome. The function will have two arguments, number and isPalindrome. Both arguments are pass-by-reference. The argument number is a pointer to a variable...
How would I make it so these are dialog boxes instead of just like a regular question? Here are the instructions. "Ask the user to input a number. You must use an input dialog box for this input. Be sure to convert the String from the dialog box into an integer (int). The program needs to keep track of the smallest number the user entered as well as the largest number entered. Use a Confirm dialog box to ask the user...
1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in); } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...
Your task is to write a C++ program that consumes integer values as command line arguments and returns the arithmetic mean of these values. To increase the flexibility of the program, there should be no set number of arguments. To overcome this, we will require the argument argv[1] to be the number of integers the user enters. For example, if the user wants to calculate the arithmetic mean of 4 numbers, they would pass in 4 as the first argument...
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...
Implement the following problem as a self-contained python module. Write a program that continually prompts the user for positive integer values and stores them in a list. You should stop prompting when the user enters a negative integer value. When the user is done entering values, you should print the list of integers they have provided in sorted order. You should then compute the mean and standard deviation of the values in the list. Recall that the mean is just...