Starting out with Visual C# (4th Edition)
Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 8, Problem 6PP
Program Plan Intro

Word separator

Program plan:

Design the form:

  • Place two label box controls on the form, and change its name and properties.
  • Place one text box control on the form, and change its name and properties to get the sentence from user.
  • Place one command button control on the form, and change its name and properties to separate the word and display it into label box.

In code window, write the code:

Program.cs:

  • Include the required libraries.
  • Define the namespace “WordSeparator”.
    • Define a class “Program”.
      • Define a constructor for the class.
      • Define required functions to run “Form1”.

Form1.cs:

  • Include the required libraries.
  • Define namespace “WordSeparator”.
    • Define a class “Form1”.
    • In btnConvert() method,
      • Declare the required variables.
      • Check whether the input is character and it is uppercase letter. If yes, separate the word. So, each and every word in a sentence.
      • Display the separated word in a label box.
    • Close the application.

Form Design:

View the Form Design in IDE.

Starting out with Visual C# (4th Edition), Chapter 8, Problem 6PP

Set the Form Control properties in Properties window as follows:

ObjectPropertySetting
Form1TextProgram8_6
label1TextEnter a sentence.
textBox1Text(Empty)
lblResultText(Empty)
btnConvertTextConvert
  • Add two label box controls to the form from Toolbox.
  • Add one text box control to the form from Toolbox.
  • Add one command button control to the form from Toolbox.

Blurred answer
Students have asked these similar questions
Word Separator Create an application that accepts as input a sentence in which all the words are run together but the first character of each word is uppercase. Convert the sentence to a string in which the words are separated by spaces and only the first word starts with an uppercase letter. For example, the string "StopAndSmellTheRoses." would be converted to "Stop and smell the roses."
Pig Latin Create an application that accepts a sentence as input and converts each word to “Pig Latin.” In one version, to convert a word to Pig Latin you remove the first letter and place that letter at the end of the word. Then you append the string "ay" to the word. Here is an example: English: I SLEPT MOST OF THE NIGHT Pig Latin: IAY LEPTSAY OSTMAY FOAY HETAY IGHTNAY
Sentence Capitalizer Create an application with a method that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is "hello. my name is Joe. what is your name?" the method should return the string "Hello. My name is Joe. What is your name?" The application should let the user enter a string and then pass it to the method. The modified string should be displayed.

Chapter 8 Solutions

Starting out with Visual C# (4th Edition)

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
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT