Input various sentences as c-strings and perform conversions

Assignment Help Computer Engineering
Reference no: EM132093893

Pig Latin Strings

Write a Program in C++.

Task: Input various sentences as C-strings and perform 2 conversions on each sentence using C-string commands.

1. Reverse the order of the words, and print all letters in upper case; there will be no punctuation in this version.

2. Change the original line to pig latin; print this version all in lower case except start the pig latin sentence with a capital letter. The only punctuation will be a period at the end.

The entire program will be written using only C-strings. Do not use string class objects for any part of it. As you process the conversions, assemble the results into complete strings, and print out only complete strings (don't print a word at a time or a char at a time as you loop through a string).

There are various ways that this program may be written. If you choose to use strtok, remember to make a copy of each word as it is extracted from the original string. Don't use the word pointer itself, or the loop will not work correctly.

Pig Latin rules:

* if a word begins with a vowel, append "-way" to the end:

            "eye" becomes "eye-way"

* if a word starts with a consonant, identify the consonants up to the first vowel and move these consonants to the end of the word, then add "ay":

            "slant" becomes "ant-slay"

Input: Input can be interactive or read from a file.

For the printed output, use at least these lines as input:

            I love Paris in the Spring time.

            Mary, my friend, had a lamb.

            Hello? Hello? Are you still there?

            John said, "Whoop Dee Doo!", then skipped, hopped, and twirled.

Output: Send the output to an external file. Print a header at the top of the page with at least your name, the date, and a title. Then print each input line, followed by the two conversions.

Example:

If the input line was:

            Hello? Hello? Are you still there?

The output would be:

            Hello? Hello? Are you still there?

            THERE STILL YOU ARE HELLO HELLO

            Ello-hay ello-hay are-way ou-yay ill-stay ere-thay.

Reference no: EM132093893

Questions Cloud

What is the most efficient algorithm you can come up : What is the most efficient algorithm you can come up with to decide if you can throw a set of parties such that each of your n friends attends a party?
Identify the relevant costs in given situations : In the previous module, you responded to a discussion prompt that asked you to identify the relevant costs when trying to decide between three educational.
Describe the physical security controls that are available : Describe the physical security controls that are available for use in securing technical information assets.
How do you think stakeholders will rely on the assurances : Assume you are a member of this taskforce; discuss what types of assertions you would expect your client's management to make regarding socially responsible.
Input various sentences as c-strings and perform conversions : Reverse the order of the words, and print all letters in upper case; there will be no punctuation in this version.
Considered before starting computer forensic engagements : What are the legal factors that should be considered before starting computer forensic engagements?
What kind of pension plans do coca-cola and pepsico provide : The financial statements of Coca-Cola and PepsiCo are presented in Appendices C and D, respectively. The companies' complete annual reports, including.
Make a copy of the stack for back-up purposes : Suppose that after every K operations, we automatically make a copy of the stack for back-up purposes.
Describe the elements of sales promotion brief : List and describe the elements of a sales promotion brief. Describe the various way sampling can be utilized.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd