diff --git a/FirstProgram/CreateEmail.hs b/FirstProgram/CreateEmail.hs new file mode 100644 index 0000000..0458186 --- /dev/null +++ b/FirstProgram/CreateEmail.hs @@ -0,0 +1,23 @@ +toPart :: [Char] -> [Char] +toPart recipient = "Dear " ++ recipient ++ ",\n" + +bodyPart :: [Char] -> [Char] +bodyPart bookTitle = "Thanks for Purchasing" ++ bookTitle ++ ".\n" + +fromPart :: [Char] -> [Char] +fromPart author = "Thanks, \n" ++ author + +createEmail :: [Char] -> [Char] -> [Char] -> [Char] +createEmail recipient bookTitle author = toPart recipient ++ + bodyPart bookTitle ++ + fromPart author + +main :: IO () +main = do + print "Who is the email for?" + recipient <- getLine + print "What is the Title?" + title <- getLine + print "Who is the Author?" + author <- getLine + print (createEmail recipient title author) \ No newline at end of file