THE ATTACHMENTS:( needed to solve the problem above)
(1) My Morse Code Program:
#03/22/2018
#Creating a program that translates sentences in to morse code
def main():
morsecode_dict={}
line=""
f1 = open("MorseCode.txt",'r');
content = f1.readlines()
for x in content:
#print x
x=x.split()
my_dict[x[0]]=x[1]
print (morsecode_dict)
val=raw_input("Enter a String value: ")
val.upper()
output=""
for i in val:
print (i.upper())
if(i!=' '):
output = output + morsecode_dict[i.upper()]+' '
else:
output = output+'\n'
print ("-----Morse Code of The Given Sentence----- \n",output)
main()
(2) My leap year Program
#prompt user for a year
year = int(input("Enter a year: "))
#process year to see if divisible by 4 or, if a century,
divisible by 400
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print "The year", year, "is a leap year"
else:
print "The year", year, "is not a leap year"
(3) testFahr2Cel.bat (won't let me upload files so copy and paste below)
echo off echo "Testing Fahr2Cel.py program" echo. echo "Enter 212F, answer should be 100C" echo 212 | Fahr2Cel.py echo. echo "Enter 32F, answer should be 0C" echo 32 | Fahr2Cel.py echo. echo "Enter -40F, answer should be -40C" echo -40 | Fahr2Cel.py
(4) Fahr2Cel.py (won't let me upload files so copy and paste below)
#!C:\Users\974student\AppData\Local\Programs\Python\Python35-32\python.exe # Converts Fahrenheit to Celsius # 2/10/2015 #input fahrenheit = input('Enter temperature in Fahrenheit: ') fahrenheit = float(fahrenheit) #processing celsius = (fahrenheit - 32.0) * 5/9 #output print ('The temperature in Celsius is', celsius)
If you have any doubts, please give me comment... I will help you...
morseCode.py
#03/22/2018
#Creating a program that translates sentences in to morse code
def main():
morsecode_dict={}
line=""
f1 = open("MorseCode.txt",'r');
content = f1.readlines()
for x in content:
#print x
x=x.split()
morsecode_dict[x[0]]=x[1]
print (morsecode_dict)
val=raw_input("Enter a String value: ")
val.upper()
output=""
for i in val:
if(i!=' '):
output = output + morsecode_dict[i.upper()]+' '
else:
output = output+'\n'
print ("-----Morse Code of The Given Sentence----- \n",output)
main()
only this program is getting error. I modified the code... rest of programs correct... you can use as it is...
MorseCodes.txt
A .-
B -...
C -.-.
D -..
E .
F ..-.
G --.
H ....
I ..
J .---
K -.-
L .-..
M --
N -.
O ---
P .--.
Q --.-
R .-.
S ...
T -
U ..-
V ...-
W .--
X -..-
Y -.--
Z --..
0 -----
1 .----
2 ..---
3 ...--
4 ....-
5 .....
6 -....
7 --...
8 ---..
9 ----.
THE ATTACHMENTS:( needed to solve the problem above) (1) My Morse Code Program: #03/22/2018 #Creating a...
Program Description: A Java program is to be created to produce Morse code. The Morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). In sound-oriented systems, the dot represents a short sound and the dash represents a long sound. Separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. In a sound-oriented...
PLEASE WRITE CODE FOR C++ ! Time Validation, Leap Year and Money Growth PartA: Validate Day and Time Write a program that reads a values for hour and minute from the input test file timeData.txt . The data read for valid hour and valid minute entries. Assume you are working with a 24 hour time format. Your program should use functions called validateHour and validateMinutes. Below is a sample of the format to use for your output file timeValidation.txt : ...
Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs opening any of the 3 For example, (user input shown in caps in first line) Enter first...
C++ (1) Write a program to prompt the user for an input and output file name. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs. For example, (user input shown in caps in first line, and in second case, trying to write to a folder which you may not have write authority in) Enter input filename: DOESNOTEXIST.T Error opening input file: DOESNOTEXIST.T...
FINDING THE LEAP YEARS (14 points) From Wikipedia, "A leap year (also known as an intercalary year or bissextile year) is a calendar year containing one additional day (or, in the case of lunisolar calendars, a month) added to keep the calendar year synchronized with the astronomical or seasonal year." In the Gregorian calendar, which is in use today, to determine leap year: A year is a leap year if it is divisible by 400 Or it is divisible by...
package _solution; /** This program demonstrates how numeric types and operators behave in Java Do Task #1 before adding Task#2 where indicated. */ public class NumericTypesOriginal { public static void main (String [] args) { //TASK #2 Create a Scanner object here //identifier declarations final int NUMBER = 2 ; // number of scores int score1 = 100; // first test score int score2 = 95; // second test score final int BOILING_IN_F = 212; // boiling temperature double fToC;...
ZYBOOKS LAB: 10.23.1 Hello, I'm trying to solve this problem with creating a program code in Python about People's Weights. Here is the question: 10.23 LAB: Warm up: People's weights (Lists) (1) Prompt the user to enter four numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output the list. (2 pts) Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 176.0 Enter weight 4: 166.3 Weights: [236.0, 89.5, 176.0, 166.3]...
I need this Program code made for Java please with the sample results. Echo Input from the Console to the Screen Using Methods Review the resources and instructions in the Discussion Prep Study before completing this discussion. For this discussion, you practiced using Java methods to echo input from the console to the screen. Create a Java program that reads in any value entered at the console and then prints it out to the screen. The program must have at...
Lab/HW 3 Write a program that reads in the following data, all entered on one line with at least one space separating them: a) an integer representing a month b) an integer representing the day of the month c) an integer representing a year 1. Check that the month is between 1 and 12. If it’s not print an error message. 2. Day cannot be 0 or less nor can it be more than 31 for all months. Print...
C Program In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below. Command Line Parameters Your program must compile and run from the command line. The program executable must be named “vigenere” (all lower...