modify this code to ask the user to enter their name five times
name = input("what is your name?")
for i in range(5):
print(name)
modify this code to ask the user to enter their name five times name = input("what...
In Java Code using modular programming ask the user to input 3 restaurant names. Find and Validate the longest name in length and then print the longest name.
Ask the user to enter a message Ask the user how many time they want to print the message Then use "while","do-while" and "for" loop to print the message. Show the number at the beginning of the lines when printing. For example: Enter your message: Welcome to Java How many time you want to print this message: 3 Using "while" loop: 1=> Welcome to Java 2=> Welcome to Java 3=> Welcome to Java Using "do-while" loop: 1=> Welcome to Java...
Write Java code that does the following Ask the user to enter a file name. Ask the user for two integers as the lower bound and the upper bound. Use a loop to write all the odd numbers between the lower bound and the upper bound (inclusive) to the file, and then close the file. Use either while loop, do while loop, or for loop to complete the program. PrintWriter class is used. The file is closed before the program...
1. use the main method 2. ask the user to enter a name at the terminal 3. ask the user to continue to add name (use Y/N) 4. as long as the user type Y. keep asking them to enter a name. 5. at N (no) print out the following: LAST NAME, firstname Language: java for all lthe entries. ex. Enter a Name Tom Harper Enter a new name ? (Y/N) Y Enter a Name Sue Bird Enter a new...
Write a program that would ask the user to enter an input file name, and an output file name. Then the program reads the content of the input file, and read the data in each line as a number (double). These numbers represent the temperatures degrees in Fahrenheit for each day. The program should convert the temperature degrees to Celsius and then writes the numbers to the output file, with the number of day added to the beginning of the...
Write a C code using switch statement that will ask the user to enter a character. This character should be one of the first three characters of your name. The code then should check for the value of the character and output the following: If the character is the same as yo&r first letter then output "X=10" If the character is the same as your second letter then output "Y=5" If the character is the same as your Third letter...
wrote the code in the discbribtion bar
Question 26 CLOS Following code is supposed to ask a user to input a numbe then print the numbers from 0 1 4 0 16 (n-1)2 def my_print(inp) for i in range(inp printi"2) n= int(input(Enter a number: ) my_print(n) The code is not working due to incorect format select the comectly formatted code def my_print(inp): for i in range(inp) printi2) n= int(input(Enter a number ) my_print(n) O def my_print(inp): for i in range(inp)...
JAVA Ask the user for integers. If the user did not enter an integer, ask again. (Type Safe Input) Keep a running total of the intergers entered (sum). Once the user enters 0, stop looping. Print the sum of all the numbers. Do not use try-catch. EXAMPLE OUTPUT: Enter an integer, 0 to stop> [fasdfsa] Invalid input. Enter an integer, 0 to stop> [231.342] Invalid input. Enter an integer, 0 to stop> [1] Enter an integer, 0 to stop> [2]...
For Java
Keyboard Input Lab3 Ask the user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display that. Finally, ask them for how much they make and display that. You should use the most appropriate data type for each variable. Hello. What is your name? Dennis Hi, Dennis! How old are you? 37 So you're 37, eh? That's not old at all! How much do you make, Dennis?...
(Java) HELP! Create a program that will ask the user to enter their first name and their favorite number. Ask the user if they would like the information repeated back to them. If they type "Y" display the answers back to them. If they type anything else, display the word "Goodbye". An example of what your output window should look like is below. The system-generated output is in red. The user-provided input is in green. (Your actual program will only...