def myStartsWith(str1, str2):
if len(str1) < len(str2):
return False
else:
for i in range(len(str2)):
if str1[i] != str2[i]:
return False
return True
def main():
str1 = input('Enter first string: ')
str2 = input('Enter second string: ')
if myStartsWith(str1, str2):
print(str1 + ' starts with ' + str2)
else:
print(str1 + ' DOES NOT start with ' + str2)
main()
Program must be in Python 3. Write a program that prompts the user to enter two...
Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. #include <iostream> #include <string> using namespace std; void removeVowels(string& str); bool isVowel(char ch);...
Python code
Write a program that will ask the user to input two strings, assign the strings to variables m and n If the first or second string is less than 10 characters, the program must output a warning message that the string is too short The program must join the strings m and n with the join function The output must be displayed. Please name the program and provide at least one code comment (10)
IN JAVA 1. Create a program that prompts the user for an integer and then displays a message indicating whether or not the number is a perfect square. This can be determined by finding the square root of a number, truncating it (by casting the double result), and then squaring that result 2. Write a program that prompts the user for two numbers. The first number is a minimum value and the second number is a maximum value. RandomNum then...
1. Backward String Design a program that prompts the user to enter a string and then displays the string contents backward. For instance, if the user enters “gravity” the program should display “ytivar" -VB or Visual Studio. It must be turned into a GUI program. Make sure to write comments and include pseudocode. -Paste a screenshot of the pseudocode, the VB code, and of the program running into a PDF.
Write a C program that prompts the user to enter a binary value, multiplies it by ten, then displays the result in binary. (“Binary” here means that the user communicates with the program in ones and zeros.) Your main function should a) declare a char array, b) call the readLn function to read from the keyboard c) call a function to convert the input text string to an int d) multiply the int by ten e) call a function to...
IN C language Write a C program that prompts the user to enter a line of text on the keyboard then echoes the entire line. The program should continue echoing each line until the user responds to the prompt by not entering any text and hitting the return key. Your program should have two functions, writeStr andcreadLn, in addition to the main function. The text string itself should be stored in a char array in main. Both functions should operate...
USE PYTHON 3Write a program that prompts the user to enter the number of students and each student's score, and displays the highest and second- highest scores.
USING PYTHON - Write a program that calls a function that prompts the user to enter a real number. The function should verify that the user entered a valid real number, and should prompt the user to re-enter any invalid input. After a valid real number has been entered, the function should return the number as a number. To test your function, from a main function, call the function two separate times and print the sum of the two numbers...
Write a Python program that prompts the user to enter integer values for each of two lists. It then should displays whether the lists are of the same length, whether the elements in each list sum to the same value, and whether there are any values that occur in both lists.
Python 3 **11.40 (Guess the capitals) Write a program that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. Assume that 50 states and their capitals are stored in a two- dimensional list, as shown in Figure 11.13. The program prompts the user to answer all the states’ capitals and displays the total correct count. The user’s answer is not case sensitive. Implement the program...