1- Write a program that creates a dictionary of the English words for all single digit numbers as follows:
1: 'one', 2: 'two', 3: 'three', etc.
2- Write a function called numConvert that receives the above dictionary and an integer number as parameters, and prints the English words for all the number's digits. For example, if the function receives 2311, it will print:
two
three
one
one
3- Test your program by adding a main function, which calls numConvert.
4- Save your program in a file called toEnglish.py and use the following link to submit your file.
PLEASE ADD CODE EXPLAINING EACH LINE OF CODE
THANK YOU
def numConvert(dic,num): #function which accepts a dictionary
and an integer and prints the English words for all the number's
digits.
if(num>0):
temp=num % 10 #extract the last digit and print in reverse order
using recursion
num=int(num/10)
numConvert(dic,num)
print(dic[temp])
def main(): #main function
num=input("Enter a number:")
num=int(num)
dic ={1: 'one', 2: 'two', 3: 'three',4: 'four',5: 'five',6:
'six',7: 'seven',8: 'eight',9: 'nine',0: 'zero'}
numConvert(dic,num)
main()
output:

1- Write a program that creates a dictionary of the English words for all single digit...
PYTHON 1- Write a program that creates a dictionary of the English words for all single digit numbers as follows: 1: 'one', 2: 'two', 3: 'three', etc. 2- Write a function called numConvert that receives the above dictionary and an integer number as parameters, and prints the English words for all the number's digits. For example, if the function receives 2311, it will print: two three one one 3- Test your program by adding a main function, which calls numConvert....
Write a program IN PYTHON that checks the spelling of all words in a file. It should read each word of a file and check whether it is contained in a word list. A word list available below, called words.txt. The program should print out all words that it cannot find in the word list. Requirements Your program should implement the follow functions: main() The main function should prompt the user for a path to the dictionary file and a...
You are given an input C++ string and a dictionary of English words. You are asked to see if the input is consisted of words only in the dictionary. For example: Example #1 Input string = "joe"; Input dictionary = { "joe1", "joe" }; Output: true Explanation: "joe" is in the dictionary. Example #2 Input string = "joey"; Input dictionary = { "joe1", "joe" }; Output: false Explanation: even though "joe" is in the dictionary, "y" is not. Example #3...
In Java. Write a program in a single file that: Main: Creates 10 random doubles, all between 1 and 11, Calls a class that writes 10 random doubles to a text file, one number per line. Calls a class that reads the text file and displays all the doubles and their sum accurate to two decimal places. There has to be three classes, main for create random numbers, one to write , one to read all in the same file...
PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.
Write a C++ program that inputs a single letter and prints out the corresponding digit on the telephone.The letters and digits on a telephone are grouped this way:2 = ABC 4 = GHI 6 = MNO 8 = TUV3 = DEF 5 = JKL 7 = PRS 9 = WXYNo digits correspond to either Q or Z. For these two letters, your program should print a messageindicating that they are not used on a telephone. If a letter in lower...
Write a program in C that creates an array of 100 random numbers from 0-99. The program sums the random numbers and prints the sum. It then writes the numbers to a new file using open, close and write. Then looks in the current directory for files that match the pattern “numbers.XXXX”. For each file, open the file and read the file. You can assume that the file will contain 100 integers. Sum the integers. Print the filename and the sum...
All the white space among words in a text file was lost. Write a C++ program which using dynamic programming to get all of the possible original text files (i.e. with white spaces between words) and rank them in order of likelihood with the best possible runtime. You have a text file of dictionary words and the popularity class of the word (words are listed from popularity 1-100 (being most popular words), 101-200, etc) - Input is a text file...
Write a program that asks the user to input a 4-digit integer and then prints the integer in reverse. Your program needs to implement a function reverse that will take in as input the 4-digit number and print it out in reverse. Your code will consist of two files: main.s and reverse.s. Main.s will ask for the user input number and call the function reverse. For ARM/Data Structure needs to be able to run on Pi Reverse.s will take in...
Digit to WordsWrite a C program that asks the user for a two-digit number, then prints the English wordfor the number. Your program should loop until the user wants to quit.Example:Enter a two-digit number: 45You entered the number forty-five.Hint: Break the number into two digits. Use one switch statement to print the word for the firstdigit (“twenty,” “thirty,” and so forth). Use a second switch statement to print the word for thesecond digit. Don’t forget that the numbers between 11...