Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

The Problem

Write a program that translates to and from Morse Code. Use the curl library and a website (e.g. http://morse.socs.uoguelph.ca/cgi­bin/morse.pl) to do the actual translations. Your program must take the user input, call the remote perl script using curl, process the response and display the appropriate results to the user. You may use any suitable website for translation but you must call the site using curl. There is a curl­utility file in the A2 algorithm folder (in the examples repo) that you may use to simplify your use of curl. 

Your program should permit the user to enter text to be translated to morse code, or to enter dots and dashes to be translated to text. A dot is represented by the period (.) and a dash is represented by the hyphen (­). Separate words by spaces.

Musts: How to get more than ZERO

? Compile, with no errors using ­ansi ­Wall ­pedantic (on the raspberry pi (raspbian))

? Run and take both types of user input without crashing

The Basics: The first 80%

You can get 80% on this assignment by just following the instructions. If you meet each of the expectations listed, you should get most or all of the 80 marks allocated to basic functionality.  

Expectations for your Program

? The user can choose to enter text or morse code (up to 200 characters)

? The program loops until the user asks to quit

? Allow the user to see previous results (keep a history)

? When taking morse code input, prevent all input that is not a dot, dash or space

? The user interface is intuitive and pleasant to use (may use ncurses) and does not leave the user with a cluttered, confusing screen.

? The website used may be hardcoded, you do not have to let the user choose the translation service.

? The program gives correct translations.

 

Expectations for your Code

? Use the curl library (you may use the curl utility that is provided with the assignment algorithm files)

? Separate functions and main into different source files

? Root assignment folder has src/ include/ doc/ and bin/ subdirectories that are used properly. If needed use lib/ and assets/ subdirectories as well.

? make correct use of dynamic memory (including freeing pointers)

? dynamically allocate arrays and strings to be the correct length for the input

?Source code is divided properly into .c and .h files with required headers in .cfile (see the policies document)

? Source code is consistently indented using spaces

? Comments about function parameters and return values purpose are present (ideally in .h files). Comments about algorithm logic are in .c files

? Variable and function names are meaningful and are in camelCase

? Program compiles with a makefile that places the executable in the bin/ folder

Things you will need to know

? The basics of International Morse Code (http://morsecode.scphillips.com/morse2.html)

? The structure of an html document (so you can parse through the returned result)

? Dynamic Arrays

? Array processing and/or string.h library functions

? malloc and free

? How to use git to clone, commit, push

? How to write a simple makefile

? How to place files in folders

 

Enhancements: How to get the last 20%

The final 20% of the marks for this assignment are earned by showing that you have mastered the programming constructs and that you are an adept problem solver. You do not need to do all of the following to get graded on the last 20% of the assignment, but you do need to demonstrate (verbally when we grade you) that you have a solid understanding of how to approach them all and you need to have done at least one of these enhancements really well, or two of them to a functional­but­not­perfect level. Some of the enhancements are harder than others.

? Morse code is primarily intended to be heard. Add functionality to your program so that when text is translated to morse code, the user can hear the morse  code through speakers

? Use an LED/resistor set and the GPIO pins on the pi to visually display themorse code when english is translated to morse code. Judi has some LED/resistor sets you can purchase or you can build your own by following these instructions (http://www.thirdeyevis.com/pi-page-2.php). Our TA (Bill) has a C library you can use to simplify GPIO interaction. Youll need to ask us for it if you want it.

? Use a parsing library to parse the HTML instead of writing your own special purpose parser. Be sure to include the library files in your submission and to write your makefile to look in the lib/ folder for your library

Deliverables: Things you must hand in

1. (via git) The assignment files are in a subdirectory of your coursework repository. The subdirectory must be called A2 (capitalization is important)

2. A plain text file called README is in the root folder of the assignment (A2). It contains information about running and using your program as well as any known limitations of the program.

3. You have a makefile that will compile your code and place the executable in the bin subfolder. The makefile is in the root directory of the assignment. The makefile should not run your program.

4. Information about how you tested your program is in the testing document

5. Your reference list is in the doc subfolder

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9209939

Have any Question?


Related Questions in C/C++

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As