Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 8, Problem 10PP
Program Plan Intro
Morse Code Converter
Program plan:
Design the form:
- Place a one label box controls on the form, and change its name and properties.
- Place a one text box control on the form, and change its name and properties to get the string from user.
- Place a one list box control on the form, and change its name and properties to list the converted Morse code.
- Place a one command button control on the form, and change its name and properties to convert the string into Morse code and display it into list box.
In code window, write the code:
Program.cs:
- Include the required libraries.
- Define the namespace “MorseCode”.
- Define a class “Program”.
- Define a constructor for the class.
- Define required functions to run “Form1”.
- Define a class “Program”.
Form1.cs:
- Include the required libraries.
- Define namespace “MorseCode”.
- Define a class “Form1”.
- In btnTranslate() method,
- Declare the required variables.
- Convert input lower case letter to upper case letter.
- Convert the string to Morse code.
- Display the converted code in a list box.
- Close the application.
Form Design:
View the Form Design in IDE.
Set the Form Control properties in Properties window as follows:
Object | Property | Setting |
Form1 | Text | Program8_10 |
label1 | Text | Enter a string: |
textBox1 | Text | (Empty) |
listBox1 | Items | (Collections) |
btnConvert | Text | Convert |
- Add one label box controls to the form from Toolbox.
- Add one text box control to the form from Toolbox.
- Add one list box control to the form from Toolbox.
- Add one command button control to the form from Toolbox.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
C# language
MORSE CODE CONVERTERDesign a program that asks the user to enter a string and thenconverts that string to Morse code. Morse code is a code whereeach letter of the English alphabet, each digit, and variouspunctuation characters are represented by a series of dots anddashes. Table 8-9 shows part of the code.
Needs to be two labels, two text boxes and click button for conversion
Odd Even Number
Problem Description
Even Numbers are integers that are exactly divisible by 2, whereas an odd number cannot be exactly divided by 2. Example of even numbers are 2,4,6,8 and odd numbers are 1, 3, 5, 7, 9.
Input
The first line input contains an integer, which determines the number of test cases. Each of following lines represent sequence of integers that ends with 0.
2
34 1 8 5 22 0
10 7 16 -2 0
Output
For each test case, the output will present the size of oddQueue and evenQueue following with the integers of odd and even numbers.
oddQueue 2: 1 5
evenQueue 3: 34 8 22
oddQueue 1: 7
evenQueue 3: 10 16 -2
** Your task is to write a program that will read the input and identify whether it is an odd number or even number.
/******************************************************************************* Compilation: javac Queue.java** The Queue class represents a first-in-first-out (FIFO) queue of generic items.* It supports the usual enqueue and dequeue…
C#
Chapter 8 Solutions
Starting out with Visual C# (4th Edition)
Ch. 8.2 - Declare a char variable named letter and assign...Ch. 8.2 - Prob. 8.2CPCh. 8.2 - Prob. 8.3CPCh. 8.2 - Write a foreach loop that displays each character...Ch. 8.2 - Write the first line of an if statement that calls...Ch. 8.2 - Write the first line of an if statement that calls...Ch. 8.2 - Write a statement that calls the char.ToUpper...Ch. 8.2 - Prob. 8.8CPCh. 8.2 - Prob. 8.9CPCh. 8.2 - Prob. 8.10CP
Ch. 8.2 - Prob. 8.11CPCh. 8.2 - A program has two string variables named vegetable...Ch. 8.2 - Prob. 8.13CPCh. 8.2 - What delimiter is used to separate data in a...Ch. 8.3 - Prob. 8.15CPCh. 8.3 - Prob. 8.16CPCh. 8.3 - Prob. 8.17CPCh. 8.3 - Prob. 8.18CPCh. 8.3 - Prob. 8.19CPCh. 8.3 - Suppose an application contains a structure named...Ch. 8.3 - Prob. 8.21CPCh. 8.3 - Prob. 8.22CPCh. 8.4 - Look at the following declaration: enum Flower {...Ch. 8.4 - Prob. 8.24CPCh. 8.4 - Prob. 8.25CPCh. 8.5 - Prob. 8.26CPCh. 8.5 - Prob. 8.27CPCh. 8.5 - Prob. 8.28CPCh. 8.5 - Prob. 8.29CPCh. 8.5 - Prob. 8.30CPCh. 8 - In C#, __________ are enclosed in single quotation...Ch. 8 - Prob. 2MCCh. 8 - Prob. 3MCCh. 8 - Prob. 4MCCh. 8 - Prob. 5MCCh. 8 - Prob. 6MCCh. 8 - __________ are spaces that appear at the beginning...Ch. 8 - Prob. 8MCCh. 8 - Prob. 9MCCh. 8 - Prob. 10MCCh. 8 - Prob. 11MCCh. 8 - The __________ file format is commonly used to...Ch. 8 - A __________ is a data type you can create that...Ch. 8 - Prob. 14MCCh. 8 - Prob. 15MCCh. 8 - When you create a(n) __________, you specify a set...Ch. 8 - Prob. 17MCCh. 8 - Prob. 18MCCh. 8 - Prob. 1TFCh. 8 - Prob. 2TFCh. 8 - Prob. 3TFCh. 8 - Prob. 4TFCh. 8 - Prob. 5TFCh. 8 - Structure objects can be passed into a method only...Ch. 8 - Prob. 7TFCh. 8 - Prob. 8TFCh. 8 - An enum declaration can only appear inside the...Ch. 8 - The integer values that you assign to enumerators...Ch. 8 - You can compare enumerators and enum variables...Ch. 8 - Prob. 12TFCh. 8 - What method can be used to convert a char variable...Ch. 8 - List the method you would use to determine whether...Ch. 8 - Prob. 3SACh. 8 - Briefly describe each of the following string...Ch. 8 - Prob. 5SACh. 8 - Prob. 6SACh. 8 - Assume an application contains a structure named...Ch. 8 - Can enumerators be used in a loop to step through...Ch. 8 - Prob. 9SACh. 8 - Prob. 10SACh. 8 - Prob. 1AWCh. 8 - Prob. 2AWCh. 8 - Look at the following structure declaration:...Ch. 8 - Declare an enumerated data type named Direction...Ch. 8 - Prob. 5AWCh. 8 - Prob. 1PPCh. 8 - Prob. 2PPCh. 8 - Sentence Capitalizer Create an application with a...Ch. 8 - Vowels and Consonants Create an application with a...Ch. 8 - Prob. 5PPCh. 8 - Prob. 6PPCh. 8 - Prob. 7PPCh. 8 - Prob. 8PPCh. 8 - Alphabetic Telephone Number Translator Many...Ch. 8 - Prob. 10PPCh. 8 - Drink Vending Machine Simulator Create an...Ch. 8 - Prob. 12PP
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Python Programmingarrow_forwardC# Programarrow_forwardFunction SubStr( St As String) As String Sum=1 for x=l to 8 if x mod 2 = 0 then S=Mid(St, x, x*2) Else S=Mid(St, x, x+2) End if Next x SubStr=S End Function Sub Cmd_Click() Label.text= SubStr("Phones:987456124123456744") End Sub 987456124 :9874561241 9874561241 98745612412arrow_forward
- Name Format - Use Javaarrow_forwardPEN and PAPER Debugging the Pseudocode. Hand write the correct pseudocode using pen and paper. for DEBUG03-02.txt: // This pseudocode is intended to display employee net pay values.// All employees have a standard $45 deduction from their checks.// If an employee does not earn enough to cover the deduction,// an error message is displayed.start Declarations string name num hours num rate string DEDUCTION = 45 string EOFNAME = "ZZZ" num gross num net output "Enter first name or ", EOFNAME, " to quit" input name if name not equal to EOFNAME output "Enter hours worked for ", name input hours output "Enter hourly rate for ", name input rate gross = hours * rate net = gross - DEDUCTION while net > 0 then output "Net pay for ", name, " is ", net else output "Deductions not covered. Net is 0." endwhile output "Enter next name or ", EOFNAME, " to quit" input name endif…arrow_forwardC#arrow_forward
- Vowels and Consonants Design a program that prompts the user to enter a string. The program should then display the number of vowels and the number of consonants in the string. IN Q BASIC LANGUAGEarrow_forwardlanguage JAVAarrow_forwardPython Program to Remove Punctuations From a String.arrow_forward
- 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 "“ytivarg."arrow_forwardA string is a term that refers to a group of objects that are connected byarrow_forwardStrings and string manipulation Part A: Building upon an Existing Solution Redesign the solution in the following manner. Ask the user for their name and their email addresses before you display the results of the conversions. When the user enters their email address search the string for the @ symbol. If the symbol is not found, ask the user to re-enter their email address till they get it right. When you display the conversion output to the user, you must include the user’s name in the output. Part B: Write Something New! Write a complete and syntactically correct Python program to solve the following problem: Input a date in numeric format from the user e.g. mm/dd/yy. Examine the month entered by the user, if it is larger than 12 or smaller than 1, issue an error message and ask for input again. Perform similar validation tests for the date and year. Year must be 2015. (Any other year is invalid). In addition, the year must only be two digits long.. Once all input has been…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr